aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-11-07 11:12:21 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-11-07 16:39:38 +1300
commit05f3bccbc600a4b5a22ae356cd9b74537eda143d (patch)
tree161606c127cb0b1ab02e643da4a38cef0221ae54
parente547528fd37a30e178bb92e4d14821f61f09c0c5 (diff)
downloadopenembedded-core-contrib-05f3bccbc600a4b5a22ae356cd9b74537eda143d.tar.gz
openembedded-core-contrib-05f3bccbc600a4b5a22ae356cd9b74537eda143d.tar.bz2
openembedded-core-contrib-05f3bccbc600a4b5a22ae356cd9b74537eda143d.zip
update_layer: fix regressions in missing layer detection
If a layer is removed by its subdirectory being deleted then we want to pick up on that and produce an appropriate error message - so let the layer_update code do the checking out and verifying things are correct before trying to parse layer.conf. This also fixes --nocheckout still checking out a branch. Additionally, drop some code that gets the layerbranch which we just retrieved a few lines above. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rw-r--r--layerindex/layerconfparse.py3
-rwxr-xr-xlayerindex/update.py4
-rw-r--r--layerindex/update_layer.py24
3 files changed, 13 insertions, 18 deletions
diff --git a/layerindex/layerconfparse.py b/layerindex/layerconfparse.py
index 3a453bd156..d599ed56b1 100644
--- a/layerindex/layerconfparse.py
+++ b/layerindex/layerconfparse.py
@@ -34,9 +34,6 @@ class LayerConfParse:
def parse_layer(self, layerbranch, layerdir):
- utils.checkout_layer_branch(layerbranch, layerdir, self.logger)
-
-
# This is not a valid layer, parsing will cause exception.
if not utils.is_layer_valid(layerdir):
return None
diff --git a/layerindex/update.py b/layerindex/update.py
index ffa2a62b61..060810de63 100755
--- a/layerindex/update.py
+++ b/layerindex/update.py
@@ -226,9 +226,7 @@ def main():
urldir = layer.get_fetch_dir()
repodir = os.path.join(fetchdir, urldir)
- layerbranch = layer.get_layerbranch(branch)
- if not layerbranch:
- continue
+ utils.checkout_layer_branch(layerbranch, repodir, logger)
config_data = layerconfparser.parse_layer(layerbranch, repodir)
if not config_data:
diff --git a/layerindex/update_layer.py b/layerindex/update_layer.py
index cec1ea39e9..3936606e25 100644
--- a/layerindex/update_layer.py
+++ b/layerindex/update_layer.py
@@ -292,18 +292,6 @@ def main():
layerdir = os.path.join(repodir, layerbranch.vcs_subdir)
layerdir_start = os.path.normpath(layerdir) + os.sep
- from layerconfparse import LayerConfParse
- layerconfparser = LayerConfParse(logger=logger, tinfoil=tinfoil)
- layer_config_data = layerconfparser.parse_layer(layerbranch, layerdir)
- if not layer_config_data:
- logger.info("Skipping update of layer %s for branch %s - conf/layer.conf may have parse issues" % (layer.name, branchdesc))
- layerconfparser.shutdown()
- sys.exit(1)
- utils.add_dependencies(layerbranch, layer_config_data, logger=logger)
- utils.add_recommends(layerbranch, layer_config_data, logger=logger)
- utils.set_layerbranch_collection_version(layerbranch, layer_config_data, logger=logger)
- layerbranch.save()
-
layerrecipes = Recipe.objects.filter(layerbranch=layerbranch)
layermachines = Machine.objects.filter(layerbranch=layerbranch)
layerdistros = Distro.objects.filter(layerbranch=layerbranch)
@@ -328,6 +316,18 @@ def main():
logger.info("Collecting data for layer %s on branch %s" % (layer.name, branchdesc))
+ from layerconfparse import LayerConfParse
+ layerconfparser = LayerConfParse(logger=logger, tinfoil=tinfoil)
+ layer_config_data = layerconfparser.parse_layer(layerbranch, layerdir)
+ if not layer_config_data:
+ logger.info("Skipping update of layer %s for branch %s - conf/layer.conf may have parse issues" % (layer.name, branchdesc))
+ layerconfparser.shutdown()
+ sys.exit(1)
+ utils.add_dependencies(layerbranch, layer_config_data, logger=logger)
+ utils.add_recommends(layerbranch, layer_config_data, logger=logger)
+ utils.set_layerbranch_collection_version(layerbranch, layer_config_data, logger=logger)
+ layerbranch.save()
+
try:
config_data_copy = recipeparse.setup_layer(tinfoil.config_data, fetchdir, layerdir, layer, layerbranch)
except recipeparse.RecipeParseError as e: