diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-04 10:26:21 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-07 09:06:36 +0000 |
commit | d08397ba4d1331993300eacbb2f78fcfef19c1cf (patch) | |
tree | 374d8aa46a69fbae08d2b3e8e7456a5c61005e4c /bitbake/lib/bb/fetch2/osc.py | |
parent | f6eefb3ca3bb2a5ea0ec1364bdb0bc41ae58c815 (diff) | |
download | 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.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/bitbake/lib/bb/fetch2/osc.py b/bitbake/lib/bb/fetch2/osc.py index 14bde82fd7..9b97cf1cc7 100644 --- a/bitbake/lib/bb/fetch2/osc.py +++ b/bitbake/lib/bb/fetch2/osc.py | |||
@@ -28,7 +28,7 @@ class Osc(Fetch): | |||
28 | 28 | ||
29 | def urldata_init(self, ud, d): | 29 | def urldata_init(self, ud, d): |
30 | if not "module" in ud.parm: | 30 | if not "module" in ud.parm: |
31 | raise MissingParameterError("osc method needs a 'module' parameter.") | 31 | raise MissingParameterError('module', ud.url) |
32 | 32 | ||
33 | ud.module = ud.parm["module"] | 33 | ud.module = ud.parm["module"] |
34 | 34 | ||
@@ -73,7 +73,7 @@ class Osc(Fetch): | |||
73 | elif command is "update": | 73 | elif command is "update": |
74 | osccmd = "%s %s up %s" % (basecmd, config, " ".join(options)) | 74 | osccmd = "%s %s up %s" % (basecmd, config, " ".join(options)) |
75 | else: | 75 | else: |
76 | raise FetchError("Invalid osc command %s" % command) | 76 | raise FetchError("Invalid osc command %s" % command, ud.url) |
77 | 77 | ||
78 | return osccmd | 78 | return osccmd |
79 | 79 | ||
@@ -104,15 +104,7 @@ class Osc(Fetch): | |||
104 | 104 | ||
105 | os.chdir(os.path.join(ud.pkgdir + ud.path)) | 105 | os.chdir(os.path.join(ud.pkgdir + ud.path)) |
106 | # tar them up to a defined filename | 106 | # tar them up to a defined filename |
107 | try: | 107 | runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d, cleanup = [ud.localpath]) |
108 | runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d) | ||
109 | except: | ||
110 | t, v, tb = sys.exc_info() | ||
111 | try: | ||
112 | os.unlink(ud.localpath) | ||
113 | except OSError: | ||
114 | pass | ||
115 | raise t, v, tb | ||
116 | 108 | ||
117 | def supports_srcrev(self): | 109 | def supports_srcrev(self): |
118 | return False | 110 | return False |