syncpackage: Print error message if the download fails (LP: #639899).

This commit is contained in:
Benjamin Drung 2010-09-19 22:09:26 +02:00
parent 015d317cdf
commit 1048901abb
2 changed files with 16 additions and 4 deletions

6
debian/changelog vendored
View File

@ -11,7 +11,9 @@ ubuntu-dev-tools (0.102) UNRELEASED; urgency=low
* suspicious-source: whitelist font source formats. Thanks to Nicolas
Spalinger for the patch (LP: #365147).
* Update the man page of suspicious-source to match the rewrite.
* syncpackage: Don't upload orig tarball if not needed.
* syncpackage:
- Don't upload orig tarball if not needed.
- Print error message if the download fails (LP: #639899).
* 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
@ -35,7 +37,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> Fri, 17 Sep 2010 04:42:53 +0200
-- Benjamin Drung <bdrung@ubuntu.com> Sun, 19 Sep 2010 22:07:52 +0200
ubuntu-dev-tools (0.101) unstable; urgency=low

View File

@ -73,7 +73,12 @@ class File(object):
if not file_exists:
if verbose:
print '%s: I: Downloading %s...' % (script_name, self.url)
urllib.urlretrieve(self.url, self.name)
try:
urllib.urlretrieve(self.url, self.name)
except IOError as e:
print >> sys.stderr, "%s: Error: Failed to download %s [Errno %i]: %s." % \
(script_name, self.name, e.errno, e.strerror)
sys.exit(1)
class Version(debian.debian_support.Version):
@ -178,7 +183,12 @@ def sync_dsc(script_name, dscurl, debian_dist, release, name, email, bugs, keyid
if os.path.exists(os.path.join(basepath, dscname)):
dscfile = dscurl
else:
urllib.urlretrieve(dscurl, dscname)
try:
urllib.urlretrieve(dscurl, dscname)
except IOError as e:
print >> sys.stderr, "%s: Error: Failed to download %s [Errno %i]: %s." % \
(script_name, dscname, e.errno, e.strerror)
sys.exit(1)
dscfile = debian.deb822.Dsc(file(dscname))
if "Version" not in dscfile:
print >> sys.stderr, "%s: Error: No Version field found in the dsc file. Please check %s!" % \