diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/file/package.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/file/package.py b/var/spack/repos/builtin/packages/file/package.py index 582c15cf62..13d1b59ec1 100644 --- a/var/spack/repos/builtin/packages/file/package.py +++ b/var/spack/repos/builtin/packages/file/package.py @@ -2,6 +2,9 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import re + from spack import * @@ -16,3 +19,11 @@ class File(AutotoolsPackage): version('5.39', sha256='f05d286a76d9556243d0cb05814929c2ecf3a5ba07963f8f70bfaaa70517fad1') version('5.38', sha256='593c2ffc2ab349c5aea0f55fedfe4d681737b6b62376a9b3ad1e77b2cc19fa34') version('5.37', sha256='e9c13967f7dd339a3c241b7710ba093560b9a33013491318e88e6b8b57bae07f') + + executables = ['^file$'] + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)('--version', output=str, error=str) + match = re.search(r'file-(\S+)', output) + return match.group(1) if match else None |