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/bzr.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/bzr.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/bzr.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/bitbake/lib/bb/fetch2/bzr.py b/bitbake/lib/bb/fetch2/bzr.py index 1e25207b19..22168a8351 100644 --- a/bitbake/lib/bb/fetch2/bzr.py +++ b/bitbake/lib/bb/fetch2/bzr.py | |||
@@ -72,7 +72,7 @@ class Bzr(Fetch): | |||
72 | elif command is "update": | 72 | elif command is "update": |
73 | bzrcmd = "%s pull %s --overwrite" % (basecmd, " ".join(options)) | 73 | bzrcmd = "%s pull %s --overwrite" % (basecmd, " ".join(options)) |
74 | else: | 74 | else: |
75 | raise FetchError("Invalid bzr command %s" % command) | 75 | raise FetchError("Invalid bzr command %s" % command, ud.url) |
76 | 76 | ||
77 | return bzrcmd | 77 | return bzrcmd |
78 | 78 | ||
@@ -104,15 +104,7 @@ class Bzr(Fetch): | |||
104 | tar_flags = "--exclude '.bzr' --exclude '.bzrtags'" | 104 | tar_flags = "--exclude '.bzr' --exclude '.bzrtags'" |
105 | 105 | ||
106 | # tar them up to a defined filename | 106 | # tar them up to a defined filename |
107 | try: | 107 | runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.basename(ud.pkgdir)), d, cleanup = [ud.localpath]) |
108 | runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.basename(ud.pkgdir)), 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 True | 110 | return True |