From 14dea89521c0c648e8e543388096a6dcd6d4f2e0 Mon Sep 17 00:00:00 2001 From: Saul Wold Date: Wed, 9 Feb 2011 14:30:29 -0800 Subject: 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 --- meta/classes/base.bbclass | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'meta/classes/base.bbclass') 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 python do_cleanall() { sstate_clean_cachefiles(d) + src_uri = (bb.data.getVar('SRC_URI', d, True) or "").split() + if len(src_uri) == 0: + return + localdata = bb.data.createCopy(d) bb.data.update_data(localdata) - dl_dir = bb.data.getVar('DL_DIR', localdata, True) - dl_dir = os.path.realpath(dl_dir) - - src_uri = (bb.data.getVar('SRC_URI', localdata, True) or "").split() - if len(src_uri) == 0: - return - fetcher = bb.fetch2.Fetch(src_uri, localdata) - for url in src_uri: - local = fetcher.localpath(url) - if local is None: - continue - local = os.path.realpath(local) - if local.startswith(dl_dir): - bb.note("Removing %s*" % local) - oe.path.remove(local + "*") + try: + fetcher = bb.fetch2.Fetch(src_uri, localdata) + fetcher.clean() + except bb.fetch2.BBFetchException, e: + raise bb.build.FuncFailed(e) } do_cleanall[nostamp] = "1" -- cgit v1.2.3-54-g00ecf