From: Anibal Limon <anibal@limonsoftware.com>
To: bitbake-devel@lists.openembedded.org
Cc: alex@linutronix.de, jonas@limonsoftware.com,
Anibal Limon <anibal@limonsoftware.com>
Subject: [PATCH] bitbake-setup: _has_local_modifications fix layer add on existing project
Date: Wed, 28 Jan 2026 08:33:36 -0600 [thread overview]
Message-ID: <20260128143336.1963432-1-anibal@limonsoftware.com> (raw)
When a layer is add to the registry and previous project checkout exists,
the sources-fixed-revisions.json not has a previous revision.
Fixes:
```
File "/workspaces/ls/meta-ls/bitbake/bin/bitbake-setup", line 1137, in <module>
main()
~~~~^^
File "/workspaces/ls/meta-ls/bitbake/bin/bitbake-setup", line 1130, in main
args.func(top_dir, all_settings, args, d)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/ls/meta-ls/bitbake/bin/bitbake-setup", line 735, in build_update
build_status(top_dir, settings, args, d, update=True)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/ls/meta-ls/bitbake/bin/bitbake-setup", line 719, in build_status
update_build(new_upstream_config, confdir, setupdir, layerdir, d,
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
update_bb_conf=args.update_bb_conf)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/ls/meta-ls/bitbake/bin/bitbake-setup", line 408, in update_build
sources_fixed_revisions = checkout_layers(layer_config, confdir, layerdir, d)
File "/workspaces/ls/meta-ls/bitbake/bin/bitbake-setup", line 184, in checkout_layers
elif _has_local_modifications(r_name, repodir_path):
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/ls/meta-ls/bitbake/bin/bitbake-setup", line 143, in _has_local_modifications
rev = fixed_revisions['sources'][r_name]['git-remote']['rev']
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'meta-freescale'
```
Signed-off-by: Anibal Limon <anibal@limonsoftware.com>
---
bin/bitbake-setup | 3 +++
1 file changed, 3 insertions(+)
diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 4d709ed8c..46b2bff01 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -140,6 +140,9 @@ def checkout_layers(layers, confdir, layerdir, d):
def _has_local_modifications(r_name, r_path):
fixed_revisions = json.load(open(os.path.join(confdir, "sources-fixed-revisions.json")))
+
+ if not r_name in fixed_revisions['sources']:
+ return False
rev = fixed_revisions['sources'][r_name]['git-remote']['rev']
status = bb.process.run('git -C {} status --porcelain'.format(r_path))[0]
if status:
--
2.51.0
next reply other threads:[~2026-01-28 14:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 14:33 Anibal Limon [this message]
2026-01-28 14:49 ` [bitbake-devel] [PATCH] bitbake-setup: _has_local_modifications fix layer add on existing project Alexander Kanavin
2026-01-28 18:26 ` Anibal Limon
2026-01-28 18:29 ` Alexander Kanavin
[not found] ` <188EF863C74CB2B9.4042470@lists.openembedded.org>
2026-01-28 18:30 ` Anibal Limon
2026-01-28 18:42 ` Alexander Kanavin
2026-01-28 19:05 ` Anibal Limon
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=20260128143336.1963432-1-anibal@limonsoftware.com \
--to=anibal@limonsoftware.com \
--cc=alex@linutronix.de \
--cc=bitbake-devel@lists.openembedded.org \
--cc=jonas@limonsoftware.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox