From 4ad78d9db390d7c68d48fc9017fbec516a68a9fe Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 2 Mar 2009 21:20:29 -0500 Subject: conffile moving idiocy * dh_installmodules: Give files in /etc/modprobe.d a .conf syntax, as required by new module-init-tools. * dh_installmodules: Add preinst and postinst code to handle cleanly renaming the modprobe.d files on upgrade. * Two updates to conffile moving code from wiki: - Support case where the conffile name is a substring of another conffile's name. - Support case where dpkg-query says the file is obsolete. --- dh_installmodules | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'dh_installmodules') diff --git a/dh_installmodules b/dh_installmodules index 6a08eb77..6bb22500 100755 --- a/dh_installmodules +++ b/dh_installmodules @@ -21,7 +21,7 @@ dh_installmodules is a debhelper program that is responsible for registering kernel modules. Files named debian/package.modprobe will be installed in -etc/modprobe.d/package in the package build directory, to be used by +etc/modprobe.d/package.conf in the package build directory, to be used by module-init-tools's version of modprobe. Kernel modules are searched for in the package build directory and if @@ -102,7 +102,11 @@ foreach my $package (@{$dh{DOPACKAGES}}) { if (! -e "$tmp/etc/modprobe.d") { doit("install","-d","$tmp/etc/modprobe.d"); } - doit("install","-m","0644",$modprobe_file,"$tmp/etc/modprobe.d/".pkgfilename($package)); + my $old="/etc/modprobe.d/".pkgfilename($package); + my $new=$old.".conf"; + doit("install","-m","0644",$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"); } if (! $dh{NOSCRIPTS}) { -- cgit v1.2.3