Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (7b67100ffb4e1b99c755ee650a5d8166815a2368)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (7b67100ffb4e1b99c755ee650a5d8166815a2368)
  • Date: Fri, 16 Oct 2009 06:58:55 -0500

GIT changes to master sorcery by Jaka Kranjc <lynxlynxlynx AT sourcemage.org>:

ChangeLog | 5 +++++
var/lib/sorcery/modules/libdispel | 15 +++++++++++++--
var/lib/sorcery/modules/libinitd | 14 +++++++++++---
3 files changed, 29 insertions(+), 5 deletions(-)

New commits:
commit 7b67100ffb4e1b99c755ee650a5d8166815a2368
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libdispel: remove modified configs if they were modified back to the
original (reverted)

commit 71d971c9d6732d6983d571e65801ab4725f7ec98
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

don't create a useless backup file when staging init configs

commit 8fd6ad19a26e877c4bbda9ca6337fad5e5e97c73
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libinitd: if staging is on, mark the staged init file as modified,
fixes part of #15192

diff --git a/ChangeLog b/ChangeLog
index c231824..b1001ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
2009-10-16 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libtrack, libdispel: match complete lines when comparing md5s, fixes
part of #15192
+ * libinitd: if staging is on, mark the staged init file as modified,
+ fixes part of #15192
+ don't create a useless backup file when staging init configs
+ * libdispel: remove modified configs if they were modified back to the
+ original (reverted)

2009-10-10 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* protected: added tr for heisenbug #15408
diff --git a/var/lib/sorcery/modules/libdispel
b/var/lib/sorcery/modules/libdispel
index 39f2f49..4eb91c9 100755
--- a/var/lib/sorcery/modules/libdispel
+++ b/var/lib/sorcery/modules/libdispel
@@ -38,14 +38,25 @@ function reap_regular_files() {
#---------------------------------------------------------------------
function reap_config_files() {
debug "libsorcery" "reap_config_files()"
- local FILE
+ local FILE md5
while read FILE; do
[[ $FILE ]] || continue
if [[ $TOTAL_DISPEL ]] ; then
rm -f "$FILE"
- elif grep -qX "$(md5sum "$FILE")" "$MD5S"; then
+ continue
+ fi
+
+ md5=$(md5sum "$FILE")
+ orig="$SCRIPT_DIRECTORY/init.d/${FILE##*/}.conf"
+ if grep -qX "$md5" "$MD5S"; then
debug libdispel "$FILE is a config file that hasnt changed,
removing..."
rm -f "$FILE"
+ # this check only handles sysconfig files, since they're the only ones
+ # nicely available at this point
+ elif [[ -f $orig ]] &&
+ [[ $(cut -d" " -f1 <<< "$md5") == $(md5sum "$orig" | cut -d" " -f1) ]];
then
+ debug libdispel "$FILE is a config file that was reverted to the
default, removing..."
+ rm -f "$FILE"
else
reap_modified_file "$FILE"
fi
diff --git a/var/lib/sorcery/modules/libinitd
b/var/lib/sorcery/modules/libinitd
index c9b4148..ca71720 100755
--- a/var/lib/sorcery/modules/libinitd
+++ b/var/lib/sorcery/modules/libinitd
@@ -98,8 +98,11 @@ function _init_merge_config_file()
return 0
fi

- local savetime=$( date +'%Y%m%d%H%M' )
- install -g root -o root $2 $2.$savetime.backup
+ # no need for a backup when staging, since the installation will be
deffered
+ if [[ $STAGED_INSTALL != on ]]; then
+ local savetime=$( date +'%Y%m%d%H%M' )
+ install -g root -o root $2 $2.$savetime.backup
+ fi

for opt in $new_opts ; do
message " Merging option $opt into $2..."
@@ -141,7 +144,12 @@ function _init_install_conf_files()
fi

if [ -f "$target_file" ] ; then
- check_if_modified "$target_file" && mark_file_modified "$target_file"
+ check_if_modified "$target_file" &&
+ if [[ $STAGED_INSTALL == on ]]; then
+ mark_file_modified "$STAGE_DIRECTORY/TRANSL$target_file"
+ else
+ mark_file_modified "$target_file"
+ fi
_init_merge_config_file $file $target_file
else
install -m 644 -g root -o root $file $target_file



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (7b67100ffb4e1b99c755ee650a5d8166815a2368), Jaka Kranjc, 10/16/2009

Archive powered by MHonArc 2.6.24.

Top of Page