cvs: add the external find feature for cvs (#28863)

This commit is contained in:
Olivier Cessenat 2022-02-10 18:35:22 +01:00 committed by GitHub
parent 5206bca19b
commit 8b39aa1b50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import re
from spack import *
@ -20,3 +21,10 @@ class Cvs(AutotoolsPackage, GNUMirrorPackage):
sha256='e13db2acebad3ca5be5d8e0fa97f149b0f9661e4a9a731965c8226290c6413c0', when='@1.12.13')
parallel = False
executables = [r'^cvs$']
@classmethod
def determine_version(cls, exe):
output = Executable(exe)('--version', output=str, error=str)
match = re.search(r'\(CVS\)\s+([\d\.]+)', output)
return match.group(1) if match else None