diff options
-rw-r--r-- | debian/changelog | 7 | ||||
-rwxr-xr-x | dh_installmodules | 18 | ||||
-rw-r--r-- | dh_installmodules.1 | 4 |
3 files changed, 25 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index 04beb889..a937bb6c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debhelper (2.0.96) unstable; urgency=low + + * dh_installmodules: still add depmod -a calls if run on a package that + has no debian/modules file, but does contain modules. + + -- Joey Hess <joeyh@debian.org> Thu, 4 May 2000 15:32:42 -0700 + debhelper (2.0.95) unstable; urgency=low * Fixes for perl 5.6. diff --git a/dh_installmodules b/dh_installmodules index a8016306..dd75c72b 100755 --- a/dh_installmodules +++ b/dh_installmodules @@ -3,8 +3,19 @@ # Register modules with modutils. use Debian::Debhelper::Dh_Lib; +use File::Find; init(); +# Returns true if there are any .o files in the passed directory. +sub find_kernel_modules { + my $searchdir=shift; + my @results=(); + + return unless -d $searchdir; + find(sub { push @results, $_ if /\.o$/ }, $searchdir); + return @results > 0; +} + foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); $file=pkgfile($PACKAGE,"modules"); @@ -18,10 +29,11 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { doit("install","-d","$TMP/etc/modutils"); doit("install","-m","0644",$file,"$TMP/etc/modutils/$PACKAGE"); } - - if (! $dh{NOSCRIPTS}) { + } + + if (! $dh{NOSCRIPTS} && + ($file || find_kernel_modules("$TMP/lib/modules"))) { autoscript($PACKAGE,"postinst","postinst-modules","s/#PACKAGE#/$PACKAGE/"); autoscript($PACKAGE,"postrm","postrm-modules","s/#PACKAGE#/$PACKAGE/"); - } } } diff --git a/dh_installmodules.1 b/dh_installmodules.1 index fb3a3157..aee47d36 100644 --- a/dh_installmodules.1 +++ b/dh_installmodules.1 @@ -15,7 +15,9 @@ in the package build directory. Then postinst and postrm commands are automatically generated to register the modules when the package is installed. See .BR dh_installdeb (1) -for an explanation of how this works. +for an explanation of how this works. Note that this will be done for any +package this program acts on which has either the above-mentioned file, or +has .o files in /lib/modules. .SH OPTIONS .TP .B debhelper options |