diff options
author | iarspider <iarspider@gmail.com> | 2020-10-16 16:10:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-16 16:10:07 +0200 |
commit | d34b612052db5a1c5cfce75e1107732e22fc297e (patch) | |
tree | 6d8d2e04f04a0a8037506b11b0a1bfec84a740e1 | |
parent | 4b9701a195f32ba054f94a375548ad224e887bca (diff) | |
download | spack-d34b612052db5a1c5cfce75e1107732e22fc297e.tar.gz spack-d34b612052db5a1c5cfce75e1107732e22fc297e.tar.bz2 spack-d34b612052db5a1c5cfce75e1107732e22fc297e.tar.xz spack-d34b612052db5a1c5cfce75e1107732e22fc297e.zip |
diffutils: added support for external detection (#19344)
-rw-r--r-- | var/spack/repos/builtin/packages/diffutils/package.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/diffutils/package.py b/var/spack/repos/builtin/packages/diffutils/package.py index d41086113a..41c1101416 100644 --- a/var/spack/repos/builtin/packages/diffutils/package.py +++ b/var/spack/repos/builtin/packages/diffutils/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import re + from spack import * @@ -10,6 +12,8 @@ class Diffutils(AutotoolsPackage, GNUMirrorPackage): """GNU Diffutils is a package of several programs related to finding differences between files.""" + executables = [r'^diff$'] + homepage = "https://www.gnu.org/software/diffutils/" gnu_mirror_path = "diffutils/diffutils-3.7.tar.xz" @@ -24,3 +28,9 @@ class Diffutils(AutotoolsPackage, GNUMirrorPackage): if self.spec.satisfies('%fj'): env.append_flags('CFLAGS', '-Qunused-arguments') + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)('--version', output=str, error=str) + match = re.search(r'diff \(GNU diffutils\) (\S+)', output) + return match.group(1) if match else None |