Skip to content

Commit

Permalink
*: no loop over files with filter_file(*files) (spack#46420)
Browse files Browse the repository at this point in the history
* *: no loop over files with filter_file(*files)
* scalpel: revert
  • Loading branch information
wdconinc authored Sep 22, 2024
1 parent f73f0f8 commit c118c77
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 18 deletions.
6 changes: 2 additions & 4 deletions var/spack/repos/builtin/packages/augustus/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,11 @@ def filter_sbang(self):
pattern = "^#!.*"
repl = f"#!{self.spec['perl'].command.path}"
files = glob.glob("*.pl")
for file in files:
filter_file(pattern, repl, *files, backup=False)
filter_file(pattern, repl, *files, backup=False)

repl = f"#!{self.spec['python'].command.path}"
files = glob.glob("*.py")
for file in files:
filter_file(pattern, repl, *files, backup=False)
filter_file(pattern, repl, *files, backup=False)

def setup_build_environment(self, env):
htslib = self.spec["htslib"].prefix
Expand Down
3 changes: 1 addition & 2 deletions var/spack/repos/builtin/packages/braker/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ def filter_sbang(self):
pattern = "^#!.*/usr/bin/env perl"
repl = "#!{0}".format(self.spec["perl"].command.path)
files = glob.iglob("*.pl")
for file in files:
filter_file(pattern, repl, *files, backup=False)
filter_file(pattern, repl, *files, backup=False)

def setup_run_environment(self, env):
env.prepend_path("PERL5LIB", self.prefix.lib)
3 changes: 1 addition & 2 deletions var/spack/repos/builtin/packages/fplo/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,4 @@ def perl_interpreter(self):
pattern = "^#!.*/usr/bin/perl"
repl = "#!{0}".format(self.spec["perl"].command.path)
files = ["fconv2", "fconvdens2", "fdowngrad.pl", "fout2in", "grBhfat", "grpop"]
for file in files:
filter_file(pattern, repl, *files, backup=False)
filter_file(pattern, repl, *files, backup=False)
3 changes: 1 addition & 2 deletions var/spack/repos/builtin/packages/genemark-et/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ def filter_sbang(self):
pattern = "^#!.*/usr/bin/perl"
repl = "#!{0}".format(self.spec["perl"].command.path)
files = glob.iglob("*.pl")
for file in files:
filter_file(pattern, repl, *files, backup=False)
filter_file(pattern, repl, *files, backup=False)

def setup_run_environment(self, env):
env.prepend_path("PERL5LIB", self.prefix.lib)
12 changes: 4 additions & 8 deletions var/spack/repos/builtin/packages/hisat2/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,20 @@ def filter_sbang(self):
pattern = "^#!.*/usr/bin/env python"
repl = f"#!{self.spec['python'].command.path}"
files = ["hisat2-build", "hisat2-inspect"]
for file in files:
filter_file(pattern, repl, *files, backup=False)
filter_file(pattern, repl, *files, backup=False)

pattern = "^#!.*/usr/bin/env perl"
repl = f"#!{self.spec['perl'].command.path}"
files = ["hisat2"]
for file in files:
filter_file(pattern, repl, *files, backup=False)
filter_file(pattern, repl, *files, backup=False)

pattern = "^#!.*/usr/bin/env python3"
repl = f"#!{self.spec['python'].command.path}"
files = glob.glob("*.py")
for file in files:
filter_file(pattern, repl, *files, backup=False)
filter_file(pattern, repl, *files, backup=False)

with working_dir(self.prefix.scripts):
pattern = "^#!.*/usr/bin/perl"
repl = f"#!{self.spec['perl'].command.path}"
files = glob.glob("*.pl")
for file in files:
filter_file(pattern, repl, *files, backup=False)
filter_file(pattern, repl, *files, backup=False)

0 comments on commit c118c77

Please sign in to comment.