Prechádzať zdrojové kódy

dpkg-maintscript-helper: Print only once that we are moving a conffile

Move the printing to the final phase, and skip the intermediate message
that we are moving the file aside for later processing. This information
is redundant and really unnecessary. It also does not match the other
actions in the script.

Closes: #747370
Guillem Jover 12 rokov pred
rodič
commit
a987464f05
2 zmenil súbory, kde vykonal 4 pridanie a 3 odobranie
  1. 2 0
      debian/changelog
  2. 2 3
      scripts/dpkg-maintscript-helper.sh

+ 2 - 0
debian/changelog

@@ -18,6 +18,8 @@ dpkg (1.17.10) UNRELEASED; urgency=low
     prepend, instead of appending, the " (deleted)" marker in /proc/PID/exe.
     prepend, instead of appending, the " (deleted)" marker in /proc/PID/exe.
     Closes: #731530
     Closes: #731530
   * Move dpkg-architecture -L argument to the Commands --help output section.
   * Move dpkg-architecture -L argument to the Commands --help output section.
+  * Make dpkg-maintscript-helper print only once that we are moving a
+    conffile, and not on every interim state transition. Closes: #747370
 
 
   [ Updated manpages translations ]
   [ Updated manpages translations ]
   * German (Helge Kreutzmann).
   * German (Helge Kreutzmann).

+ 2 - 3
scripts/dpkg-maintscript-helper.sh

@@ -92,11 +92,8 @@ prepare_rm_conffile() {
 	local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PACKAGE | \
 	local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PACKAGE | \
 		sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
 		sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
 	if [ "$md5sum" != "$old_md5sum" ]; then
 	if [ "$md5sum" != "$old_md5sum" ]; then
-		echo "Obsolete conffile $CONFFILE has been modified by you."
-		echo "Saving as $CONFFILE.dpkg-bak ..."
 		mv -f "$CONFFILE" "$CONFFILE.dpkg-backup"
 		mv -f "$CONFFILE" "$CONFFILE.dpkg-backup"
 	else
 	else
-		echo "Moving obsolete conffile $CONFFILE out of the way..."
 		mv -f "$CONFFILE" "$CONFFILE.dpkg-remove"
 		mv -f "$CONFFILE" "$CONFFILE.dpkg-remove"
 	fi
 	fi
 }
 }
@@ -105,6 +102,8 @@ finish_rm_conffile() {
 	local CONFFILE="$1"
 	local CONFFILE="$1"
 
 
 	if [ -e "$CONFFILE.dpkg-backup" ]; then
 	if [ -e "$CONFFILE.dpkg-backup" ]; then
+		echo "Obsolete conffile $CONFFILE has been modified by you."
+		echo "Saving as $CONFFILE.dpkg-bak ..."
 		mv -f "$CONFFILE.dpkg-backup" "$CONFFILE.dpkg-bak"
 		mv -f "$CONFFILE.dpkg-backup" "$CONFFILE.dpkg-bak"
 	fi
 	fi
 	if [ -e "$CONFFILE.dpkg-remove" ]; then
 	if [ -e "$CONFFILE.dpkg-remove" ]; then