diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-23 12:26:12 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-24 00:12:02 +0000 |
commit | 2fb9aace07c7551dd11e0727dcf202deb39ded01 (patch) | |
tree | 12865ef4043e0b58681fa5b7c286ea5da9eb1bf2 /meta/classes/package.bbclass | |
parent | e7caf3d1bc8a85322b532289fdf964379a3396e2 (diff) | |
download | poky-2fb9aace07c7551dd11e0727dcf202deb39ded01.tar.gz |
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
(From OE-Core rev: 4f4451f7c0f9762092eb3dbc995b4afa2572ceb6)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r-- | meta/classes/package.bbclass | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass index f6d6e1acee..b579e50a32 100644 --- a/meta/classes/package.bbclass +++ b/meta/classes/package.bbclass | |||
@@ -251,7 +251,13 @@ def splitfile2(debugsrcdir, d): | |||
251 | sourcefile = bb.data.expand("${WORKDIR}/debugsources.list", d) | 251 | sourcefile = bb.data.expand("${WORKDIR}/debugsources.list", d) |
252 | 252 | ||
253 | if debugsrcdir: | 253 | if debugsrcdir: |
254 | bb.mkdirhier("%s%s" % (dvar, debugsrcdir)) | 254 | nosuchdir = [] |
255 | basepath = dvar | ||
256 | for p in debugsrcdir.split("/"): | ||
257 | basepath = basepath + "/" + p | ||
258 | if not os.path.exists(basepath): | ||
259 | nosuchdir.append(basepath) | ||
260 | bb.mkdirhier(basepath) | ||
255 | 261 | ||
256 | processdebugsrc = "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '(<internal>|<built-in>)$' | " | 262 | processdebugsrc = "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '(<internal>|<built-in>)$' | " |
257 | # We need to ignore files that are not actually ours | 263 | # We need to ignore files that are not actually ours |
@@ -268,6 +274,11 @@ def splitfile2(debugsrcdir, d): | |||
268 | #bb.note("rmdir -p %s" % dir) | 274 | #bb.note("rmdir -p %s" % dir) |
269 | os.system("rmdir -p %s 2>/dev/null" % dir) | 275 | os.system("rmdir -p %s 2>/dev/null" % dir) |
270 | 276 | ||
277 | # Also remove debugsrcdir if its empty | ||
278 | for p in nosuchdir[::-1]: | ||
279 | if not os.listdir(p): | ||
280 | os.rmdir(p) | ||
281 | |||
271 | def runstrip(file, elftype, d): | 282 | def runstrip(file, elftype, d): |
272 | # Function to strip a single file, called from split_and_strip_files below | 283 | # Function to strip a single file, called from split_and_strip_files below |
273 | # A working 'file' (one which works on the target architecture) | 284 | # A working 'file' (one which works on the target architecture) |