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] scripts/cleanup-workdir: Adpat to new workdir layout
Date: Fri, 23 Nov 2012 20:19:56 +0000	[thread overview]
Message-ID: <1353701996.7657.0.camel@ted> (raw)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/scripts/cleanup-workdir b/scripts/cleanup-workdir
index 9d161c2..b2408fc 100755
--- a/scripts/cleanup-workdir
+++ b/scripts/cleanup-workdir
@@ -22,7 +22,7 @@ import re
 import subprocess
 import shutil
 
-pkg_cur_dirs = []
+pkg_cur_dirs = {}
 obsolete_dirs = []
 parser = None
 
@@ -101,7 +101,7 @@ will be deleted. Be CAUTIOUS.""")
             version = parse_version(elems[1])
         else:
             version = parse_version(elems[2])
-        pkg_cur_dirs.append(elems[0] + '-' + version)
+        pkg_cur_dirs[elems[0]] = version
 
     cmd = "bitbake -e"
     output = run_command(cmd)
@@ -156,6 +156,14 @@ will be deleted. Be CAUTIOUS.""")
                 for pkgdir in sorted(pkgdirs):
                     if pkgdir not in pkg_cur_dirs:
                         obsolete_dirs.append(os.path.join(pkgroot, pkgdir))
+                    else:
+                        for verroot, verdirs, verfiles in os.walk(os.path.join(pkgroot, pkgdir)):
+                            for f in verfiles:
+                                obsolete_dirs.append(os.path.join(pkgroot, f))
+                            for v in sorted(verdirs):
+                               if v not in pkg_cur_dirs[pkgdir]:
+                                   obsolete_dirs.append(os.path.join(pkgroot, pkgdir, v))
+                            break
 
                 # just process the top dir of every package under tmp/work/*/,
                 # then jump out of the above os.walk()





                 reply	other threads:[~2012-11-23 20:34 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=1353701996.7657.0.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