diff options
author | Glenn Johnson <glenn-johnson@uiowa.edu> | 2016-06-06 17:06:50 -0500 |
---|---|---|
committer | Glenn Johnson <glenn-johnson@uiowa.edu> | 2016-06-16 23:08:55 -0500 |
commit | 7da405e630b6b0e65f4ec8d551a4ed988f32ac74 (patch) | |
tree | 51169ea223fd782b1b8bf1eec17eca118d799569 | |
parent | 7213b123245895ab3fe588c7b5656b68f648b99d (diff) | |
download | spack-7da405e630b6b0e65f4ec8d551a4ed988f32ac74.tar.gz spack-7da405e630b6b0e65f4ec8d551a4ed988f32ac74.tar.bz2 spack-7da405e630b6b0e65f4ec8d551a4ed988f32ac74.tar.xz spack-7da405e630b6b0e65f4ec8d551a4ed988f32ac74.zip |
Add validator for bioconductor packages
This commit adds a validator function to make sure the versions of R and
bioconductor are in sync.
-rw-r--r-- | var/spack/repos/builtin/packages/r-BiocGenerics/package.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/r-BiocGenerics/package.py b/var/spack/repos/builtin/packages/r-BiocGenerics/package.py index ffd578a42c..5a6ce72a4b 100644 --- a/var/spack/repos/builtin/packages/r-BiocGenerics/package.py +++ b/var/spack/repos/builtin/packages/r-BiocGenerics/package.py @@ -38,6 +38,19 @@ class RBiocgenerics(Package): extends('R') + def validate(self, spec): + """ + Checks that the version of R is appropriate for the Bioconductor + version. + """ + if spec.satisfies('@bioc-3.3'): + if not spec.satisfies('^R@3.3.0:3.3.9'): + raise InstallError('Must use R-3.3 for Bioconductor-3.3') + elif spec.satisfies('@bioc-3.2'): + if not spec.satisfies('^R@3.2.0:3.2.9'): + raise InstallError('Must use R-3.2 for Bioconductor-3.2') + def install(self, spec, prefix): + self.validate(spec) R('CMD', 'INSTALL', '--library=%s' % self.module.r_lib_dir, '%s' % self.stage.source_path) |