diff options
author | Chris Larson <clarson@kergoth.com> | 2008-11-20 12:40:01 -0700 |
---|---|---|
committer | Chris Larson <clarson@kergoth.com> | 2008-11-20 13:12:24 -0700 |
commit | a24386ba41206b3ac01cdb6ae11282a8ae978184 (patch) | |
tree | 6ce8e00b6204c2c36585d0e31002937e0ec4c4a8 | |
parent | 50ed25b113a28eb607c43fcd2788097b8f1613ed (diff) |
base.bbclass: Fix up disclean and clean up its exception handling
My python is rusty :)
-rw-r--r-- | classes/base.bbclass | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass index 00bbffd096..2c03c8fcb0 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -512,17 +512,23 @@ python base_do_distclean() { if not src_uri: return - for uri in src_uri.split() - if type == "file": + for uri in src_uri.split(): + if bb.decodeurl(uri)[0] == "file": continue try: local = bb.data.expand(bb.fetch.localpath(uri, d), d) - bb.note("removing %s" % local) - os.remove(local) - os.remove(local + ".md5") except bb.MalformedUrl, e: - raise FuncFailed('Unable to generate local path for %s' % e) + bb.debug(1, 'Unable to generate local path for malformed uri: %s' % e) + else: + bb.note("removing %s" % local) + try: + if os.path.exists(local + ".md5"): + os.remove(local + ".md5") + if os.path.exists(local): + os.remove(local) + except OSError, e: + bb.note("Error in removal: %s" % (local, e)) } SCENEFUNCS += "base_scenefunction" |