BB_STAMP_WHITELIST = "${PSTAGE_NATIVEDEPENDS}"
+def _package_unlink (f):
+ import os, errno
+ try:
+ os.unlink(f)
+ return True
+ except OSError, e:
+ if e.errno == errno.ENOENT:
+ return False
+ raise
+
python () {
pstage_allowed = True
dest = bb.data.getVar(destvarname, d, True)
for walkroot, dirs, files in os.walk(src):
+ bb.debug("rm %s" % walkroot)
for file in files:
filepath = os.path.join(walkroot, file).replace(src, dest)
- bb.note("rm %s" % filepath)
- os.system("rm %s" % filepath)
+ _package_unlink(filepath)
def pstage_set_pkgmanager(d):
path = bb.data.getVar("PATH", d, 1)
SCENEFUNCS += "packagestage_scenefunc"
python packagestage_scenefunc () {
+ import glob
if bb.data.getVar("PSTAGING_ACTIVE", d, 1) == "0":
return
# Remove the stamps and files we added above
# FIXME - we should really only remove the stamps we added
- os.system('rm -f ' + stamp + '.*')
+ for fname in glob.glob(stamp + '.*'):
+ _package_unlink(fname)
+
os.system(bb.data.expand("rm -rf ${WORKDIR}/tstage", d))
if stageok:
# so we need to remove the autogenerated stamps.
for task in taskscovered:
dir = "%s.do_%s" % (e.stampPrefix[fn], task)
- os.system('rm -f ' + dir)
- os.system('rm -f ' + stamp)
+ _package_unlink(dir)
+ _package_unlink(stamp)
}
populate_staging_preamble () {