setup-packaging-environment: Display help

This commit is contained in:
Stefano Rivera 2012-05-06 06:06:41 +02:00
parent 2a2e420353
commit e47a99c42a
3 changed files with 27 additions and 8 deletions

4
debian/changelog vendored
View File

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

View File

@ -37,6 +37,31 @@ await_response() {
echo echo
} }
usage() {
prog=$(basename $0)
cat <<EOF
Usage: $prog [options]
Configure your machine for packaging work
Options:
-h, --help show this help message and exit
EOF
exit $1
}
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
usage 0
;;
*)
usage 1
;;
esac
shift
done
# ################################################################## # ##################################################################
if [ "$(lsb_release -is)" != "Ubuntu" ] if [ "$(lsb_release -is)" != "Ubuntu" ]

View File

@ -24,9 +24,6 @@ import setup
from ubuntutools import subprocess from ubuntutools import subprocess
from ubuntutools.test import unittest from ubuntutools.test import unittest
BLACKLIST = {
'setup-packaging-environment': 'Throws Error',
}
TIMEOUT = 5 TIMEOUT = 5
def load_tests(loader, tests, pattern): def load_tests(loader, tests, pattern):
@ -45,9 +42,6 @@ class HelpTestCase(unittest.TestCase):
@classmethod @classmethod
def make_help_tester(cls, script): def make_help_tester(cls, script):
def tester(self): def tester(self):
if script in BLACKLIST:
raise unittest.SkipTest("Blacklisted: " + BLACKLIST[script])
null = open('/dev/null', 'r') null = open('/dev/null', 'r')
process = subprocess.Popen(['./' + script, '--help'], process = subprocess.Popen(['./' + script, '--help'],
close_fds=True, stdin=null, close_fds=True, stdin=null,