summaryrefslogtreecommitdiff
path: root/dh_md5sums
diff options
context:
space:
mode:
authorjoey <joey>2000-03-02 21:23:22 +0000
committerjoey <joey>2000-03-02 21:23:22 +0000
commit67b74298f08a3e2b30e43cbcd7cdaccc2e1b1614 (patch)
tree3ce180eedb8c91f9371456f3fb40336b4c7c34dd /dh_md5sums
parentc7f541bd2bc869c366e8242baf1faa6856cd2e39 (diff)
r338: * Patch from Jorgen `forcer' Schaefer <forcer at mindless.com> (much
modified)to make dh_installwm use new window manager registration method, update-alternatives. Closes: #52156, #34684 (latter bug is obsolete) * Fixed $dh{flavor} to be upper-case. * Deprecated dh_installemavcsen --number; use --priority instead. Also, the option parser requires the parameter be a number now. And, dh_installwm now accepts --priority, and window manager packages should start using it. * dh_installwm now behaves like a proper debhelper command, and reads debian/<package>.wm too. This is a small behavior change; filenames specified on the command line no longer apply to all packages it acts on. I can't belive this program existed for 2 years with such a glaring problem; I guess most people don't need ot register 5 wm's in 3 sub-packages. Anyway, it can handle such things now. :-) * Moved Dh_*.pm to /usr/lib/perl5/Debian/Debhelper. *big* change.
Diffstat (limited to 'dh_md5sums')
-rwxr-xr-xdh_md5sums57
1 files changed, 40 insertions, 17 deletions
diff --git a/dh_md5sums b/dh_md5sums
index 634e2fd6..9a3354de 100755
--- a/dh_md5sums
+++ b/dh_md5sums
@@ -1,22 +1,45 @@
-#!/bin/sh -e
+#!/usr/bin/perl -w
#
-# Generate a DEBIAN/md5sums file, that lists the md5sums of all
-# non-conffiles in the package
+# Generate a DEBIAN/md5sums file, that lists the md5sums of all files in the
+# package.
-PATH=debian:$PATH:/usr/lib/debhelper
-. dh_lib
+use Cwd;
+use Debian::Debhelper::Dh_Lib;
+init();
-for PACKAGE in $DH_DOPACKAGES; do
- TMP=`tmpdir $PACKAGE`
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+ $TMP=tmpdir($PACKAGE);
- if [ ! -d "debian/$TMP/DEBIAN" ]; then
- doit "install -d debian/$TMP/DEBIAN"
- fi
+ if (! -d "$TMP/DEBIAN") {
+ doit("install","-d","$TMP/DEBIAN");
+ }
- doit "pushd debian/$TMP" >/dev/null
- # Doit isn't smart enough to hande this next command so echo by hand. (sigh)
- verbose_echo 'md5sum `find * -type f ! -regex "^DEBIAN/.*"` > DEBIAN/md5sums </dev/null'
- md5sum `find * -type f ! -regex "^DEBIAN/.*"` >DEBIAN/md5sums </dev/null
- doit "chown root.root DEBIAN/md5sums"
- doit "popd 2>/dev/null" >/dev/null
-done
+ # Check if we should exclude conffiles.
+ my $exclude="";
+ if (! $dh{INCLUDE} && -r "$TMP/DEBIAN/conffiles") {
+ # Generate exclude regexp.
+ open (CONFF,"$TMP/DEBIAN/conffiles");
+ while (<CONFF>) {
+ chomp;
+ s/^\///;
+ $exclude.="! -path \"$_\" ";
+ }
+ close CONFF;
+ }
+
+ # See if we should exclude other files.
+ if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
+ $exclude.="! \\( $dh{EXCLUDE_FIND} \\) ";
+ }
+
+ $olddir=getcwd();
+ complex_doit("cd $TMP >/dev/null ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum > DEBIAN/md5sums ; cd $olddir >/dev/null");
+ # If the file's empty, no reason to waste inodes on it.
+ if (-z "$TMP/DEBIAN/md5sums") {
+ doit("rm","-f","$TMP/DEBIAN/md5sums");
+ }
+ else {
+ doit("chmod",644,"$TMP/DEBIAN/md5sums");
+ doit("chown","root.root","$TMP/DEBIAN/md5sums");
+ }
+}