+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.
# 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");
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/");
- }
}
}
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