[gnome-build-meta/abderrahim/bst2: 10/16] plugins/collect_initial_scripts.py: port to buildstream 2




commit 85e6df26fb3d739be5141342dcc3a4d3d9586e73
Author: Abderrahim Kitouni <akitouni gnome org>
Date:   Fri Feb 14 08:23:31 2020 +0100

    plugins/collect_initial_scripts.py: port to buildstream 2

 plugins/collect_initial_scripts.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/plugins/collect_initial_scripts.py b/plugins/collect_initial_scripts.py
index f0d8c413..39090aa9 100644
--- a/plugins/collect_initial_scripts.py
+++ b/plugins/collect_initial_scripts.py
@@ -3,6 +3,8 @@ import re
 from buildstream import Element, ElementError, Scope
 
 class ExtractInitialScriptsElement(Element):
+    BST_MIN_VERSION = '2.0'
+
     BST_FORBID_RDEPENDS = True
     BST_FORBID_SOURCES = True
 
@@ -10,11 +12,11 @@ class ExtractInitialScriptsElement(Element):
     BST_ARTIFACT_VERSION = 1
 
     def configure(self, node):
-        self.node_validate(node, [
+        node.validate_keys([
             'path',
         ])
 
-        self.path = self.node_subst_member(node, 'path')
+        self.path = node.get_str('path')
 
     def preflight(self):
         pass
@@ -38,7 +40,7 @@ class ExtractInitialScriptsElement(Element):
         for dependency in self.dependencies(Scope.BUILD):
             public = dependency.get_public_data('initial-script')
             if public and 'script' in public:
-                script = self.node_subst_member(public, 'script')
+                script = self.node_subst_vars(public.get_scalar('script'))
                 index += 1
                 depname = re.sub('[^A-Za-z0-9]', '_', dependency.name)
                 basename = '{:03}-{}'.format(index, depname)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]