diff options
author | Saul Wold <sgw@linux.intel.com> | 2011-02-09 14:30:29 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-10 23:49:25 +0000 |
commit | 14dea89521c0c648e8e543388096a6dcd6d4f2e0 (patch) | |
tree | ddb73f19d8eeaa659905968ee1de28b9750b5628 /meta/classes/base.bbclass | |
parent | f1bbea4ab0c41cf93cd1a2d0d4d05a4ad06a0728 (diff) | |
download | poky-14dea89521c0c648e8e543388096a6dcd6d4f2e0.tar.gz |
fetch2: Correct the clean() mechanism for the fetcher2 code
This create a clean() method in each of the fetcher modules
and correctly cleans the .done stamp file and lock files
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r-- | meta/classes/base.bbclass | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index edb65eb96b..e4ea69d481 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -464,24 +464,18 @@ addtask cleanall after do_clean | |||
464 | python do_cleanall() { | 464 | python do_cleanall() { |
465 | sstate_clean_cachefiles(d) | 465 | sstate_clean_cachefiles(d) |
466 | 466 | ||
467 | src_uri = (bb.data.getVar('SRC_URI', d, True) or "").split() | ||
468 | if len(src_uri) == 0: | ||
469 | return | ||
470 | |||
467 | localdata = bb.data.createCopy(d) | 471 | localdata = bb.data.createCopy(d) |
468 | bb.data.update_data(localdata) | 472 | bb.data.update_data(localdata) |
469 | 473 | ||
470 | dl_dir = bb.data.getVar('DL_DIR', localdata, True) | 474 | try: |
471 | dl_dir = os.path.realpath(dl_dir) | 475 | fetcher = bb.fetch2.Fetch(src_uri, localdata) |
472 | 476 | fetcher.clean() | |
473 | src_uri = (bb.data.getVar('SRC_URI', localdata, True) or "").split() | 477 | except bb.fetch2.BBFetchException, e: |
474 | if len(src_uri) == 0: | 478 | raise bb.build.FuncFailed(e) |
475 | return | ||
476 | fetcher = bb.fetch2.Fetch(src_uri, localdata) | ||
477 | for url in src_uri: | ||
478 | local = fetcher.localpath(url) | ||
479 | if local is None: | ||
480 | continue | ||
481 | local = os.path.realpath(local) | ||
482 | if local.startswith(dl_dir): | ||
483 | bb.note("Removing %s*" % local) | ||
484 | oe.path.remove(local + "*") | ||
485 | } | 479 | } |
486 | do_cleanall[nostamp] = "1" | 480 | do_cleanall[nostamp] = "1" |
487 | 481 | ||