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-10 23:37:00 +0000 |
commit | d0ffe023c4a642c8d1c188ec499870e7a7113d7d (patch) | |
tree | 5d22edd49e9e733643c73959bbbebee55d3df089 /lib/bb/fetch2/svn.py | |
parent | e448fa0432d12cc54f0b540fe2cacff37135c9ed (diff) | |
download | bitbake-d0ffe023c4a642c8d1c188ec499870e7a7113d7d.tar.gz |
bitbake/fetch2: Rewrite and improve exception handling, reusing core functions for common operations where possible
(From Poky rev: d08397ba4d1331993300eacbb2f78fcfef19c1cf)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2/svn.py')
-rw-r--r-- | lib/bb/fetch2/svn.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/bb/fetch2/svn.py b/lib/bb/fetch2/svn.py index 5ff064ebf..267c9bb7e 100644 --- a/lib/bb/fetch2/svn.py +++ b/lib/bb/fetch2/svn.py @@ -47,7 +47,7 @@ class Svn(Fetch): init svn specific variable within url data """ if not "module" in ud.parm: - raise MissingParameterError("svn method needs a 'module' parameter") + raise MissingParameterError('module', ud.url) ud.module = ud.parm["module"] @@ -118,7 +118,7 @@ class Svn(Fetch): elif command is "update": svncmd = "%s update %s" % (basecmd, " ".join(options)) else: - raise FetchError("Invalid svn command %s" % command) + raise FetchError("Invalid svn command %s" % command, ud.url) if svn_rsh: svncmd = "svn_RSH=\"%s\" %s" % (svn_rsh, svncmd) @@ -156,15 +156,7 @@ class Svn(Fetch): os.chdir(ud.pkgdir) # tar them up to a defined filename - try: - runfetchcmd("tar %s -czf %s %s" % (tar_flags, 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 %s -czf %s %s" % (tar_flags, ud.localpath, ud.module), d, cleanup = [ud.localpath]) def supports_srcrev(self): return True |