summaryrefslogtreecommitdiff
path: root/dh_lib
diff options
context:
space:
mode:
authorjoey <joey>1999-08-17 04:37:02 +0000
committerjoey <joey>1999-08-17 04:37:02 +0000
commit0c4875b3fecb5b376257e248b129537dd148e0c4 (patch)
tree09d2f70bc2a6f3eecd08c1d25002be40ab73af64 /dh_lib
parent1921f5c59e9a736db764c2cae6ef8dd092167d73 (diff)
downloaddebhelper-0c4875b3fecb5b376257e248b129537dd148e0c4.tar.gz
r21: Initial Import
Diffstat (limited to 'dh_lib')
-rw-r--r--dh_lib25
1 files changed, 19 insertions, 6 deletions
diff --git a/dh_lib b/dh_lib
index 1cc7e308..c2dd9777 100644
--- a/dh_lib
+++ b/dh_lib
@@ -1,7 +1,7 @@
# Library functions for debhelper programs.
# Run a command, and display the command to stdout if verbose mode is on.
-# All commands that modifiy files in debian/$TMP should be ran via this
+# All commands that modifiy files in $TMP should be ran via this
# function.
# Unfortunatly, this function doesn't work if your command uses redirection,
# you will have to call verbose_echo by hand then.
@@ -24,13 +24,15 @@ error() {
}
# Pass it a name of a binary package, it returns the name of the tmp dir to
-# use, for that package, relative to debian/
+# use, for that package.
# This is for back-compatability with the debian/tmp tradition.
tmpdir() {
- if [ "$1" = "$MAINPACKAGE" ]; then
- echo tmp
+ if [ "$DH_TMPDIR" ]; then
+ echo "$DH_TMPDIR"
+ elif [ "$1" = "$MAINPACKAGE" ]; then
+ echo debian/tmp
else
- echo "$PACKAGE"
+ echo "debian/$PACKAGE"
fi
}
@@ -77,7 +79,7 @@ autoscript() {
# Argument processing and global variable initialization is below.
# Parse command line.
-set -- `getopt xvianp: $*`
+set -- `getopt xvianp:P: $*`
for i; do
case "$i"
@@ -107,6 +109,11 @@ for i; do
DH_EXCLUDE=1
shift
;;
+ -P)
+ DH_TMPDIR="$2"
+ shift
+ shift
+ ;;
--)
shift
break
@@ -172,3 +179,9 @@ if [ ! "$DH_DOPACKAGES" -o "$DH_DOPACKAGES" = " " ]; then
fi
DH_DOPACKAGES=`grep ^Package: debian/control | cut -d " " -f 2`
fi
+
+# Check to see if -P was specified. If so, we can only act on a single
+# package.
+if [ "$DH_TMPDIR" ] && echo "$DH_DOPACKAGES" | grep -q " "; then
+ error "-P was specified, but multiple packages would be acted on."
+fi