diff options
author | Christoph Conrads <22275833+christoph-conrads@users.noreply.github.com> | 2021-08-20 14:54:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-20 14:54:43 +0200 |
commit | 2474b9107811664f576031f6deed59533889ecd5 (patch) | |
tree | fccce30e3551f12e8212f7b70d8b15bbf3cd88c2 /var | |
parent | dcd19e7982024f4f196f24b71fc2d73bef6723eb (diff) | |
download | spack-2474b9107811664f576031f6deed59533889ecd5.tar.gz spack-2474b9107811664f576031f6deed59533889ecd5.tar.bz2 spack-2474b9107811664f576031f6deed59533889ecd5.tar.xz spack-2474b9107811664f576031f6deed59533889ecd5.zip |
file: make package discoverable (#25479)
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 |