Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] sstate.bbclass: Simplify overcomlicated cleanall function
Date: Fri, 14 Dec 2012 15:38:27 +0000	[thread overview]
Message-ID: <1355499507.32519.20.camel@ted> (raw)

The code was written before SSTATETASKNAMES existed. Since it
does exist, lets simply the code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index ec2c123..29f6b1c 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -346,27 +346,18 @@ def sstate_clean(ss, d):
 CLEANFUNCS += "sstate_cleanall"
 
 python sstate_cleanall() {
-    import fnmatch
-
     bb.note("Removing shared state for package %s" % d.getVar('PN', True))
 
     manifest_dir = d.getVar('SSTATE_MANIFESTS', True)
-    manifest_prefix = d.getVar("SSTATE_MANFILEPREFIX", True)
-    manifest_pattern = os.path.basename(manifest_prefix) + ".*"
-
     if not os.path.exists(manifest_dir):
         return
 
-    for manifest in (os.listdir(manifest_dir)):
-        if fnmatch.fnmatch(manifest, manifest_pattern):
-            name = manifest.replace(manifest_pattern[:-1], "")
-            namemap = d.getVar('SSTATETASKNAMES', True).split()
-            tasks = d.getVar('SSTATETASKS', True).split()
-            if name not in namemap:
-                continue
-            taskname = tasks[namemap.index(name)]
-            shared_state = sstate_state_fromvars(d, taskname[3:])
-            sstate_clean(shared_state, d)
+    namemap = d.getVar('SSTATETASKNAMES', True).split()
+    tasks = d.getVar('SSTATETASKS', True).split()
+    for name in namemap:
+        taskname = tasks[namemap.index(name)]
+        shared_state = sstate_state_fromvars(d, taskname[3:])
+        sstate_clean(shared_state, d)
 }
 
 def sstate_hardcode_path(d):





                 reply	other threads:[~2012-12-14 15:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355499507.32519.20.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox