From 02c680ec3a350d09e5a8214f3bb74ca6df6137e3 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 13 Oct 2023 11:39:08 -0600 Subject: 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. --- var/spack/repos/builtin/packages/texinfo/package.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v1.2.3-60-g2f50