[debhelper-devel] [debhelper] 02/02: Drop all uses of autoscripts/*-moveconffile

Niels Thykier nthykier at moszumanska.debian.org
Mon May 30 20:37:08 UTC 2016


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit 5c8c226f721874ddaaae4b034c76559d9f31198a
Author: Niels Thykier <niels at thykier.net>
Date:   Mon May 30 20:35:08 2016 +0000

    Drop all uses of autoscripts/*-moveconffile
    
    The transition for these must have been completed with Wheezy (and
    probably even Squeeze).
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 autoscripts/postinst-moveconffile |  9 ---------
 autoscripts/preinst-moveconffile  |  9 ---------
 debian/changelog                  |  5 +++++
 dh_installmodules                 |  7 ++-----
 dh_installudev                    | 16 ----------------
 5 files changed, 7 insertions(+), 39 deletions(-)

diff --git a/autoscripts/postinst-moveconffile b/autoscripts/postinst-moveconffile
deleted file mode 100644
index 28f061e..0000000
--- a/autoscripts/postinst-moveconffile
+++ /dev/null
@@ -1,9 +0,0 @@
-if [ "$1" = configure ]; then
-	if [ -e "#OLD#" ]; then
-		echo "Preserving user changes to #NEW# ..."
-		if [ -e "#NEW#" ]; then
-			mv -f "#NEW#" "#NEW#.dpkg-new"
-		fi
-		mv -f "#OLD#" "#NEW#"
-	fi
-fi
diff --git a/autoscripts/preinst-moveconffile b/autoscripts/preinst-moveconffile
deleted file mode 100644
index 619b4ce..0000000
--- a/autoscripts/preinst-moveconffile
+++ /dev/null
@@ -1,9 +0,0 @@
-if [ "$1" = install ] || [ "$1" = upgrade ]; then
-	if [ -e "#OLD#" ]; then
-		if [ "`md5sum \"#OLD#\" | sed -e \"s/ .*//\"`" = \
-		     "`dpkg-query -W -f='${Conffiles}' #PACKAGE# | sed -n -e \"\\\\' #OLD# '{s/ obsolete$//;s/.* //p}\"`" ]
-		then
-			rm -f "#OLD#"
-		fi
-	fi
-fi
diff --git a/debian/changelog b/debian/changelog
index bb16cfe..b99c5df 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,11 @@ debhelper (9.20160403+unreleased) UNRELEASED; urgency=medium
   * ant.pm: Apply patch from Emmanuel Bourg to pass a
     normalised "user.name" parameter to ant.
     (Closes: #824490)
+  * dh_installudev/dh_installmodules: Drop maintainer
+    script snippets for migrating conffiles.
+    - Side effect, avoids portability issue with certain
+      shell implementations.  (Closes: #815158)
+  * autoscripts/*inst-moveconffile: Remove unused files.
 
  -- Niels Thykier <niels at thykier.net>  Sat, 09 Apr 2016 09:20:32 +0000
 
diff --git a/dh_installmodules b/dh_installmodules
index 031bc73..b4b2e67 100755
--- a/dh_installmodules
+++ b/dh_installmodules
@@ -94,11 +94,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		if (! -e "$tmp/etc/modprobe.d") {
 			install_dir("$tmp/etc/modprobe.d");
 		}
-		my $old="/etc/modprobe.d/".pkgfilename($package);
-		my $new=$old.".conf";
-		install_file($modprobe_file, "$tmp/$new");
-		autoscript($package,"preinst","preinst-moveconffile","s!#OLD#!$old!g;s!#PACKAGE#!$package!g");
-		autoscript($package,"postinst","postinst-moveconffile","s!#OLD#!$old!g;s!#NEW#!$new!g");
+		my $path = '/etc/modprobe.d/' . pkgfilename($package) . '.conf';
+		install_file($modprobe_file, "$tmp/$path");
 	}
 	
 	if (! $dh{NOSCRIPTS}) {
diff --git a/dh_installudev b/dh_installudev
index fa134ea..5a07d34 100755
--- a/dh_installudev
+++ b/dh_installudev
@@ -20,9 +20,6 @@ B<dh_installudev> [S<I<debhelper options>>] [B<-n>] [B<--name=>I<name>] [B<--pri
 B<dh_installudev> is a debhelper program that is responsible for
 installing B<udev> rules files.
 
-Code is added to the F<preinst> and F<postinst> to handle the upgrade from the
-old B<udev> rules file location.
-
 =head1 FILES
 
 =over 4
@@ -47,10 +44,6 @@ debian/I<package>.udev.
 
 Sets the priority the file. Default is 60.
 
-=item B<-n>, B<--noscripts>
-
-Do not modify F<preinst>/F<postinst> scripts.
-
 =back
 
 =head1 NOTES
@@ -103,15 +96,6 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		}
 		my $rule="/lib/udev/rules.d/$dh{PRIORITY}$filename";
 		install_file($rules_file, "${tmp}${rule}");
-		if (! $dh{NOSCRIPTS}) {
-			# Remove old rule from /etc, unless it's modified,
-			# in which case we rename it to match the new
-			# file in /lib, so it will override.
-			my $old="/etc/udev/rules.d/$old_priority$oldfilename";
-			$rule=~s/^\/lib/\/etc/;
-			autoscript($package,"preinst","preinst-moveconffile","s!#OLD#!$old!g;s!#NEW#!$rule!g;s!#PACKAGE#!$package!g");
-			autoscript($package,"postinst","postinst-moveconffile","s!#OLD#!$old!g;s!#NEW#!$rule!g");
-		}
 	}
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list