You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ro...@apache.org on 2020/12/29 13:28:28 UTC
[buildstream] 02/02: WORKS atm
This is an automated email from the ASF dual-hosted git repository.
root pushed a commit to branch frazer/bstSourceShow
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 46fbc94f6963db9ef9786242430148a7d6ec4975
Author: Frazer Clews <fr...@codethink.co.uk>
AuthorDate: Sat Jul 4 17:41:53 2020 +0100
WORKS atm
---
src/buildstream/_gitsourcebase.py | 3 +++
src/buildstream/_stream.py | 26 +++++++++++++++++++-------
src/buildstream/downloadablefilesource.py | 3 +++
src/buildstream/element.py | 3 +++
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 e3b2466..b307ff2 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 ad466c0..7fd16d5 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 7c2da1c..ea2aa76 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 6a0fa5f..3b47525 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 9ed3099..68bb338 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]