You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/02/04 08:13:59 UTC

[buildstream] 03/04: fixup! Add SourceTransform base class

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch gokcen/source_transform
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 89b3d794981a00ecdd82378fa4ec007fc50664f2
Author: Gökçen Nurlu <gn...@bloomberg.net>
AuthorDate: Thu Jun 28 11:34:12 2018 +0100

    fixup! Add SourceTransform base class
---
 buildstream/element.py         | 2 +-
 buildstream/sourcetransform.py | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/buildstream/element.py b/buildstream/element.py
index ff1b0ce..b4856c7 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1182,7 +1182,7 @@ class Element(Plugin):
             raise ElementError("{}: {}".format(self, e), reason=e.reason) from e
 
         if self.__sources and isinstance(self.__sources[0], SourceTransform):
-            raise ElementError("{}: A SourceTransform plugin can't be the first source of a build element"
+            raise ElementError("{}: A SourceTransform plugin can't be the first source of an element"
                                .format(self))
 
         # Preflight the sources
diff --git a/buildstream/sourcetransform.py b/buildstream/sourcetransform.py
index ccf9218..e461eaa 100644
--- a/buildstream/sourcetransform.py
+++ b/buildstream/sourcetransform.py
@@ -66,7 +66,6 @@ class SourceTransform(Source):
                 src._save_ref(new_ref)
                 src._fetch()
 
-    # Needs explanation
     def track(self, previous_staging_dir):
         """Resolve a new ref from the plugin's track option
 
@@ -86,7 +85,6 @@ class SourceTransform(Source):
         """
         raise ImplError("SourceTransform plugin '{}' does not implement track()".format(self.get_kind()))
 
-    # Needs explanation
     def fetch(self, previous_staging_dir):
         """Fetch remote sources and mirror them locally, ensuring at least
         that the specific reference is cached locally.
@@ -109,7 +107,7 @@ class SourceTransform(Source):
     def _track(self, previous_sources):
         self.__ensure_previous_sources(previous_sources)
 
-        with utils._tempdir(suffix="tracking") as staging_directory:
+        with self.tempdir() as staging_directory:
             for src in previous_sources:
                 src._stage(staging_directory)
 
@@ -129,7 +127,7 @@ class SourceTransform(Source):
     def _fetch(self, previous_sources):
         self.__ensure_previous_sources(previous_sources)
 
-        with utils._tempdir(suffix="fetch") as staging_directory:
+        with self.tempdir() as staging_directory:
             for src in previous_sources:
                 src._stage(staging_directory)