diff options
author | joey <joey> | 1999-08-17 05:02:56 +0000 |
---|---|---|
committer | joey <joey> | 1999-08-17 05:02:56 +0000 |
commit | 5501271678d88ac578082ce2d0705ca211d7e980 (patch) | |
tree | 5c0e969ea02c1ad7dae038d699fc9acc4d67b423 /dh_md5sums | |
parent | f52118bc1737140efeee4b56c3ab92ac3c54a61e (diff) | |
download | debhelper-5501271678d88ac578082ce2d0705ca211d7e980.tar.gz |
r132: Initial Import
Diffstat (limited to 'dh_md5sums')
-rwxr-xr-x | dh_md5sums | 44 |
1 files changed, 26 insertions, 18 deletions
@@ -1,27 +1,35 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # 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; +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); - if [ ! -d "$TMP/DEBIAN" ]; then - doit "install -d $TMP/DEBIAN" - fi + if (! -d "$TMP/DEBIAN") { + doit("install","-d","$TMP/DEBIAN"); + } # Check if we should exclude conffiles. - if [ ! "$DH_INCLUDE" -a -r $TMP/DEBIAN/conffiles ]; then - # Generate exclude regexp. Using perl here may be overkill, - # but it does insure conffiles with spaces in them work. - exclude=`perl -ne 'chomp; s/^\///; print "! -path \"$_\" "' $TMP/DEBIAN/conffiles` - fi + 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; + } - olddir=`pwd` - complex_doit "cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -0 md5sum > DEBIAN/md5sums ; cd $olddir" - doit "chmod 644 $TMP/DEBIAN/md5sums" - doit "chown root.root $TMP/DEBIAN/md5sums" -done + $olddir=getcwd(); + complex_doit("cd $TMP ; find * -type f $exclude ! -regex '^DEBIAN/.*' -print0 | xargs -0 md5sum > DEBIAN/md5sums ; cd $olddir"); + doit("chmod",644,"$TMP/DEBIAN/md5sums"); + doit("chown","root.root","$TMP/DEBIAN/md5sums"); +} |