3 # Generate a DEBIAN/md5sums file, that lists the md5sums of all files in the
6 PATH=debian:$PATH:/usr/lib/debhelper
9 for PACKAGE in $DH_DOPACKAGES; do
12 if [ ! -d "$TMP/DEBIAN" ]; then
13 doit "install -d $TMP/DEBIAN"
16 # Check if we should exclude conffiles.
17 if [ ! "$DH_INCLUDE" -a -r $TMP/DEBIAN/conffiles ]; then
18 # Generate exclude regexp. Using perl here may be overkill,
19 # but it does insure conffiles with spaces in them work.
20 exclude=`perl -ne 'chomp; s/^\///; print "! -path \"$_\" "' $TMP/DEBIAN/conffiles`
24 complex_doit "cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -0 md5sum > DEBIAN/md5sums ; cd $olddir"
25 doit "chmod 644 $TMP/DEBIAN/md5sums"
26 doit "chown root.root $TMP/DEBIAN/md5sums"