# 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