diff options
author | George Hartzell <hartzell@alerce.com> | 2017-10-25 03:15:10 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2017-10-25 12:15:10 +0200 |
commit | 98c06eae92d9523a6ea39a69965bd05046b50999 (patch) | |
tree | d51e7f87acc6be21b1d9f4070d1021d93a89ed13 /var | |
parent | 3265008ad2dc2264e340a0e15bf6c9984d0c2f94 (diff) | |
download | spack-98c06eae92d9523a6ea39a69965bd05046b50999.tar.gz spack-98c06eae92d9523a6ea39a69965bd05046b50999.tar.bz2 spack-98c06eae92d9523a6ea39a69965bd05046b50999.tar.xz spack-98c06eae92d9523a6ea39a69965bd05046b50999.zip |
Parallel fix sbangs (#5910)
* Added procedure to edit sbangs of the parallel perl scripts.
* Specify the types of perl dependency
Adding ", type=('build', 'run')" to the dependency declaration to clarify when and how perl is required
* flake8 cleanup
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/parallel/package.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/parallel/package.py b/var/spack/repos/builtin/packages/parallel/package.py index 81e4d51d25..ebbd629508 100644 --- a/var/spack/repos/builtin/packages/parallel/package.py +++ b/var/spack/repos/builtin/packages/parallel/package.py @@ -42,3 +42,19 @@ class Parallel(AutotoolsPackage): def check(self): # The Makefile has a 'test' target, but it does not work make('check') + + depends_on('perl', type=('build', 'run')) + + @run_before('install') + def filter_sbang(self): + """Run before install so that the standard Spack sbang install hook + can fix up the path to the perl binary. + """ + perl = self.spec['perl'].command + kwargs = {'ignore_absent': False, 'backup': False, 'string': False} + + with working_dir('src'): + match = '^#!/usr/bin/env perl|^#!/usr/bin/perl.*' + substitute = "#!{perl}".format(perl=perl) + files = ['parallel', 'niceload', 'parcat', 'sql', ] + filter_file(match, substitute, *files, **kwargs) |