aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/update_layer.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-10-03 11:40:22 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2017-10-03 11:42:51 +1300
commit36d315972bb817152988931421f845a68b679953 (patch)
tree2a725fffa4d5da0d08eafd644a54edcabc3b1913 /layerindex/update_layer.py
parentfdcde0071080a59e1fad17a9479f3d8ca065e8cb (diff)
downloadopenembedded-core-contrib-36d315972bb817152988931421f845a68b679953.tar.gz
update: allow preserving temp directory
If you're diagnosing problems with the bitbake server when running the update script, then you need to be able to look at bitbake-cookerdaemon.log, but you couldn't do that after the fact because the temporary directory it gets written out to was being unconditionally deleted. Add a --keep-temp option which preserves it and some debug messages to tell you where it is. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex/update_layer.py')
-rw-r--r--layerindex/update_layer.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/layerindex/update_layer.py b/layerindex/update_layer.py
index 7f0c08f83f..d91c00e13e 100644
--- a/layerindex/update_layer.py
+++ b/layerindex/update_layer.py
@@ -194,6 +194,9 @@ def main():
parser.add_option("-q", "--quiet",
help = "Hide all output except error messages",
action="store_const", const=logging.ERROR, dest="loglevel")
+ parser.add_option("", "--keep-temp",
+ help = "Preserve temporary directory at the end instead of deleting it",
+ action="store_true")
options, args = parser.parse_args(sys.argv)
if len(args) > 1:
@@ -258,6 +261,7 @@ def main():
except recipeparse.RecipeParseError as e:
logger.error(str(e))
sys.exit(1)
+ logger.debug('Using temp directory %s' % tempdir)
# Clear the default value of SUMMARY so that we can use DESCRIPTION instead if it hasn't been set
tinfoil.config_data.setVar('SUMMARY', '')
# Clear the default value of DESCRIPTION so that we can see where it's not set
@@ -702,7 +706,11 @@ def main():
if LooseVersion(bb.__version__) > LooseVersion("1.27"):
tinfoil.shutdown()
- shutil.rmtree(tempdir)
+ if options.keep_temp:
+ logger.debug('Preserving temp directory %s' % tempdir)
+ else:
+ logger.debug('Deleting temp directory')
+ shutil.rmtree(tempdir)
sys.exit(0)