diff --git a/debian/changelog b/debian/changelog index d44d0f0..44a6d2a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ubuntu-dev-tools (0.115) UNRELEASED; urgency=low + + * Catch DownloadErrors in ubuntutools.archive users. (LP: #708862) + + -- Stefano Rivera Mon, 31 Jan 2011 18:54:28 +0200 + ubuntu-dev-tools (0.114) unstable; urgency=low [ Stefano Rivera ] diff --git a/debian/copyright b/debian/copyright index 4f8ee62..b3a2a20 100644 --- a/debian/copyright +++ b/debian/copyright @@ -110,7 +110,7 @@ Copyright: 2010, Benjamin Drung 2008, Jonathan Patrick Davies 2008-2010, Martin Pitt 2009, Siegfried-Angel Gevatter Pujals - 2010, Stefano Rivera + 2010-2011, Stefano Rivera License: GPL-3 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -156,7 +156,7 @@ Copyright: 2007-2010, Canonical Ltd. 2009-2010, Michael Bienia 2009, Nathan Handler 2007-2008, Siegfried-Angel Gevatter Pujals - 2010, Stefano Rivera + 2010-2011, Stefano Rivera License: GPL-3+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/pull-debian-debdiff b/pull-debian-debdiff index da2b86e..c1839fb 100755 --- a/pull-debian-debdiff +++ b/pull-debian-debdiff @@ -83,7 +83,7 @@ def main(): try: newpkg.pull() except DownloadError, e: - Logger.error(str(e)) + Logger.error('Failed to download: %s', str(e)) sys.exit(1) newpkg.unpack() @@ -100,7 +100,7 @@ def main(): try: oldpkg.pull() except DownloadError, e: - Logger.error(str(e)) + Logger.error('Failed to download: %s', str(e)) sys.exit(1) oldpkg.unpack() print 'file://' + oldpkg.debdiff(newpkg, diffstat=True) diff --git a/pull-debian-source b/pull-debian-source index 8a884fb..d5fd256 100755 --- a/pull-debian-source +++ b/pull-debian-source @@ -19,7 +19,7 @@ import optparse import sys -from ubuntutools.archive import DebianSourcePackage, rmadison +from ubuntutools.archive import DebianSourcePackage, DownloadError, rmadison from ubuntutools.config import UDTConfig from ubuntutools.logger import Logger @@ -70,7 +70,11 @@ def main(): component=line['component'], mirrors=[options.debian_mirror, options.debsec_mirror]) - srcpkg.pull() + try: + srcpkg.pull() + except DownloadError, e: + Logger.error('Failed to download: %s', str(e)) + sys.exit(1) if not options.download_only: srcpkg.unpack() diff --git a/pull-lp-source b/pull-lp-source index 3645472..981fded 100755 --- a/pull-lp-source +++ b/pull-lp-source @@ -3,8 +3,8 @@ # pull-lp-source -- pull a source package from Launchpad # Basic usage: pull-lp-source [] # -# Copyright (C) 2008, Iain Lane , -# 2010, Stefano Rivera +# Copyright (C) 2008, Iain Lane , +# 2010-2011, Stefano Rivera # # ################################################################## # @@ -27,7 +27,7 @@ import os import sys from optparse import OptionParser -from ubuntutools.archive import UbuntuSourcePackage +from ubuntutools.archive import UbuntuSourcePackage, DownloadError from ubuntutools.config import UDTConfig from ubuntutools.logger import Logger from ubuntutools.lp.lpapicache import Distribution, Launchpad @@ -86,7 +86,11 @@ def main(): srcpkg = UbuntuSourcePackage(package, spph.getVersion(), component=spph.getComponent(), mirrors=[options.ubuntu_mirror]) - srcpkg.pull() + try: + srcpkg.pull() + except DownloadError, e: + Logger.error('Failed to download: %s', str(e)) + sys.exit(1) if not options.download_only: srcpkg.unpack() diff --git a/syncpackage b/syncpackage index 301a9da..9b911ed 100755 --- a/syncpackage +++ b/syncpackage @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2008-2010 Martin Pitt , -# 2010 Benjamin Drung , -# 2010 Stefano Rivera +# 2010 Benjamin Drung , +# 2010-2011 Stefano Rivera # # ################################################################## # @@ -28,10 +28,11 @@ import shutil import subprocess import sys -from ubuntutools.archive import DebianSourcePackage, UbuntuSourcePackage +from ubuntutools.archive import (DebianSourcePackage, UbuntuSourcePackage, + DownloadError) from ubuntutools.config import UDTConfig, ubu_email -from ubuntutools.requestsync.mail import getDebianSrcPkg \ - as requestsync_mail_getDebianSrcPkg +from ubuntutools.requestsync.mail import (getDebianSrcPkg + as requestsync_mail_getDebianSrcPkg) from ubuntutools.requestsync.lp import getDebianSrcPkg, getUbuntuSrcPkg from ubuntutools.logger import Logger from ubuntutools.lp import udtexceptions @@ -138,7 +139,11 @@ def sync_dsc(src_pkg, debian_dist, release, name, email, bugs, ubuntu_mirror, 'setting current version to %s', ubuntu_ver.full_version, cur_ver.full_version) - src_pkg.pull() + try: + src_pkg.pull() + except DownloadError, e: + Logger.error('Failed to download: %s', str(e)) + sys.exit(1) src_pkg.unpack() fakesync = not (need_orig or ubu_pkg.verify_orig()) @@ -147,7 +152,11 @@ def sync_dsc(src_pkg, debian_dist, release, name, email, bugs, ubuntu_mirror, Logger.warn('The checksums of the Debian and Ubuntu packages mismatch. ' 'A fake sync is required.') # Download Ubuntu files (override Debian source tarballs) - ubu_pkg.pull() + try: + ubu_pkg.pull() + except DownloadError, e: + Logger.error('Failed to download: %s', str(e)) + sys.exit(1) # change into package directory directory = src_pkg.source + '-' + new_ver.upstream_version