mirror of
https://git.yoctoproject.org/poky
synced 2026-02-20 08:29:42 +01:00
package.bbclass: Simplify empty directory removal
Rather than an exec() per directory, we might as well exec one command and be done with it. (From OE-Core rev: 82ae9cfb09ee5c0aa6402c972d71e2b64d1ce8bc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -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]:
|
||||
|
||||
Reference in New Issue
Block a user