syncpackage: Check if the specified Debian component is valid (LP: #639896).

This commit is contained in:
Benjamin Drung 2010-09-20 00:44:02 +02:00
parent df660e9667
commit a7a7dec87d
2 changed files with 8 additions and 2 deletions

3
debian/changelog vendored
View File

@ -14,6 +14,7 @@ ubuntu-dev-tools (0.102) UNRELEASED; urgency=low
* syncpackage:
- Don't upload orig tarball if not needed.
- Print error message if the download fails (LP: #639899).
- Check if the specified Debian component is valid (LP: #639896).
* update-maintainer: Don't change the Maintainer field if the email is set
to a @lists.ubuntu.com address.
* sponsor-patch: New script to download a patch from a Launchpad bug, patch
@ -37,7 +38,7 @@ ubuntu-dev-tools (0.102) UNRELEASED; urgency=low
* Fix NAME section of lp-set-dup(1).
* lp-list-bugs: New tool.
-- Benjamin Drung <bdrung@ubuntu.com> Sun, 19 Sep 2010 22:07:52 +0200
-- Benjamin Drung <bdrung@ubuntu.com> Mon, 20 Sep 2010 00:42:35 +0200
ubuntu-dev-tools (0.101) unstable; urgency=low

View File

@ -400,7 +400,7 @@ if __name__ == "__main__":
parser.add_option("-V", "--debian-version",
help="Specify the version to sync from.", dest="debversion", default=None)
parser.add_option("-c", "--component",
help="Specify the component to sync from.", dest="component", default=None)
help="Specify the Debian component to sync from.", dest="component", default=None)
parser.add_option("-v", "--verbose", help="print more information",
dest="verbose", action="store_true", default=False)
parser.add_option("-n", "--uploader-name", dest="uploader_name",
@ -441,6 +441,11 @@ if __name__ == "__main__":
if args[0].endswith(".dsc"):
dscurl = args[0]
else:
if options.component not in (None, "main", "contrib", "non-free"):
print >> sys.stderr, "%s: Error: %s is not a valid Debian component." \
" It should be one of main, contrib, or non-free." % \
(script_name, options.component)
sys.exit(1)
dscurl = get_debian_dscurl(args[0], options.dist, options.release,
options.debversion, options.component)