This is an automated email from the ASF dual-hosted git repository.
tvb pushed a commit to branch tristan/sboms
in repository https://gitbox.apache.org/repos/asf/buildstream-plugins.git
The following commit(s) were added to refs/heads/tristan/sboms by this push:
new 1fcd4fb sources/git.py: Implement collect_source_info()
1fcd4fb is described below
commit 1fcd4fb1ad564c215b152a2e99a6010c4c973c04
Author: Tristan van Berkom <[email protected]>
AuthorDate: Sun Mar 30 23:25:20 2025 +0900
sources/git.py: Implement collect_source_info()
---
src/buildstream_plugins/sources/git.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/buildstream_plugins/sources/git.py
b/src/buildstream_plugins/sources/git.py
index 63aee45..3fc91e7 100644
--- a/src/buildstream_plugins/sources/git.py
+++ b/src/buildstream_plugins/sources/git.py
@@ -169,7 +169,7 @@ from tempfile import TemporaryFile
from configparser import RawConfigParser
-from buildstream import Source, SourceError, SourceFetcher
+from buildstream import Source, SourceError, SourceInfo, SourceInfoMedium,
SourceVersionType
from buildstream import CoreWarnings, FastEnum
from buildstream import utils
from buildstream.utils import DirectoryExistsError
@@ -576,6 +576,13 @@ class GitMirror(SourceFetcher):
return None
+ def get_source_info(self):
+ #
+ # Currently we cannot implement version guessing, because we do not
save any tag
+ # information in the ref at tracking time.
+ #
+ return SourceInfo(self.url, SourceInfoMedium.GIT,
SourceVersionType.COMMIT, self.ref)
+
def _rebuild_git(self, fullpath):
if not self.tags:
return
@@ -986,6 +993,9 @@ class GitSource(Source):
warning_token=CoreWarnings.REF_NOT_IN_TRACK,
)
+ def collect_source_info(self):
+ return [mirror.get_source_info() for mirror in
self._recurse_submodules(configure=True)]
+
###########################################################
# Local Functions #
###########################################################