[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/03: cmake: In Python files only, remove
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/03: cmake: In Python files only, remove all shebanging (anywhere) then prepend that used for GNU Radio. |
Date: |
Thu, 19 Feb 2015 22:30:46 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 245d5bea6388119571d58dc9592fa2303e1f7534
Author: Michael Dickens <address@hidden>
Date: Thu Feb 19 15:07:35 2015 -0500
cmake: In Python files only, remove all shebanging (anywhere) then prepend
that used for GNU Radio.
---
cmake/Modules/GrPython.cmake | 3 +--
gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake | 3 +--
volk/cmake/GrPython.cmake | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake
index 395faff..06e061e 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 395faff..06e061e 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 b7b561b..c3e8176 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
)