]> code.ossystems Code Review - openembedded-core.git/commitdiff
devtool: reset: delete bbappend file if _check_preserve() doesn't
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Mon, 26 Feb 2018 01:49:56 +0000 (14:49 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 1 Mar 2018 22:09:17 +0000 (22:09 +0000)
If the .devtool_md5 file doesn't contain a reference to the bbappend
file (e.g. because devtool was interrupted before it could write that
out) then _check_preserve() won't delete it, so we need to delete it
separately because otherwise the recipe won't actually be reset.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/devtool/standard.py

index f29d8cbb689a4a9a64474d0bd463a82c86040fb5..2dbb19764223705cdec961a261ade7c4779338eb 100644 (file)
@@ -1791,6 +1791,13 @@ def _reset(recipes, no_clean, config, basepath, workspace):
     for pn in recipes:
         _check_preserve(config, pn)
 
+        appendfile = workspace[pn]['bbappend']
+        if os.path.exists(appendfile):
+            # This shouldn't happen, but is possible if devtool errored out prior to
+            # writing the md5 file. We need to delete this here or the recipe won't
+            # actually be reset
+            os.remove(appendfile)
+
         preservepath = os.path.join(config.workspace_path, 'attic', pn, pn)
         def preservedir(origdir):
             if os.path.exists(origdir):