gnunet-svn
[Top][All Lists]
Advanced

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

[taler-build-common] branch master updated (d1f949d -> f65d933)


From: gnunet
Subject: [taler-build-common] branch master updated (d1f949d -> f65d933)
Date: Mon, 03 Aug 2020 09:50:28 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a change to branch master
in repository build-common.

    from d1f949d  implement missing methods
     new d399a1b  add GenericTool
     new f65d933  paths

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 configure           |  4 +++-
 talerbuildconfig.py | 25 ++++++++++++++++++++++---
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index ef7f697..20de9e1 100755
--- a/configure
+++ b/configure
@@ -41,5 +41,7 @@ python3 "$scriptpath/pyvercheck.py" || exit $?
 # Allow Python to find libraries that are checked into the build system git.
 export PYTHONPATH="$scriptpath:${PYTHONPATH:-}"
 
+export TALERBUILDSYSTEMDIR=./build-system
+
 # Call configure.py, assuming all went well.
-exec python3 ./configure.py "$@"
+exec python3 $TALERBUILDSYSTEMDIR/configure.py "$@"
diff --git a/talerbuildconfig.py b/talerbuildconfig.py
index db451c0..832837e 100644
--- a/talerbuildconfig.py
+++ b/talerbuildconfig.py
@@ -36,6 +36,7 @@ from distutils.spawn import find_executable
 import subprocess
 from dataclasses import dataclass
 import semver
+from pathlib import Path
 
 """
 This module aims to replicate a small GNU Coding Standards
@@ -146,7 +147,9 @@ class BuildConfig:
                 print(f"found {tool.name} as {path} (version {version})")
 
         if self.configmk_enabled:
-            with open("config.mk", "w") as f:
+            d = Path(os.environ.get("TALERBUILDSYSTEMDIR", "."))
+            d.mkdir(parents=True, exist_ok=True)
+            with open(d / "config.mk", "w") as f:
                 print("writing config.mk")
                 f.write("# this makefile fragment is autogenerated by 
configure.py\n")
                 if self.prefix_enabled:
@@ -438,7 +441,7 @@ class NodeJsTool(Tool):
         pass
 
     def check(self, buildconfig):
-        if existence("node") is None:
+        if not existence("node"):
             return False
         if (
             subprocess.getstatusoutput(
@@ -452,6 +455,22 @@ class NodeJsTool(Tool):
         buildconfig._set_tool("node", "node", version=node_version)
         return True
 
+class GenericTool(Tool):
+    def __init__(self, name, hint, version_arg="-v"):
+        self.name = name
+        self.hint = hint
+        self.version_arg = version_arg
+
+    def args(self, parser):
+        pass
+
+    def check(self, buildconfig):
+        if not existence(self.name):
+            return False
+        vers = tool_version(f"{self.name} {self.version_arg}")
+        buildconfig._set_tool(self.name, self.name, version=vers)
+        return True
+
 
 class PosixTool(Tool):
     def __init__(self, name):
@@ -461,7 +480,7 @@ class PosixTool(Tool):
         pass
 
     def check(self, buildconfig):
-        found = existence("find")
+        found = existence(self.name)
         if found:
             buildconfig._set_tool(self.name, self.name)
             return True

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]