diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-08-03 13:12:56 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-08-03 13:12:56 +0530 |
commit | d399a1bc794576a0c3932d92ff63f0ae97300570 (patch) | |
tree | abdb9a050a34d28fe5ee3835887d4456dd7b46e9 /talerbuildconfig.py | |
parent | d1f949d0cbe30839eb53f34e2a8b34f61e0ad33a (diff) | |
download | build-common-d399a1bc794576a0c3932d92ff63f0ae97300570.tar.gz build-common-d399a1bc794576a0c3932d92ff63f0ae97300570.tar.bz2 build-common-d399a1bc794576a0c3932d92ff63f0ae97300570.zip |
add GenericTool
Diffstat (limited to 'talerbuildconfig.py')
-rw-r--r-- | talerbuildconfig.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/talerbuildconfig.py b/talerbuildconfig.py index db451c0..d2fe3b0 100644 --- a/talerbuildconfig.py +++ b/talerbuildconfig.py @@ -438,7 +438,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 +452,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 +477,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 |