pbuilder-dist-simple: Display help

This commit is contained in:
Stefano Rivera 2012-05-06 06:03:14 +02:00
parent ed96c35dc1
commit 2a2e420353
3 changed files with 41 additions and 26 deletions

5
debian/changelog vendored
View File

@ -3,8 +3,9 @@ ubuntu-dev-tools (0.142) UNRELEASED; urgency=low
* mk-sbuild: Support kmod, when checking for overlayfs availability.
* pbuilder-dist: improve bash_completion for *.dsc files. Thanks Maarten
Bezemer. (Closes: #670924, LP: #770529)
* check-mir, check-symbols, grep-merges, submittodebian, ubuntu-iso: Do
enough argument parsing to handle --help (LP: #988009)
* check-mir, check-symbols, grep-merges, pbuilder-dist-simple,
submittodebian, ubuntu-iso: Do enough argument parsing to handle --help
(LP: #988009)
-- Stefano Rivera <stefanor@debian.org> Wed, 25 Apr 2012 17:38:58 +0200

View File

@ -30,29 +30,44 @@ OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
usage() {
prog=$(basename $0)
cat <<EOF
Usage: $prog command [pbuilder-options...]
A simple multi-release pbuilder wrapper
Valid commands are:
create
update
build
clean
login
execute
Options:
-h, --help show this help message and exit
EOF
exit $1
}
case $OPERATION in
create|update|build|clean|login|execute)
PROCEED=true
;;
-h|--help)
usage 0
;;
*)
usage 1
;;
esac
if [ $PROCEED = true ]; then
shift
if [ ! -d $BASE_DIR/${DISTRIBUTION}_result ]
then mkdir -p $BASE_DIR/${DISTRIBUTION}_result/
if [ ! -d $BASE_DIR/${DISTRIBUTION}_result ]; then
mkdir -p $BASE_DIR/${DISTRIBUTION}_result/
fi
sudo pbuilder $OPERATION \
--basetgz $BASE_DIR/$DISTRIBUTION-base.tgz \
--distribution $DISTRIBUTION \
--buildresult $BASE_DIR/$DISTRIBUTION_result \
--othermirror "deb http://archive.ubuntu.com/ubuntu $DISTRIBUTION universe multiverse" $@
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
--othermirror "deb http://archive.ubuntu.com/ubuntu $DISTRIBUTION universe multiverse" "$@"

View File

@ -25,7 +25,6 @@ from ubuntutools import subprocess
from ubuntutools.test import unittest
BLACKLIST = {
'pbuilder-dist-simple': 'No Help',
'setup-packaging-environment': 'Throws Error',
}
TIMEOUT = 5