diff options
-rw-r--r-- | Dh_Getopt.pm | 1 | ||||
-rw-r--r-- | Dh_Lib.pm | 11 | ||||
-rw-r--r-- | debian/changelog | 12 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rwxr-xr-x | dh_gencontrol | 40 | ||||
-rw-r--r-- | dh_gencontrol.1 | 2 | ||||
-rwxr-xr-x | dh_installcron | 32 | ||||
-rw-r--r-- | doc/PROGRAMMING | 2 |
8 files changed, 63 insertions, 39 deletions
diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm index 85f0e15b..0f9dafdf 100644 --- a/Dh_Getopt.pm +++ b/Dh_Getopt.pm @@ -90,6 +90,7 @@ sub parseopts { "u=s", => \$options{U_PARAMS}, "update-rcd-params=s", => \$options{U_PARAMS}, "dpkg-shlibdeps-params=s", => \$options{U_PARAMS}, + "dpkg-gencontrol-params=s", => \$options{U_PARAMS}, "m=s", => \$options{M_PARAMS}, "major=s" => \$options{M_PARAMS}, @@ -70,12 +70,19 @@ sub init { # This package gets special treatement: files and directories specified on # the command line may affect it. $dh{FIRSTPACKAGE}=${$dh{DOPACKAGES}}[0]; + + # Split the U_PARAMS up into an array. + my $u=$dh{U_PARAMS}; + undef $dh{U_PARAMS}; + if (defined $u) { + push @{$dh{U_PARAMS}}, split(/\s+/,$u); + } } # Escapes out shell metacharacters in a word of shell script. sub escape_shell { my $word=shift; - # This list is from )Unix in a Nutshell_. (except '#') - $word=~s/([-\s!"$()*+#;<>?@\[\]\\`|~])/\\$1/g; + # This list is from _Unix in a Nutshell_. (except '#') + $word=~s/([\s!"\$()*+#;<>?@\[\]\\`|~])/\\$1/g; return $word; } diff --git a/debian/changelog b/debian/changelog index e1c7ee75..725f2ac6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +debhelper (1.1.8) unstable; urgency=low + + * Dh_Lib.pm: made U_PARAMS an array of parameters. + * Dh_Lib.pm: fixed bug in the escaping code, numbers don't need to be + escaped. Also, no longer escape "-". + * dh_clean, dh_gencontrol, dh_installcron: converted to perl. + * dh_gencontrol.1, dh_gencontrol: the man page had said that + --update-rcd-params was equivilant to -u for this program. You should + really use --dpkg-gencontrol-params. + + -- Joey Hess <joeyh@master.debian.org> Fri, 14 Aug 1998 14:07:35 -0700 + debhelper (1.1.7) unstable; urgency=low * examples/rules.multi: moved dh_movefiles into the install section. diff --git a/debian/control b/debian/control index 0a97ae80..8ba5d999 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debhelper Section: devel Priority: optional Maintainer: Joey Hess <joeyh@master.debian.org> -Standards-Version: 2.4.1.2 +Standards-Version: 2.4.1.3 Package: debhelper Architecture: all diff --git a/dh_gencontrol b/dh_gencontrol index c3698b56..cadfdc03 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -1,26 +1,30 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Generate and install the control file. Simple dpkg-gencontrol wrapper. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - EXT=`pkgext $PACKAGE` +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + $EXT=pkgext($PACKAGE); + + $changelog=pkgfile($PACKAGE,'changelog'); + if (! $changelog) { + $changelog='debian/changelog'; + } - changelog=`pkgfile $PACKAGE changelog` - if [ ! "$changelog" ]; then - changelog=debian/changelog - fi - - if [ ! -d $TMP/DEBIAN ]; then - doit "install -o root -g root -d $TMP/DEBIAN" - fi + if ( ! -d '$TMP/DEBIAN' ) { + doit("install","-o","root","-g","root","-d","$TMP/DEBIAN"); + } # Generate and install control file. - doit "dpkg-gencontrol -l$changelog -isp -p$PACKAGE -Tdebian/${EXT}substvars -P$TMP $DH_U_PARAMS" + doit("dpkg-gencontrol","-l$changelog","-isp","-p$PACKAGE", + "-Tdebian/$EXT\substvars","-P$TMP",@{$dh{U_PARAMS}}); + # This chmod is only necessary if the user sets the umask to something odd. - doit "chmod 644 $TMP/DEBIAN/control" - doit "chown root.root $TMP/DEBIAN/control" -done + doit("chmod","644","$TMP/DEBIAN/control"); + + doit("chown","root.root","$TMP/DEBIAN/control"); +} diff --git a/dh_gencontrol.1 b/dh_gencontrol.1 index 2bfade49..7ceb532a 100644 --- a/dh_gencontrol.1 +++ b/dh_gencontrol.1 @@ -18,7 +18,7 @@ See .BR debhelper (1) for a list of options common to all debhelper commands. .TP -.B \-uparams, \--update-rcd-params=params +.B \-uparams, \--dpkg-gencontrol-params=params Pass "params" to .BR dpkg-gencontrol (1) .SH ENVIRONMENT diff --git a/dh_installcron b/dh_installcron index 448e38a4..133ba743 100755 --- a/dh_installcron +++ b/dh_installcron @@ -1,20 +1,20 @@ -#!/bin/sh -e +#!/usr/bin/perl -w # # Install cron scripts into the appropriate places. -PATH=debian:$PATH:/usr/lib/debhelper -. dh_lib +BEGIN { push @INC, "debian", "/usr/lib/debhelper" } +use Dh_Lib; +init(); -for PACKAGE in $DH_DOPACKAGES; do - TMP=`tmpdir $PACKAGE` - - for type in daily weekly monthly d; do - cron=`pkgfile $PACKAGE cron.$type` - if [ "$cron" ]; then - if [ ! -d $TMP/etc/cron.$type ]; then - doit "install -o root -g root -d $TMP/etc/cron.$type" - fi - doit "install "$cron" $TMP/etc/cron.$type/$PACKAGE" - fi - done -done +foreach $PACKAGE (@{$dh{DOPACKAGES}}) { + $TMP=tmpdir($PACKAGE); + foreach $type (qw{daily weekly monthly d}) { + $cron=pkgfile($PACKAGE,"cron.$type"); + if ($cron) { + if (! -d "$TMP/etc/cron.$type") { + doit("install","-o","root","-g","root","-d","$TMP/etc/cron.$type"); + } + doit("install",$cron,"$TMP/etc/cron.$type/$PACKAGE"); + } + } +} diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index e514095d..1addc3b8 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -117,7 +117,7 @@ switch variable description package is being acted on) -u U_PARAMS will be set to a string, that is typically parameters your program passes on to some - other program. + other program. (In Dh_Lib.pm, this is an array) -m M_PARAMS will be set to a string, you decide what it means to your program -V V_FLAG will be set to a string, you decide what it |