summaryrefslogtreecommitdiffstats
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-22 13:29:47 +0100
commit45b8e6243996099f9ec8fe7f06301fc6da25a74f (patch)
tree76f0320b089f9afdfadd4402f846418e58a07fd8
parentc60aac5c94420d630f51a0038f642d40c594322b (diff)
downloadpoky-45b8e6243996099f9ec8fe7f06301fc6da25a74f.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) 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>
-rwxr-xr-xscripts/combo-layer6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index b0b7c28bea..698d3e3baa 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -145,8 +145,10 @@ class Configuration(object):
145 msg = "%s\nOption %s is not defined for component %s" %(msg, option, name) 145 msg = "%s\nOption %s is not defined for component %s" %(msg, option, name)
146 missing_options.append(option) 146 missing_options.append(option)
147 # Sanitize dest_dir so that we do not have to deal with edge cases 147 # Sanitize dest_dir so that we do not have to deal with edge cases
148 # (empty string, double slashes) in the rest of the code. 148 # (unset, empty string, double slashes) in the rest of the code.
149 dest_dir = os.path.normpath(self.repos[name]["dest_dir"]) 149 # It not being set will still be flagged as error because it is
150 # listed as required option above; that could be changed now.
151 dest_dir = os.path.normpath(self.repos[name].get("dest_dir", "."))
150 self.repos[name]["dest_dir"] = "." if not dest_dir else dest_dir 152 self.repos[name]["dest_dir"] = "." if not dest_dir else dest_dir
151 if msg != "": 153 if msg != "":
152 logger.error("configuration file %s has the following error: %s" % (self.conffile,msg)) 154 logger.error("configuration file %s has the following error: %s" % (self.conffile,msg))