When a new release is run for the first time, no LayerBranch exists
yet and the update_enabled cannot be queried. The unintended result
is that all layers are skipped. Move the update_enabled check into
the code path where the layerbranch already exists.

Signed-off-by: Tim Orling <tim.orl...@konsulko.com>
---
 layerindex/update.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/layerindex/update.py b/layerindex/update.py
index e7e5c63..3da74e3 100755
--- a/layerindex/update.py
+++ b/layerindex/update.py
@@ -361,6 +361,12 @@ def main():
                         if layerbranch.actual_branch:
                             branchname = layerbranch.actual_branch
                             branchdesc = "%s (%s)" % (branch, branchname)
+
+                        layerbranch_updates_enabled = 
LayerBranch.objects.filter(layer=layer,
+                                                                               
 branch=branchobj.id, updates_enabled=True)
+                        if not layerbranch_updates_enabled:
+                            logger.info("Skipping update of layer %s branch %s 
- updates disabled" % (layer.name, branchname))
+                            continue
                     else:
                         # LayerBranch doesn't exist for this branch, create it 
temporarily
                         # (we won't save this - update_layer.py will do the 
actual creation
@@ -375,11 +381,6 @@ def main():
                         if layerbranch_source:
                             layerbranch.vcs_subdir = 
layerbranch_source.vcs_subdir
 
-                    layerbranch_updates_enabled = 
LayerBranch.objects.filter(layer=layer, branch=branchobj.id, 
updates_enabled=True)
-                    if not layerbranch_updates_enabled:
-                        logger.info("Skipping update of layer %s  branch %s - 
updates disabled" % (layer.name, branchname))
-                        continue
-
                     # Collect repo info
                     urldir = layer.get_fetch_dir()
                     repodir = os.path.join(fetchdir, urldir)
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#61648): https://lists.yoctoproject.org/g/yocto/message/61648
Mute This Topic: https://lists.yoctoproject.org/mt/102493809/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to