From d7a1428d69475ad6ce8fcbdccda6cfe7e6600e53 Mon Sep 17 00:00:00 2001 From: Juergen Weigert Date: Mon, 21 Feb 2011 00:26:54 +0100 Subject: [PATCH] avoid 404 in osc se -V caused by looking up the _history of nonexistant packages. Workaround for BNC#673654 --- osc/commandline.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index e47e814a..ae2bd800 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -5341,10 +5341,16 @@ Please submit there instead, or use --nodevelproject to force direct submission. result.append(package) if opts.version and package != None: - sr = get_source_rev(apiurl,project,package) - v = sr.get('version') - r = sr.get('rev') - s = sr.get('srcmd5') + try: + sr = get_source_rev(apiurl,project,package) + v = sr.get('version') + r = sr.get('rev') + s = sr.get('srcmd5') + except: + # avoid 404 here. + # ['search', 'package'] ['match=contains%28description%2C+%27redis%27%29'] + # returns packages in project 'Ports:DebianBased:Auto', which cannot be examined. + pass if not v or v == 'unknown': v = '-' if not r: r = '-' if not s: s = '-'