summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2022-01-17 02:39:17 -0600
committerGitHub <noreply@github.com>2022-01-17 09:39:17 +0100
commit5e595586a77dd7a8de25169dfc6cd45cb4cd3a5d (patch)
tree2d514d6ccaa469e44d5d10591967e9ec978609d1 /var
parentdbb36ef8b1b23e7b3a4e6c87301eb0108f7b14ee (diff)
downloadspack-5e595586a77dd7a8de25169dfc6cd45cb4cd3a5d.tar.gz
spack-5e595586a77dd7a8de25169dfc6cd45cb4cd3a5d.tar.bz2
spack-5e595586a77dd7a8de25169dfc6cd45cb4cd3a5d.tar.xz
spack-5e595586a77dd7a8de25169dfc6cd45cb4cd3a5d.zip
zip: add external detection (#28434)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/zip/package.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/zip/package.py b/var/spack/repos/builtin/packages/zip/package.py
index b2a3ed161c..514d666c2f 100644
--- a/var/spack/repos/builtin/packages/zip/package.py
+++ b/var/spack/repos/builtin/packages/zip/package.py
@@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+import re
+
class Zip(MakefilePackage):
"""Zip is a compression and file packaging/archive utility."""
@@ -27,6 +29,14 @@ class Zip(MakefilePackage):
patch('09-hardening-build-fix-2.patch')
patch('10-remove-build-date.patch')
+ executables = ['^zip$']
+
+ @classmethod
+ def determine_version(cls, exe):
+ output = Executable(exe)('--version', output=str, error=str)
+ match = re.search(r'This is Zip (\S+)', output)
+ return match.group(1) if match else None
+
def url_for_version(self, version):
return 'http://downloads.sourceforge.net/infozip/zip{0}.tar.gz'.format(version.joined)