diff options
author | joey <joey> | 1999-08-17 04:12:54 +0000 |
---|---|---|
committer | joey <joey> | 1999-08-17 04:12:54 +0000 |
commit | 938b66ee19e113785e6655b1c3e73e9003e6464c (patch) | |
tree | d06bd22faa3da8940bec71ba2e34e2028b6e7764 /dh_lib | |
download | debhelper-938b66ee19e113785e6655b1c3e73e9003e6464c.tar.gz |
r1: Initial revision
Diffstat (limited to 'dh_lib')
-rw-r--r-- | dh_lib | 50 |
1 files changed, 50 insertions, 0 deletions
@@ -0,0 +1,50 @@ +# Library functions for debhelper programs. + +# Run a command, and display the command to stdout if verbose mode is on. +# All commands that edit debian/tmp should be ran via this function. +function doit() { + verbose_echo "$1" + $1 +} + +# Echo something if the verbose flag is on. +function verbose_echo() { + if [ "$DH_VERBOSE" ]; then + echo " $1" + fi +} + +# Echo an error message and exit. +function error() { + echo `basename $0`": $1" >&2 + exit 1 +} + +# Argument processing and global variable initialization is below. + +# Get the package name and version from the changelog. +LINE=`head -1 debian/changelog` +PACKAGE=`expr "$LINE" : '\(.*\) (.*)'` +VERSION=`expr "$LINE" : '.* (\(.*\))'` + +# Is this a native Debian package? +if ! expr "$VERSION" : '.*-' >/dev/null; then + NATIVE=1 +fi + +# Parse command line. +set -- `getopt v $*` + +for i; do + case "$i" + in + -v) + DH_VERBOSE=1 + shift + ;; + --) + shift + break + ;; + esac +done |