From 67b74298f08a3e2b30e43cbcd7cdaccc2e1b1614 Mon Sep 17 00:00:00 2001 From: joey Date: Thu, 2 Mar 2000 21:23:22 +0000 Subject: r338: * Patch from Jorgen `forcer' Schaefer (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/.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. --- dh_md5sums | 57 ++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 17 deletions(-) (limited to 'dh_md5sums') diff --git a/dh_md5sums b/dh_md5sums index 634e2fd..9a3354d 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 DEBIAN/md5sums /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 () { + 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"); + } +} -- cgit v1.2.1