#! /bin/bash # this is sourced from pbuilder packages to process the optional parameters. for RCFILE in /usr/share/pbuilder/pbuilderrc /etc/pbuilderrc ${HOME}/.pbuilderrc; do if [ -f "$RCFILE" ]; then . "$RCFILE" else echo "W: $RCFILE does not exist" fi done . /usr/lib/pbuilder/pbuilder-modules # the default is to add a PID in the buildplace specified in the config file. BASEBUILDPLACE="$BUILDPLACE" BUILDPLACE="$BUILDPLACE/$$" while [ -n "$1" ]; do case "$1" in --basetgz) BASETGZ=$(readlink -f "$2"); shift; shift; ;; --buildplace) BUILDPLACE=$(readlink -f "$2"); shift; shift; ;; --mirror) MIRRORSITE="$2"; shift; shift; ;; --nonusmirror) NONUSMIRRORSITE="$2"; shift; shift; ;; --othermirror) OTHERMIRROR="$2"; shift; shift; ;; --http-proxy) export http_proxy="$2"; shift; shift; ;; --distribution) DISTRIBUTION="$2"; shift; shift; ;; --buildresult) BUILDRESULT=$(readlink -f "$2"); shift; shift; ;; --removepackages) REMOVEPACKAGES="$2"; shift; shift; ;; --configfile) . "$2"; shift; shift; ;; --extrapackages) EXTRAPACKAGES="$2"; shift; shift; ;; --hookdir) HOOKDIR="$2"; shift; shift; ;; --debemail) DEBEMAIL="$2"; shift; shift; ;; --debbuildopts) DEBBUILDOPTS="$2"; shift; shift; ;; --buildsourceroot*) BUILDSOURCEROOTCMD="$2"; shift; shift; ;; --pbuilderroot*) PBUILDERROOTCMD="$2"; shift; shift; ;; --logfile) exec > $(readlink -f "$2"); exec 2>&1 shift; shift; ;; --aptconfdir) APTCONFDIR="$2"; shift; shift; ;; --help) showhelp ;; --) # this is an empty option, to no longer process. shift; break; ;; --*) echo "Error: Unknown option [$1] was specified " >&2 exit 1; ;; *) break; ;; esac done BUILDPLACE=${BUILDPLACE?"Build root directory is not defined"} if [ -z "$DEBEMAIL" ]; then DEBEMAIL="nobody@nowhere" fi case "$PBCURRENTCOMMANDLINEOPERATION" in login) # don't do anything if it is "login" ;; *) # line from kobras@debian.org if [ "$DEBIAN_FRONTEND" = "noninteractive" ]; then exec < /dev/null fi ;; esac