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']