diff options
author | joey <joey> | 2000-05-04 22:52:49 +0000 |
---|---|---|
committer | joey <joey> | 2000-05-04 22:52:49 +0000 |
commit | 2c5020419c6e499779c350f2c04e0c950303ef03 (patch) | |
tree | 356c1fc1bfddde738879ed743600352664b9cf98 /dh_installmodules | |
parent | fd9a5d1c473866b021b703cc06878baa35acdc38 (diff) | |
download | debhelper-2c5020419c6e499779c350f2c04e0c950303ef03.tar.gz |
r349: * dh_installmodules: still add depmod -a calls if run on a package that
has no debian/modules file, but does contain modules.
Diffstat (limited to 'dh_installmodules')
-rwxr-xr-x | dh_installmodules | 18 |
1 files changed, 15 insertions, 3 deletions
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/"); - } } } |