From 1724ff565877eb36267d6947c0d900609b1bd198 Mon Sep 17 00:00:00 2001 From: "Gregory L. Lee" Date: Wed, 15 Jun 2016 20:21:02 -0700 Subject: do not create shebang.bak file --- lib/spack/spack/hooks/sbang.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/spack/spack/hooks/sbang.py b/lib/spack/spack/hooks/sbang.py index 83d67ea225..601c2420b5 100644 --- a/lib/spack/spack/hooks/sbang.py +++ b/lib/spack/spack/hooks/sbang.py @@ -34,6 +34,7 @@ import spack.modules # here, as it is the shortest I could find on a modern OS. shebang_limit = 127 + def shebang_too_long(path): """Detects whether a file has a shebang line that is too long.""" with open(path, 'r') as script: @@ -57,16 +58,10 @@ def filter_shebang(path): if original.startswith(new_sbang_line): return - backup = path + ".shebang.bak" - os.rename(path, backup) - with open(path, 'w') as new_file: new_file.write(new_sbang_line) new_file.write(original) - copy_mode(backup, path) - unset_executable_mode(backup) - tty.warn("Patched overly long shebang in %s" % path) -- cgit v1.2.3-60-g2f50 From d4df4375d561dfd7d31069e2801a9405ab06be63 Mon Sep 17 00:00:00 2001 From: "Gregory L. Lee" Date: Wed, 15 Jun 2016 20:32:08 -0700 Subject: removed unused import per flake8 report --- lib/spack/spack/hooks/sbang.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/spack/spack/hooks/sbang.py b/lib/spack/spack/hooks/sbang.py index 601c2420b5..cb0ad42b14 100644 --- a/lib/spack/spack/hooks/sbang.py +++ b/lib/spack/spack/hooks/sbang.py @@ -24,7 +24,6 @@ ############################################################################## import os -from llnl.util.filesystem import * import llnl.util.tty as tty import spack -- cgit v1.2.3-60-g2f50