[oe-commits] Richard Purdie : scripts/cleanup-workdir: Adpat to new workdir layout

git at git.openembedded.org git at git.openembedded.org
Sat Nov 24 15:14:14 UTC 2012


Module: openembedded-core.git
Branch: master
Commit: d967a498cb464c3858dc280db5e67b7e7b281b02
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=d967a498cb464c3858dc280db5e67b7e7b281b02

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Fri Nov 23 20:19:56 2012 +0000

scripts/cleanup-workdir: Adpat to new workdir layout

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 scripts/cleanup-workdir |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

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()





More information about the Openembedded-commits mailing list