From 34b1991bdd983b7db88639f33c57884ed5256643 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Wed, 22 Dec 2010 17:14:48 +0200 Subject: [PATCH] Fix pull-revu-source help, and return 0 --- debian/changelog | 7 ++++--- pull-revu-source | 9 ++++++--- ubuntutools/test/test_help.py | 1 - 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 105f335..178bde7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,8 +16,9 @@ ubuntu-dev-tools (0.109) UNRELEASED; urgency=low * Add the beginnings of a test suite. (LP: #690386) - Switch to setuptools, to support setup.py test. - Test for that every script can run --help and return 0. - - 404main, merge-changelog, pull-debian-debdiff, pull-debian-source: - Return 0 after showing help. + - 404main, merge-changelog, pull-debian-debdiff, pull-debian-source, + pull-revu-source: + + Return 0 after showing help. * ubuntutools/common.py: Remove https_proxy unsetting code, working around LP: #94130. @@ -32,7 +33,7 @@ ubuntu-dev-tools (0.109) UNRELEASED; urgency=low - Fix 'str' object has no attribute 'startwith' crash caused by a typo. - Fix crash if uploading to ubuntu without building the package before. - -- Stefano Rivera Wed, 22 Dec 2010 16:52:55 +0200 + -- Stefano Rivera Wed, 22 Dec 2010 17:13:59 +0200 ubuntu-dev-tools (0.108) experimental; urgency=low diff --git a/pull-revu-source b/pull-revu-source index 1c6bbd4..9bce2f7 100755 --- a/pull-revu-source +++ b/pull-revu-source @@ -20,6 +20,7 @@ use warnings; use strict; +use File::Basename; use LWP::Simple; use Getopt::Long; @@ -27,10 +28,10 @@ die("Please install 'devscripts'\n") if(! grep -x "$_/dget", split(':',$ENV{'PAT my $REVU = "revu.ubuntuwire.com"; -my($package) = lc($ARGV[0]) || usage(); +my($package) = lc($ARGV[0]) || usage(2); my($help)=0; GetOptions('help' => \$help); -usage() if($help); +usage(0) if($help); dget(getURL()); @@ -47,6 +48,8 @@ sub dget { } sub usage { + my($exit) = @_; my($name)=basename($0); - die("USAGE: $name [-h] \n"); + print("USAGE: $name [-h] \n"); + exit($exit); } diff --git a/ubuntutools/test/test_help.py b/ubuntutools/test/test_help.py index 083c790..4b8e339 100644 --- a/ubuntutools/test/test_help.py +++ b/ubuntutools/test/test_help.py @@ -33,7 +33,6 @@ BLACKLIST = { 'massfile': 'No Help. Leaves files in .', 'mk-sbuild': 'Fires up apt-get before showing help', 'pbuilder-dist-simple': 'No Help', - 'pull-revu-source': 'Throws Error', 'setup-packaging-environment': 'Throws Error', 'submittodebian': 'No Help', 'ubuntu-iso': 'No Help',