diff options
author | Dom Heinzeller <dom.heinzeller@icloud.com> | 2023-10-13 11:39:08 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-13 10:39:08 -0700 |
commit | 02c680ec3a350d09e5a8214f3bb74ca6df6137e3 (patch) | |
tree | 530bd89570256e2fe4ced86e1cc48cf7ba6c8c31 | |
parent | 8248e180ca1588300bb51beee0b7a1ee303b81ac (diff) | |
download | spack-02c680ec3a350d09e5a8214f3bb74ca6df6137e3.tar.gz spack-02c680ec3a350d09e5a8214f3bb74ca6df6137e3.tar.bz2 spack-02c680ec3a350d09e5a8214f3bb74ca6df6137e3.tar.xz spack-02c680ec3a350d09e5a8214f3bb74ca6df6137e3.zip |
texinfo package: fix external detection (#40470)
A complete texinfo install includes both `info` and `makeinfo`. Some
system installations of texinfo may exclude one or the other. This
updates the external finding logic to require both.
-rw-r--r-- | var/spack/repos/builtin/packages/texinfo/package.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/texinfo/package.py b/var/spack/repos/builtin/packages/texinfo/package.py index a21cf9ec27..052dee4b4d 100644 --- a/var/spack/repos/builtin/packages/texinfo/package.py +++ b/var/spack/repos/builtin/packages/texinfo/package.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os import re from spack.package import * @@ -69,6 +70,13 @@ class Texinfo(AutotoolsPackage, GNUMirrorPackage): @classmethod def determine_version(cls, exe): + # On CentOS and Ubuntu, the OS package info installs "info", + # which satisfies spack external find, but "makeinfo" comes + # from texinfo and may not be installed (and vice versa). + (texinfo_path, info_exe) = os.path.split(exe) + makeinfo_exe = os.path.join(texinfo_path, "makeinfo") + if not os.path.exists(makeinfo_exe): + return None output = Executable(exe)("--version", output=str, error=str) match = re.search(r"info \(GNU texinfo\)\s+(\S+)", output) return match.group(1) if match else None |