summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSajid Ali <30510036+s-sajid-ali@users.noreply.github.com>2020-10-19 17:48:27 -0500
committerGitHub <noreply@github.com>2020-10-19 17:48:27 -0500
commit7052c650311db362f80a689032acc6712f2438be (patch)
treec418469962030f804ce251ee2993ff54d56aa94c
parent92bbc2e789a8361cab99b13a22ea4cdde0ea96f5 (diff)
downloadspack-7052c650311db362f80a689032acc6712f2438be.tar.gz
spack-7052c650311db362f80a689032acc6712f2438be.tar.bz2
spack-7052c650311db362f80a689032acc6712f2438be.tar.xz
spack-7052c650311db362f80a689032acc6712f2438be.zip
external find for cpio (#19379)
* external find for cpio * address reviewer comments
-rw-r--r--var/spack/repos/builtin/packages/cpio/package.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/cpio/package.py b/var/spack/repos/builtin/packages/cpio/package.py
index f454882457..d725ef3955 100644
--- a/var/spack/repos/builtin/packages/cpio/package.py
+++ b/var/spack/repos/builtin/packages/cpio/package.py
@@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
+import re
class Cpio(AutotoolsPackage, GNUMirrorPackage):
@@ -13,12 +14,20 @@ class Cpio(AutotoolsPackage, GNUMirrorPackage):
homepage = "https://www.gnu.org/software/cpio/"
gnu_mirror_path = "cpio/cpio-2.13.tar.gz"
+ executables = ['^cpio$']
+
version('2.13', sha256='e87470d9c984317f658567c03bfefb6b0c829ff17dbf6b0de48d71a4c8f3db88')
patch('https://src.fedoraproject.org/rpms/cpio/raw/dfe64c466d3ea2c8dfbd99700d9006f610064167/f/cpio-2.13-mutiple-definition.patch', sha256='d22633c368b8aedf4c08b23b6fbaa81a52404c8943ab04926404083ac10f1a4b', when='%gcc@10:')
build_directory = 'spack-build'
+ @classmethod
+ def determine_version(cls, exe):
+ output = Executable(exe)('--version', output=str, error=str)
+ match = re.search(r'\(GNU cpio\)\s+(\S+)', output)
+ return match.group(1) if match else None
+
def flag_handler(self, name, flags):
spec = self.spec