summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorJohannes Schneider <johannes.schneider@leica-geosystems.com>2025-11-05 20:06:36 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-06 18:03:46 +0000
commit9780ec24d070b0638492c0f153a7ed776c150ed5 (patch)
treeb78f5a34c970027658b7e4e51d94922e469c1ad1 /bitbake/lib
parent13b7a749eccccac9d78a546afb856cc4d3004ed9 (diff)
downloadpoky-9780ec24d070b0638492c0f153a7ed776c150ed5.tar.gz
bitbake: bitbake-setup: capture revisions while checking out layers
When initializing a build setup from a conf.json that only sets 'rev' to a tag or branch, the actual revision would not be captured or logged. To capture the current layer state after an 'init' or 'update', the checkout_layers function is extended to store the revision the bb.fetch.Fetch pulled, and write that information into a sources-fixed-revisions.json file. This file can then be fed back into bitbake-setup init as: --sources-overrides This new 'sources-fixed-revisions.json' is written during 'update_build' and stored alongside the 'config-upstream.json' in the config dir. And put with the later under version control by calling 'commit_config" after 'update_build'. The use of 'deepcopy' is necessary to not modify the original input data - which python passes around as reference. (Bitbake rev: 95866ff03f78e987ae7e47daad053bc0f353eea4) Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/tests/setup.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/setup.py b/bitbake/lib/bb/tests/setup.py
index e18d6fc6ae..767a6298da 100644
--- a/bitbake/lib/bb/tests/setup.py
+++ b/bitbake/lib/bb/tests/setup.py
@@ -187,6 +187,12 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
187 bb_conf_path = os.path.join(bb_build_path, 'conf') 187 bb_conf_path = os.path.join(bb_build_path, 'conf')
188 self.assertTrue(os.path.exists(os.path.join(bb_build_path, 'init-build-env'))) 188 self.assertTrue(os.path.exists(os.path.join(bb_build_path, 'init-build-env')))
189 189
190 with open(os.path.join(setuppath, 'config', "sources-fixed-revisions.json")) as f:
191 sources_fixed_revisions = json.load(f)
192 self.assertTrue('test-repo' in sources_fixed_revisions['sources'].keys())
193 revision = self.git('rev-parse HEAD', cwd=self.testrepopath).strip()
194 self.assertEqual(revision, sources_fixed_revisions['sources']['test-repo']['git-remote']['rev'])
195
190 if "oe-template" in bitbake_config: 196 if "oe-template" in bitbake_config:
191 with open(os.path.join(bb_conf_path, 'conf-summary.txt')) as f: 197 with open(os.path.join(bb_conf_path, 'conf-summary.txt')) as f:
192 self.assertEqual(f.read(), bitbake_config["oe-template"]) 198 self.assertEqual(f.read(), bitbake_config["oe-template"])