3 # Generate a DEBIAN/md5sums file, that lists the md5sums of all files in the
7 BEGIN { push @INC, "debian", "/usr/share/debhelper" }
11 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
12 $TMP=tmpdir($PACKAGE);
14 if (! -d "$TMP/DEBIAN") {
15 doit("install","-d","$TMP/DEBIAN");
18 # Check if we should exclude conffiles.
20 if (! $dh{INCLUDE} && -r "$TMP/DEBIAN/conffiles") {
21 # Generate exclude regexp.
22 open (CONFF,"$TMP/DEBIAN/conffiles");
26 $exclude.="! -path \"$_\" ";
31 # See if we should exclude other files.
32 if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
33 $exclude.="! \\( $dh{EXCLUDE_FIND} \\) ";
37 complex_doit("cd $TMP >/dev/null ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums ; cd $olddir >/dev/null");
38 # If the file's empty, no reason to waste inodes on it.
39 if (-z "$TMP/DEBIAN/md5sums") {
40 doit("rm","-f","$TMP/DEBIAN/md5sums");
43 doit("chmod",644,"$TMP/DEBIAN/md5sums");
44 doit("chown","root.root","$TMP/DEBIAN/md5sums");