summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriarspider <iarspider@gmail.com>2021-02-16 16:57:55 +0100
committerGitHub <noreply@github.com>2021-02-16 16:57:55 +0100
commitcec1f9bd47d5c18d499d52c406aab4c6be924bd3 (patch)
tree84dbfe841b4aaa1c4ccde4b8d1e6c40e028b4d02
parentd2a0235d4b9f31a5af9f407ab2c2d1ee4c1a6e48 (diff)
downloadspack-cec1f9bd47d5c18d499d52c406aab4c6be924bd3.tar.gz
spack-cec1f9bd47d5c18d499d52c406aab4c6be924bd3.tar.bz2
spack-cec1f9bd47d5c18d499d52c406aab4c6be924bd3.tar.xz
spack-cec1f9bd47d5c18d499d52c406aab4c6be924bd3.zip
rsync: add support for external detection (#21669)
-rw-r--r--var/spack/repos/builtin/packages/rsync/package.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/rsync/package.py b/var/spack/repos/builtin/packages/rsync/package.py
index 67367a2a36..e223150cfe 100644
--- a/var/spack/repos/builtin/packages/rsync/package.py
+++ b/var/spack/repos/builtin/packages/rsync/package.py
@@ -4,6 +4,7 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
+import re
class Rsync(AutotoolsPackage):
@@ -25,5 +26,13 @@ class Rsync(AutotoolsPackage):
conflicts('%nvhpc')
+ executables = ['^rsync$']
+
+ @classmethod
+ def determine_version(cls, exe):
+ output = Executable(exe)('--version', output=str, error=str)
+ match = re.search(r'rsync\s+version\s+(\S+)', output)
+ return match.group(1) if match else None
+
def configure_args(self):
return ['--with-included-zlib=no']