sed: make package discoverable (#25481)
This commit is contained in:
parent
201f5bdfe8
commit
8be614729c
1 changed files with 11 additions and 0 deletions
|
@ -3,6 +3,8 @@
|
|||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
import re
|
||||
|
||||
from spack import *
|
||||
|
||||
|
||||
|
@ -12,3 +14,12 @@ class Sed(AutotoolsPackage, GNUMirrorPackage):
|
|||
gnu_mirror_path = "sed/sed-4.2.2.tar.bz2"
|
||||
|
||||
version('4.2.2', sha256='f048d1838da284c8bc9753e4506b85a1e0cc1ea8999d36f6995bcb9460cddbd7')
|
||||
|
||||
executables = ['^sed$']
|
||||
|
||||
@classmethod
|
||||
def determine_version(cls, exe):
|
||||
output = Executable(exe)('--version', output=str, error=str)
|
||||
version_regexp = r'{:s} \(GNU sed\) (\S+)'.format(exe)
|
||||
match = re.search(version_regexp, output)
|
||||
return match.group(1) if match else None
|
||||
|
|
Loading…
Reference in a new issue