aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-01-18 19:25:35 +0100
committerGuido Günther <agx@sigxcpu.org>2011-01-18 22:07:47 +0100
commitd8d2347bdd45074f8f194265d948b50108d22051 (patch)
tree21d42a3d5ebb7ac384305688f9f4b012398ea6d8
parentf2f03b79db00f04e5fe2f3db0307eda419373ec8 (diff)
git-import-dscs: Ignore debsnap download errors
to cope with binNMUs. Based on a patch from Jonathan Nieder. Closes: #610376
-rw-r--r--gbp/command_wrappers.py2
-rwxr-xr-xgit-import-dscs10
2 files changed, 11 insertions, 1 deletions
diff --git a/gbp/command_wrappers.py b/gbp/command_wrappers.py
index 28f62a0..545380c 100644
--- a/gbp/command_wrappers.py
+++ b/gbp/command_wrappers.py
@@ -28,6 +28,7 @@ class Command(object):
self.args = args
self.run_error = "Couldn't run '%s'" % (" ".join([self.cmd] + self.args))
self.shell = shell
+ self.retcode = 1
if extra_env is not None:
self.env = os.environ.copy()
self.env.update(extra_env)
@@ -64,6 +65,7 @@ class Command(object):
retcode = 1
if retcode:
log.err(self.run_error)
+ self.retcode = retcode
return retcode
def __call__(self, args=[]):
diff --git a/git-import-dscs b/git-import-dscs
index 369d7f7..87a020e 100755
--- a/git-import-dscs
+++ b/git-import-dscs
@@ -53,7 +53,15 @@ def fetch_snapshots(pkg, downloaddir):
dscs = None
gbp.log.info("Downloading snapshots of '%s' to '%s'..." % (pkg, downloaddir))
- gbpc.Command("debsnap", [ '--force', '--destdir=%s' % (downloaddir), pkg])()
+ debsnap = gbpc.Command("debsnap", [ '--force', '--destdir=%s' % (downloaddir), pkg])
+ try:
+ debsnap()
+ except gbpc.CommandExecFailed:
+ if debsnap.retcode == 2:
+ gbp.log.warn("Some packages failed to download. Continuing.")
+ pass
+ else:
+ raise
dscs = glob.glob(os.path.join(downloaddir, '*.dsc'))
if not dscs: