3
0
mirror of https://git.launchpad.net/ubuntu-dev-tools synced 2025-04-17 13:22:11 +00:00

Catch DownloadErrors in ubuntutools.archive users. (LP: )

This commit is contained in:
Stefano Rivera 2011-01-31 19:01:10 +02:00
parent d80f8248b8
commit 8657394219
6 changed files with 40 additions and 17 deletions

6
debian/changelog vendored

@ -1,3 +1,9 @@
ubuntu-dev-tools (0.115) UNRELEASED; urgency=low
* Catch DownloadErrors in ubuntutools.archive users. (LP: #708862)
-- Stefano Rivera <stefanor@ubuntu.com> Mon, 31 Jan 2011 18:54:28 +0200
ubuntu-dev-tools (0.114) unstable; urgency=low
[ Stefano Rivera ]

4
debian/copyright vendored

@ -110,7 +110,7 @@ Copyright: 2010, Benjamin Drung <bdrung@ubuntu.com>
2008, Jonathan Patrick Davies <jpds@ubuntu.com>
2008-2010, Martin Pitt <martin.pitt@canonical.com>
2009, Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
2010, Stefano Rivera <stefanor@ubuntu.com>
2010-2011, Stefano Rivera <stefanor@ubuntu.com>
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 <geser@ubuntu.com>
2009, Nathan Handler <nhandler@ubuntu.com>
2007-2008, Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
2010, Stefano Rivera <stefanor@ubuntu.com>
2010-2011, Stefano Rivera <stefanor@ubuntu.com>
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

@ -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)

@ -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()

@ -3,8 +3,8 @@
# pull-lp-source -- pull a source package from Launchpad
# Basic usage: pull-lp-source <source package> [<release>]
#
# Copyright (C) 2008, Iain Lane <iain@orangesquash.org.uk>,
# 2010, Stefano Rivera <stefanor@ubuntu.com>
# Copyright (C) 2008, Iain Lane <iain@orangesquash.org.uk>,
# 2010-2011, Stefano Rivera <stefanor@ubuntu.com>
#
# ##################################################################
#
@ -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()

@ -2,8 +2,8 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2010 Martin Pitt <martin.pitt@canonical.com>,
# 2010 Benjamin Drung <bdrung@ubuntu.com>,
# 2010 Stefano Rivera <stefanor@ubuntu.com>
# 2010 Benjamin Drung <bdrung@ubuntu.com>,
# 2010-2011 Stefano Rivera <stefanor@ubuntu.com>
#
# ##################################################################
#
@ -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