summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/osc.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-04 10:26:21 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-07 09:06:36 +0000
commitd08397ba4d1331993300eacbb2f78fcfef19c1cf (patch)
tree374d8aa46a69fbae08d2b3e8e7456a5c61005e4c /bitbake/lib/bb/fetch2/osc.py
parentf6eefb3ca3bb2a5ea0ec1364bdb0bc41ae58c815 (diff)
downloadast2050-yocto-poky-d08397ba4d1331993300eacbb2f78fcfef19c1cf.zip
ast2050-yocto-poky-d08397ba4d1331993300eacbb2f78fcfef19c1cf.tar.gz
bitbake/fetch2: Rewrite and improve exception handling, reusing core functions for common operations where possible
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/osc.py')
-rw-r--r--bitbake/lib/bb/fetch2/osc.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/bitbake/lib/bb/fetch2/osc.py b/bitbake/lib/bb/fetch2/osc.py
index 14bde82..9b97cf1 100644
--- a/bitbake/lib/bb/fetch2/osc.py
+++ b/bitbake/lib/bb/fetch2/osc.py
@@ -28,7 +28,7 @@ class Osc(Fetch):
def urldata_init(self, ud, d):
if not "module" in ud.parm:
- raise MissingParameterError("osc method needs a 'module' parameter.")
+ raise MissingParameterError('module', ud.url)
ud.module = ud.parm["module"]
@@ -73,7 +73,7 @@ class Osc(Fetch):
elif command is "update":
osccmd = "%s %s up %s" % (basecmd, config, " ".join(options))
else:
- raise FetchError("Invalid osc command %s" % command)
+ raise FetchError("Invalid osc command %s" % command, ud.url)
return osccmd
@@ -104,15 +104,7 @@ class Osc(Fetch):
os.chdir(os.path.join(ud.pkgdir + ud.path))
# tar them up to a defined filename
- try:
- runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d)
- except:
- t, v, tb = sys.exc_info()
- try:
- os.unlink(ud.localpath)
- except OSError:
- pass
- raise t, v, tb
+ runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d, cleanup = [ud.localpath])
def supports_srcrev(self):
return False
OpenPOWER on IntegriCloud