summaryrefslogtreecommitdiffstats
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:36:11 +0100
commit2a08f4a0e5dbd15a23c2dba21c0d26799eb00722 (patch)
treea1d46742946feaabd265069e9d6dae05878c7e18
parent846cb34afa573a35ab04182c7bb6f960a1b19b5b (diff)
downloadpoky-2a08f4a0e5dbd15a23c2dba21c0d26799eb00722.tar.gz
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. (From OE-Core rev: b018a046a578e41b105cf72b9fdeed0220ae3046) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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() {
172 for item in os.listdir(pkghistdir): 172 for item in os.listdir(pkghistdir):
173 if item != "latest" and item != "latest_srcrev": 173 if item != "latest" and item != "latest_srcrev":
174 if item not in packagelist: 174 if item not in packagelist:
175 subdir = os.path.join(pkghistdir, item) 175 itempath = os.path.join(pkghistdir, item)
176 for subfile in os.listdir(subdir): 176 if os.path.isdir(itempath):
177 os.unlink(os.path.join(subdir, subfile)) 177 for subfile in os.listdir(itempath):
178 os.rmdir(subdir) 178 os.unlink(os.path.join(itempath, subfile))
179 os.rmdir(itempath)
180 else:
181 os.unlink(itempath)
179 182
180 rcpinfo = RecipeInfo(pn) 183 rcpinfo = RecipeInfo(pn)
181 rcpinfo.pe = pe 184 rcpinfo.pe = pe