summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Scott <hi@alecbcs.com>2024-02-19 02:27:39 -0800
committerGitHub <noreply@github.com>2024-02-19 11:27:39 +0100
commit44d08d2c24fd195b7a608f6610ba3e536f8cf9a7 (patch)
tree48c660f2820ff168ed2e44edac867fdc0439cbbc
parentc6faab10aab0bc833c2df24cb3a60c0f40bced2e (diff)
downloadspack-44d08d2c24fd195b7a608f6610ba3e536f8cf9a7.tar.gz
spack-44d08d2c24fd195b7a608f6610ba3e536f8cf9a7.tar.bz2
spack-44d08d2c24fd195b7a608f6610ba3e536f8cf9a7.tar.xz
spack-44d08d2c24fd195b7a608f6610ba3e536f8cf9a7.zip
gnupg: make discoverable as external (#42736)
-rw-r--r--var/spack/repos/builtin/packages/gnupg/package.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gnupg/package.py b/var/spack/repos/builtin/packages/gnupg/package.py
index d41f2d2632..c59d4875ec 100644
--- a/var/spack/repos/builtin/packages/gnupg/package.py
+++ b/var/spack/repos/builtin/packages/gnupg/package.py
@@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+import re
+
from spack.package import *
from spack.util.environment import is_system_path
@@ -136,6 +138,14 @@ class Gnupg(AutotoolsPackage):
# Getting some linking error.
conflicts("%gcc@10:", when="@:1")
+ executables = ["^gpg$", "^gpg-agent$"]
+
+ @classmethod
+ def determine_version(cls, exe):
+ output = Executable(exe)("--version", output=str, error=str)
+ match = re.search(r"gpg \(GnuPG\) (\S+)", output)
+ return match.group(1) if match else None
+
@run_after("install")
def add_gpg2_symlink(self):
if self.spec.satisfies("@2.0:2"):