3 # Generate a DEBIAN/md5sums file, that lists the md5sums of all files in the
7 use Debian::Debhelper::Dh_Lib;
10 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
11 $TMP=tmpdir($PACKAGE);
13 if (! -d "$TMP/DEBIAN") {
14 doit("install","-d","$TMP/DEBIAN");
17 # Check if we should exclude conffiles.
19 if (! $dh{INCLUDE} && -r "$TMP/DEBIAN/conffiles") {
20 # Generate exclude regexp.
21 open (CONFF,"$TMP/DEBIAN/conffiles");
25 $exclude.="! -path \"$_\" ";
30 # See if we should exclude other files.
31 if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
32 $exclude.="! \\( $dh{EXCLUDE_FIND} \\) ";
36 complex_doit("cd $TMP >/dev/null ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums ; cd $olddir >/dev/null");
37 # If the file's empty, no reason to waste inodes on it.
38 if (-z "$TMP/DEBIAN/md5sums") {
39 doit("rm","-f","$TMP/DEBIAN/md5sums");
42 doit("chmod",644,"$TMP/DEBIAN/md5sums");
43 doit("chown","root.root","$TMP/DEBIAN/md5sums");