diff options
Diffstat (limited to 'src/buildstream')
-rw-r--r-- | src/buildstream/_gitsourcebase.py | 3 | ||||
-rw-r--r-- | src/buildstream/_stream.py | 26 | ||||
-rw-r--r-- | src/buildstream/downloadablefilesource.py | 3 | ||||
-rw-r--r-- | src/buildstream/element.py | 3 | ||||
-rw-r--r-- | src/buildstream/plugins/sources/remote.py | 3 |
5 files changed, 31 insertions, 7 deletions
diff --git a/src/buildstream/_gitsourcebase.py b/src/buildstream/_gitsourcebase.py index e3b246677..b307ff22f 100644 --- a/src/buildstream/_gitsourcebase.py +++ b/src/buildstream/_gitsourcebase.py @@ -555,6 +555,9 @@ class _GitSourceBase(Source): self.mark_download_url(self.original_url) + def get_url(self): + return self.original_url + def preflight(self): # Check if git is installed, get the binary at the same time self.host_git = utils.get_host_tool("git") diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py index ad466c0f7..7fd16d573 100644 --- a/src/buildstream/_stream.py +++ b/src/buildstream/_stream.py @@ -52,6 +52,9 @@ from .types import _KeyStrength, _PipelineSelection, _SchedulerErrorAction from .plugin import Plugin from . import utils, _yaml, _site from . import Scope +from . import DownloadableFileSource, _GitSourceBase +from .plugins.sources.bzr import BzrSource +from .plugins.sources.pip import PipSource # Stream() @@ -312,7 +315,6 @@ class Stream: def show(self, targets, *, selection=_PipelineSelection.ALL, except_targets=None, remote=None): """""" - #use_source_config = True use_source_config = True if remote: use_source_config = False @@ -324,14 +326,24 @@ class Stream: use_source_config=use_source_config, source_remote_url=remote, ) - print(len(elements)) for element in elements: - print("oi") - source = element.sources() - for source in element: - print(source) - print("hello") + for source in element.sources(): + if isinstance(source, (DownloadableFileSource, BzrSource, _GitSourceBase, PipSource)): + print(source.get_url()) + #print(source._get_source_name()) + #print(source.get_mirror_directory()) + #for source_fetcher in source.get_source_fetchers(): + # print(source_fetcher._get_alias()) + print("") + #if element._get_remote_execution_specs() is None: + # print("local") + #else: + # print("remote") + # print(element._get_remote_execution_specs()) + #for source in element: + # print(source) + #print(source) #element = target._get_source_element() #source = element #print(element) diff --git a/src/buildstream/downloadablefilesource.py b/src/buildstream/downloadablefilesource.py index 7c2da1c02..ea2aa7699 100644 --- a/src/buildstream/downloadablefilesource.py +++ b/src/buildstream/downloadablefilesource.py @@ -114,6 +114,9 @@ class DownloadableFileSource(Source): self._mirror_dir = os.path.join(self.get_mirror_directory(), utils.url_directory_name(self.original_url)) self._warn_deprecated_etag(node) + def get_url(self): + return self.original_url + def preflight(self): return diff --git a/src/buildstream/element.py b/src/buildstream/element.py index 6a0fa5fab..3b47525b0 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -2459,6 +2459,9 @@ class Element(Plugin): def __use_remote_execution(self): return bool(self.__remote_execution_specs) + def _get_remote_execution_specs(self): + return self.__remote_execution_specs + # __sandbox(): # # A context manager to prepare a Sandbox object at the specified directory, diff --git a/src/buildstream/plugins/sources/remote.py b/src/buildstream/plugins/sources/remote.py index 9ed3099d9..68bb33841 100644 --- a/src/buildstream/plugins/sources/remote.py +++ b/src/buildstream/plugins/sources/remote.py @@ -68,6 +68,9 @@ class RemoteSource(DownloadableFileSource): ) node.validate_keys(DownloadableFileSource.COMMON_CONFIG_KEYS + ["filename", "executable"]) + #def get_url(self): + # return super().get_url() + def get_unique_key(self): return super().get_unique_key() + [self.filename, self.executable] |