summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-23 12:26:12 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-24 00:11:14 +0000
commit4f4451f7c0f9762092eb3dbc995b4afa2572ceb6 (patch)
treef5a4c33d075949bc2084b8764f6ab54a3f72cabc /meta
parent8f0d188df4aaccc3fd4911f12c532f81ae9714a7 (diff)
downloadopenembedded-core-4f4451f7c0f9762092eb3dbc995b4afa2572ceb6.tar.gz
openembedded-core-4f4451f7c0f9762092eb3dbc995b4afa2572ceb6.tar.bz2
openembedded-core-4f4451f7c0f9762092eb3dbc995b4afa2572ceb6.tar.xz
openembedded-core-4f4451f7c0f9762092eb3dbc995b4afa2572ceb6.zip
package.bbclass: Remove empty directories created as part of srcdebug handling
We can create directories like /usr/src/debug as part of the debug file manipulations. If these are going to end up empty, remove them to avoid QA warnings like: WARNING: For recipe task-core-x11, the following files/directories were installed but not shipped in any package: WARNING: /usr WARNING: /usr/src WARNING: /usr/src/debug WARNING: For recipe task-core-console, the following files/directories were installed but not shipped in any package: WARNING: /usr WARNING: /usr/src WARNING: /usr/src/debug Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/package.bbclass13
1 files changed, 12 insertions, 1 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index f6d6e1ace..b579e50a3 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -251,7 +251,13 @@ def splitfile2(debugsrcdir, d):
sourcefile = bb.data.expand("${WORKDIR}/debugsources.list", d)
if debugsrcdir:
- bb.mkdirhier("%s%s" % (dvar, debugsrcdir))
+ nosuchdir = []
+ basepath = dvar
+ for p in debugsrcdir.split("/"):
+ basepath = basepath + "/" + p
+ if not os.path.exists(basepath):
+ nosuchdir.append(basepath)
+ bb.mkdirhier(basepath)
processdebugsrc = "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '(<internal>|<built-in>)$' | "
# We need to ignore files that are not actually ours
@@ -268,6 +274,11 @@ def splitfile2(debugsrcdir, d):
#bb.note("rmdir -p %s" % dir)
os.system("rmdir -p %s 2>/dev/null" % dir)
+ # Also remove debugsrcdir if its empty
+ for p in nosuchdir[::-1]:
+ if not os.listdir(p):
+ os.rmdir(p)
+
def runstrip(file, elftype, d):
# Function to strip a single file, called from split_and_strip_files below
# A working 'file' (one which works on the target architecture)