From: joey <joey>
Date: Tue, 17 Aug 1999 04:58:27 +0000 (+0000)
Subject: r114: Initial Import
X-Git-Tag: debian_version_0_1~122
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a08b76c3505687f6298f762a28a80c34d2e9f07f;p=debhelper.git

r114: Initial Import
---

diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm
index 85f0e15..0f9dafd 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},
diff --git a/Dh_Lib.pm b/Dh_Lib.pm
index b4d0db5..00f2813 100644
--- a/Dh_Lib.pm
+++ b/Dh_Lib.pm
@@ -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 e1c7ee7..725f2ac 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 0a97ae8..8ba5d99 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 c3698b5..cadfdc0 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 2bfade4..7ceb532 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 448e38a..133ba74 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 e514095..1addc3b 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