summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/package.bbclass')
-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 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
271def runstrip(file, elftype, d): 282def 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)