summaryrefslogtreecommitdiff
path: root/meta/classes/buildhistory.bbclass
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-08-21 13:55:00 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-30 12:34:39 +0100
commitb018a046a578e41b105cf72b9fdeed0220ae3046 (patch)
tree9e439855c5fd8e5cc4d802c485ce5b98919b48e6 /meta/classes/buildhistory.bbclass
parent1380aa333ed90559f4a24d52aefc52cadb60646c (diff)
downloadopenembedded-core-b018a046a578e41b105cf72b9fdeed0220ae3046.tar.gz
openembedded-core-b018a046a578e41b105cf72b9fdeed0220ae3046.tar.bz2
openembedded-core-b018a046a578e41b105cf72b9fdeed0220ae3046.zip
classes/buildhistory: handle additional files at recipe level
Avoid an error when attempting to remove previous data if it's not a subdirectory - we were assuming that anything that wasn't named "latest" or "latest_srcrev" had to be a directory. This makes it possible to have a buildhistory_emit_pkghistory_append which writes additional files at the recipe level. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/buildhistory.bbclass')
-rw-r--r--meta/classes/buildhistory.bbclass11
1 files changed, 7 insertions, 4 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 190c38e114..57dc1e9336 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -172,10 +172,13 @@ python buildhistory_emit_pkghistory() {
for item in os.listdir(pkghistdir):
if item != "latest" and item != "latest_srcrev":
if item not in packagelist:
- subdir = os.path.join(pkghistdir, item)
- for subfile in os.listdir(subdir):
- os.unlink(os.path.join(subdir, subfile))
- os.rmdir(subdir)
+ itempath = os.path.join(pkghistdir, item)
+ if os.path.isdir(itempath):
+ for subfile in os.listdir(itempath):
+ os.unlink(os.path.join(itempath, subfile))
+ os.rmdir(itempath)
+ else:
+ os.unlink(itempath)
rcpinfo = RecipeInfo(pn)
rcpinfo.pe = pe