summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2015-05-20 13:48:20 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-29 13:01:37 +0100
commit508c4cac320d78a983ce105a78c0599102e2c349 (patch)
tree1034333e191ae3624916c4dac8062484e7a118c7 /scripts
parente9ae2f8417d65eb3bce3f5811d3e017c3d0596b3 (diff)
downloadast2050-yocto-poky-508c4cac320d78a983ce105a78c0599102e2c349.zip
ast2050-yocto-poky-508c4cac320d78a983ce105a78c0599102e2c349.tar.gz
combo-layer: handle unset dest_dir in sanity_check()
The previous "clean up dest_dir checking" patch (f8cdbe7497) improved handling of empty dest_dir but made handling of unset dest_dir worse: instead showing the "Option dest_dir is not defined for component ..." error, it fails with a Python exception. Avoid that by providing a sane fallback for the unset case. With that change, dest_dir is no longer strictly required, but the check for it is kept to ensure that a combo-layer.conf also works with older combo-layer versions. [Yocto #7773] (From OE-Core rev: d4bf858b2c15bef128fd6d606b08203a318e2d4c) (From OE-Core rev: b266977372f2d5704d00dd07b29ea49898ebf70e) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/combo-layer6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index b0b7c28..698d3e3 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -145,8 +145,10 @@ class Configuration(object):
msg = "%s\nOption %s is not defined for component %s" %(msg, option, name)
missing_options.append(option)
# Sanitize dest_dir so that we do not have to deal with edge cases
- # (empty string, double slashes) in the rest of the code.
- dest_dir = os.path.normpath(self.repos[name]["dest_dir"])
+ # (unset, empty string, double slashes) in the rest of the code.
+ # It not being set will still be flagged as error because it is
+ # listed as required option above; that could be changed now.
+ dest_dir = os.path.normpath(self.repos[name].get("dest_dir", "."))
self.repos[name]["dest_dir"] = "." if not dest_dir else dest_dir
if msg != "":
logger.error("configuration file %s has the following error: %s" % (self.conffile,msg))
OpenPOWER on IntegriCloud