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
#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)