From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: yocto@yoctoproject.org
Subject: [layerindex-web][PATCH 1/3] update: allow preserving temp directory
Date: Wed, 4 Oct 2017 13:51:01 +1300 [thread overview]
Message-ID: <20171004005103.24756-1-paul.eggleton@linux.intel.com> (raw)
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>
---
layerindex/update.py | 5 +++++
layerindex/update_layer.py | 10 +++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/layerindex/update.py b/layerindex/update.py
index 2d578df..d1e67a0 100755
--- a/layerindex/update.py
+++ b/layerindex/update.py
@@ -85,6 +85,8 @@ def prepare_update_layer_command(options, branch, layer, initial=False):
cmd += ' -d'
elif options.loglevel == logging.ERROR:
cmd += ' -q'
+ if options.keep_temp:
+ cmd += ' --keep-temp'
return cmd
def update_actual_branch(layerquery, fetchdir, branch, options, update_bitbake, bitbakepath):
@@ -165,6 +167,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:
diff --git a/layerindex/update_layer.py b/layerindex/update_layer.py
index 7f0c08f..d91c00e 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)
--
2.9.5
next reply other threads:[~2017-10-04 0:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-04 0:51 Paul Eggleton [this message]
2017-10-04 0:51 ` [layerindex-web][PATCH 2/3] models: allow LayerBranch.collection to be blank Paul Eggleton
2017-10-04 0:51 ` [layerindex-web][PATCH 3/3] Show note if layer branch hasn't been indexed Paul Eggleton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171004005103.24756-1-paul.eggleton@linux.intel.com \
--to=paul.eggleton@linux.intel.com \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.