summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-03 17:29:04 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-06 13:12:19 +0000
commit82ae9cfb09ee5c0aa6402c972d71e2b64d1ce8bc (patch)
tree5b8d5997da54c4a98ed4938018a098a95fb27899
parent52b506145bcddc133ca93a8c9f7343de69d10907 (diff)
downloadopenembedded-core-82ae9cfb09ee5c0aa6402c972d71e2b64d1ce8bc.tar.gz
openembedded-core-82ae9cfb09ee5c0aa6402c972d71e2b64d1ce8bc.tar.bz2
openembedded-core-82ae9cfb09ee5c0aa6402c972d71e2b64d1ce8bc.zip
package.bbclass: Simplify empty directory removal
Rather than an exec() per directory, we might as well exec one command and be done with it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/package.bbclass6
1 files changed, 1 insertions, 5 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 6ec028b594..a93fef984c 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -298,11 +298,7 @@ def copydebugsources(debugsrcdir, d):
subprocess.call(processdebugsrc % (sourcefile, workbasedir, workparentdir, dvar, debugsrcdir), shell=True)
# The copy by cpio may have resulted in some empty directories! Remove these
- for root, dirs, files in os.walk("%s%s" % (dvar, debugsrcdir)):
- for d in dirs:
- dir = os.path.join(root, d)
- #bb.note("rmdir -p %s" % dir)
- subprocess.call("rmdir -p %s 2>/dev/null" % dir, shell=True)
+ subprocess.call("find %s%s -empty -type d -delete" % (dvar, debugsrcdir), shell=True)
# Also remove debugsrcdir if its empty
for p in nosuchdir[::-1]: