diff options
author | George Hartzell <hartzell@alerce.com> | 2016-07-22 17:55:57 -0400 |
---|---|---|
committer | George Hartzell <hartzell@alerce.com> | 2016-08-02 11:16:46 -0400 |
commit | 4d72e0fb9db7716f40899ff4df24e0487a9bf826 (patch) | |
tree | adc18be413140569a654ed444f146e51cf9244a4 | |
parent | a5a4525bed678b989130583a1ea54c63f36fdf56 (diff) | |
download | spack-4d72e0fb9db7716f40899ff4df24e0487a9bf826.tar.gz spack-4d72e0fb9db7716f40899ff4df24e0487a9bf826.tar.bz2 spack-4d72e0fb9db7716f40899ff4df24e0487a9bf826.tar.xz spack-4d72e0fb9db7716f40899ff4df24e0487a9bf826.zip |
Make the cpanm version a variant
Rather than hard-coding the verison of `cpanm` that's [optionally]
installed into the core, make it a variant with a default value of
'1.7042'.
Also discovered that `prefix + 'bin'` is the same as `prefix.bin`, so
embetter that bit of code.
-rw-r--r-- | var/spack/repos/builtin/packages/perl/package.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/perl/package.py b/var/spack/repos/builtin/packages/perl/package.py index 936b6caa81..97b28436c6 100644 --- a/var/spack/repos/builtin/packages/perl/package.py +++ b/var/spack/repos/builtin/packages/perl/package.py @@ -26,6 +26,8 @@ class Perl(Package): # things cleanly. variant('cpanm', default=True, description='Having cpanm in core simplifies adding modules.') + variant('cpanm_version', default='1.7042', + description='Version of cpanm to install into core if +cpanm.') def install(self, spec, prefix): configure = Executable('./Configure') @@ -35,8 +37,9 @@ class Perl(Package): make("install") if '+cpanm' in spec: - perl_exe = join_path(prefix, 'bin', 'perl') + perl_exe = join_path(prefix.bin, 'perl') perl = Executable(perl_exe) cpanm_installer = join_path(self.package_dir, 'cpanm-installer.pl') - cpanm_package_spec = 'App::cpanminus' + '@' + '1.7042' + cpanm_version = spec.variants['cpanm_version'].value + cpanm_package_spec = 'App::cpanminus' + '@' + cpanm_version perl(cpanm_installer, cpanm_package_spec) |