summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2015-02-19 13:57:48 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2015-02-19 13:57:48 -0800
commit521dac2e0a610450c965efc037a03b484dea7fa1 (patch)
tree646ef77abb8031e3014acbe7f9715b6aa97826dc
parent31ded0c7a2eb935d76c9b99030f3f9699cdace1f (diff)
parent245d5bea6388119571d58dc9592fa2303e1f7534 (diff)
Merge remote-tracking branch 'michaelld/better_fix_Python_shebanging'
-rw-r--r--cmake/Modules/GrPython.cmake3
-rw-r--r--gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake3
-rw-r--r--volk/cmake/GrPython.cmake2
3 files changed, 3 insertions, 5 deletions
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake
index 395faffa5a..06e061e212 100644
--- a/cmake/Modules/GrPython.cmake
+++ b/cmake/Modules/GrPython.cmake
@@ -185,7 +185,6 @@ function(GR_PYTHON_INSTALL)
COMPONENT ${GR_PYTHON_INSTALL_COMPONENT}
)
-
####################################################################
elseif(GR_PYTHON_INSTALL_PROGRAMS)
####################################################################
@@ -207,7 +206,7 @@ function(GR_PYTHON_INSTALL)
add_custom_command(
OUTPUT ${pyexefile} DEPENDS ${pyfile}
COMMAND ${PYTHON_EXECUTABLE} -c
- "open('${pyexefile}','w').write('\#!${pyexe_native}\\n'+open('${pyfile}').read())"
+ "import re; R=re.compile('^\#!.*$\\n',flags=re.MULTILINE); open('${pyexefile}','w').write('\#!${pyexe_native}\\n'+R.sub('',open('${pyfile}','r').read()))"
COMMENT "Shebangin ${pyfile_name}"
VERBATIM
)
diff --git a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake
index 395faffa5a..06e061e212 100644
--- a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake
+++ b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake
@@ -185,7 +185,6 @@ function(GR_PYTHON_INSTALL)
COMPONENT ${GR_PYTHON_INSTALL_COMPONENT}
)
-
####################################################################
elseif(GR_PYTHON_INSTALL_PROGRAMS)
####################################################################
@@ -207,7 +206,7 @@ function(GR_PYTHON_INSTALL)
add_custom_command(
OUTPUT ${pyexefile} DEPENDS ${pyfile}
COMMAND ${PYTHON_EXECUTABLE} -c
- "open('${pyexefile}','w').write('\#!${pyexe_native}\\n'+open('${pyfile}').read())"
+ "import re; R=re.compile('^\#!.*$\\n',flags=re.MULTILINE); open('${pyexefile}','w').write('\#!${pyexe_native}\\n'+R.sub('',open('${pyfile}','r').read()))"
COMMENT "Shebangin ${pyfile_name}"
VERBATIM
)
diff --git a/volk/cmake/GrPython.cmake b/volk/cmake/GrPython.cmake
index b7b561b7b3..c3e8176493 100644
--- a/volk/cmake/GrPython.cmake
+++ b/volk/cmake/GrPython.cmake
@@ -199,7 +199,7 @@ function(VOLK_PYTHON_INSTALL)
add_custom_command(
OUTPUT ${pyexefile} DEPENDS ${pyfile}
COMMAND ${PYTHON_EXECUTABLE} -c
- "open('${pyexefile}','w').write('\#!${pyexe_native}\\n'+open('${pyfile}').read())"
+ "import re; R=re.compile('^\#!.*$\\n',flags=re.MULTILINE); open('${pyexefile}','w').write('\#!${pyexe_native}\\n'+R.sub('',open('${pyfile}','r').read()))"
COMMENT "Shebangin ${pyfile_name}"
VERBATIM
)