diff options
-rwxr-xr-x | scripts/cleanup-workdir | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/cleanup-workdir b/scripts/cleanup-workdir index 9d161c24d1..b2408fcfc6 100755 --- a/scripts/cleanup-workdir +++ b/scripts/cleanup-workdir | |||
@@ -22,7 +22,7 @@ import re | |||
22 | import subprocess | 22 | import subprocess |
23 | import shutil | 23 | import shutil |
24 | 24 | ||
25 | pkg_cur_dirs = [] | 25 | pkg_cur_dirs = {} |
26 | obsolete_dirs = [] | 26 | obsolete_dirs = [] |
27 | parser = None | 27 | parser = None |
28 | 28 | ||
@@ -101,7 +101,7 @@ will be deleted. Be CAUTIOUS.""") | |||
101 | version = parse_version(elems[1]) | 101 | version = parse_version(elems[1]) |
102 | else: | 102 | else: |
103 | version = parse_version(elems[2]) | 103 | version = parse_version(elems[2]) |
104 | pkg_cur_dirs.append(elems[0] + '-' + version) | 104 | pkg_cur_dirs[elems[0]] = version |
105 | 105 | ||
106 | cmd = "bitbake -e" | 106 | cmd = "bitbake -e" |
107 | output = run_command(cmd) | 107 | output = run_command(cmd) |
@@ -156,6 +156,14 @@ will be deleted. Be CAUTIOUS.""") | |||
156 | for pkgdir in sorted(pkgdirs): | 156 | for pkgdir in sorted(pkgdirs): |
157 | if pkgdir not in pkg_cur_dirs: | 157 | if pkgdir not in pkg_cur_dirs: |
158 | obsolete_dirs.append(os.path.join(pkgroot, pkgdir)) | 158 | obsolete_dirs.append(os.path.join(pkgroot, pkgdir)) |
159 | else: | ||
160 | for verroot, verdirs, verfiles in os.walk(os.path.join(pkgroot, pkgdir)): | ||
161 | for f in verfiles: | ||
162 | obsolete_dirs.append(os.path.join(pkgroot, f)) | ||
163 | for v in sorted(verdirs): | ||
164 | if v not in pkg_cur_dirs[pkgdir]: | ||
165 | obsolete_dirs.append(os.path.join(pkgroot, pkgdir, v)) | ||
166 | break | ||
159 | 167 | ||
160 | # just process the top dir of every package under tmp/work/*/, | 168 | # just process the top dir of every package under tmp/work/*/, |
161 | # then jump out of the above os.walk() | 169 | # then jump out of the above os.walk() |