Skip to contentSkip to conversation

bitbake-setup: ensure that relative local path given on 'init' command line is recorded as an absolute path

PATCH In review Alexander Kanavin 1 participant 3 messages Mar 5 – Mar 8 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 bitbake-setup: ensure that relative local path given on 'init' command line is recorded as an absolute path

From: Alexander Kanavin <[email protected]>

Otherwise status/update operations will fail if executed from a different directory that the template file was in, as they won't be able to find the file.

---
 bin/bitbake-setup | 1 +
 1 file changed, 1 insertion(+)
bin/bitbake-setup +1 -0
index bdf134aea..1a42aaa51 100755
@@ -600,6 +600,7 @@ def obtain_config(top_dir, registry, args, source_overrides, d):
         config_id = args.config[0]
         config_parameters = args.config[1:]
         if os.path.exists(config_id):
+            config_id = os.path.abspath(config_id)
             logger.info("Reading configuration from local file\n    {}".format(config_id))
             upstream_config = {'type':'local',
                                'path':os.path.abspath(config_id),
Signature · 1 line
2.47.3
#1 lore raw

PATCH 2/2 bitbake-setup: correctly determine latest revision in status/update when it is fixed to a commit id

From: Alexander Kanavin <[email protected]>

The code was relying on git fetcher's latest_revision() method, which works properly if the revision in the json config template is set to a branch or a tag, but does not work if it is set to a fixed revision (the method will return the latest revision on the respective branch, and bitbake-setup will incorrectly determine that the layer needs to be updated to that revision).

Add a guard to check if revision is a commit id, and skip the check if so.

[YOCTO #16190]

---
 bin/bitbake-setup | 4 ++++
 1 file changed, 4 insertions(+)
bin/bitbake-setup +4 -0
index 1a42aaa51..69362b589 100755
@@ -741,9 +741,13 @@ def get_diff(file1, file2):
     return None
 
 def are_layers_changed(layers, layerdir, d):
+    from bb.fetch2.git import sha1_re
+
     def _is_git_remote_changed(r_remote, repodir):
         changed = False
         rev = r_remote['rev']
+        if sha1_re.match(rev):
+            return False
         branch = r_remote.get('branch', None)
 
         remotes = _get_remotes(r_remote)
Signature · 1 line
2.47.3

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Re: [bitbake-devel] [PATCH 2/2] bitbake-setup: correctly determine latest revision in status/update when it is fixed to a commit id

Please hold this, I’ll develop a better fix.

Alex

Quoted 52 lines · Alexander Kanavin via lists.openembedded.org

From: Alexander Kanavin <[email protected]>

The code was relying on git fetcher's latest_revision() method, which works properly if the revision in the json config template is set to a branch or a tag, but does not work if it is set to a fixed revision (the method will return the latest revision on the respective branch, and bitbake-setup will incorrectly determine that the layer needs to be updated to that revision).

Add a guard to check if revision is a commit id, and skip the check if so.

[YOCTO #16190]

---
 bin/bitbake-setup | 4 ++++
 1 file changed, 4 insertions(+)
bin/bitbake-setup +4 -1
index 1a42aaa51..69362b589 100755
@@ -741,9 +741,13 @@ def get_diff(file1, file2):
     return None
 
 def are_layers_changed(layers, layerdir, d):
+    from bb.fetch2.git import sha1_re
+
     def _is_git_remote_changed(r_remote, repodir):
         changed = False
         rev = r_remote['rev']
+        if sha1_re.match(rev):
+            return False
         branch = r_remote.get('branch', None)
 
         remotes = _get_remotes(r_remote)
--

2.47.3

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#19118):
https://lists.openembedded.org/g/bitbake-devel/message/19118
Mute This Topic: https://lists.openembedded.org/mt/118158860/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-