external packages: redirect stderr too (#18037)

This commit is contained in:
Adam J. Stewart 2020-08-14 01:40:58 -05:00 committed by GitHub
parent 8ade93d09d
commit a14648ffd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 7 deletions

View File

@ -28,7 +28,7 @@ class Automake(AutotoolsPackage, GNUMirrorPackage):
@classmethod
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)
return match.group(1) if match else None

View File

@ -162,7 +162,7 @@ class Cmake(Package):
@classmethod
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)
return match.group(1) if match else None

View File

@ -3,7 +3,6 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import re
@ -35,7 +34,7 @@ class Libtool(AutotoolsPackage, GNUMirrorPackage):
@classmethod
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)
return match.group(1) if match else None

View File

@ -80,7 +80,7 @@ class Openssl(Package): # Uses Fake Autotools, should subclass Package
@classmethod
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)
return match.group(1) if match else None

View File

@ -99,7 +99,7 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package
@classmethod
def determine_version(cls, exe):
perl = spack.util.executable.Executable(exe)
output = perl('--version', output=str)
output = perl('--version', output=str, error=str)
if output:
match = re.search(r'perl.*\(v([0-9.]+)\)', output)
if match:
@ -110,7 +110,7 @@ def determine_version(cls, exe):
def determine_variants(cls, exes, version):
for exe in exes:
perl = spack.util.executable.Executable(exe)
output = perl('-V', output=str)
output = perl('-V', output=str, error=str)
variants = ''
if output:
match = re.search(r'-Duseshrplib', output)