external packages: redirect stderr too (#18037)
This commit is contained in:
parent
8ade93d09d
commit
a14648ffd0
@ -28,7 +28,7 @@ class Automake(AutotoolsPackage, GNUMirrorPackage):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def determine_version(cls, exe):
|
def determine_version(cls, exe):
|
||||||
output = Executable(exe)('--version', output=str)
|
output = Executable(exe)('--version', output=str, error=str)
|
||||||
match = re.search(r'GNU automake\)\s+(\S+)', output)
|
match = re.search(r'GNU automake\)\s+(\S+)', output)
|
||||||
return match.group(1) if match else None
|
return match.group(1) if match else None
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ class Cmake(Package):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def determine_version(cls, exe):
|
def determine_version(cls, exe):
|
||||||
output = Executable(exe)('--version', output=str)
|
output = Executable(exe)('--version', output=str, error=str)
|
||||||
match = re.search(r'cmake.*version\s+(\S+)', output)
|
match = re.search(r'cmake.*version\s+(\S+)', output)
|
||||||
return match.group(1) if match else None
|
return match.group(1) if match else None
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
@ -35,7 +34,7 @@ class Libtool(AutotoolsPackage, GNUMirrorPackage):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def determine_version(cls, exe):
|
def determine_version(cls, exe):
|
||||||
output = Executable(exe)('--version', output=str, error=os.devnull)
|
output = Executable(exe)('--version', output=str, error=str)
|
||||||
match = re.search(r'\(GNU libtool\)\s+(\S+)', output)
|
match = re.search(r'\(GNU libtool\)\s+(\S+)', output)
|
||||||
return match.group(1) if match else None
|
return match.group(1) if match else None
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ class Openssl(Package): # Uses Fake Autotools, should subclass Package
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def determine_version(cls, exe):
|
def determine_version(cls, exe):
|
||||||
output = Executable(exe)('version', output=str)
|
output = Executable(exe)('version', output=str, error=str)
|
||||||
match = re.search(r'OpenSSL.(\S+)*', output)
|
match = re.search(r'OpenSSL.(\S+)*', output)
|
||||||
return match.group(1) if match else None
|
return match.group(1) if match else None
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package
|
|||||||
@classmethod
|
@classmethod
|
||||||
def determine_version(cls, exe):
|
def determine_version(cls, exe):
|
||||||
perl = spack.util.executable.Executable(exe)
|
perl = spack.util.executable.Executable(exe)
|
||||||
output = perl('--version', output=str)
|
output = perl('--version', output=str, error=str)
|
||||||
if output:
|
if output:
|
||||||
match = re.search(r'perl.*\(v([0-9.]+)\)', output)
|
match = re.search(r'perl.*\(v([0-9.]+)\)', output)
|
||||||
if match:
|
if match:
|
||||||
@ -110,7 +110,7 @@ def determine_version(cls, exe):
|
|||||||
def determine_variants(cls, exes, version):
|
def determine_variants(cls, exes, version):
|
||||||
for exe in exes:
|
for exe in exes:
|
||||||
perl = spack.util.executable.Executable(exe)
|
perl = spack.util.executable.Executable(exe)
|
||||||
output = perl('-V', output=str)
|
output = perl('-V', output=str, error=str)
|
||||||
variants = ''
|
variants = ''
|
||||||
if output:
|
if output:
|
||||||
match = re.search(r'-Duseshrplib', output)
|
match = re.search(r'-Duseshrplib', output)
|
||||||
|
Loading…
Reference in New Issue
Block a user