Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 222887 Details for
Bug 286191
app-eselect/eselect-python: python-wrapper sometimes breaks init scripts using start-stop-daemon with Python scripts
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for python.eclass
python.eclass.patch (text/plain), 1.48 KB, created by
Arfrever Frehtes Taifersar Arahesis (RETIRED)
on 2010-03-09 19:00:47 UTC
(
hide
)
Description:
Patch for python.eclass
Filename:
MIME Type:
Creator:
Arfrever Frehtes Taifersar Arahesis (RETIRED)
Created:
2010-03-09 19:00:47 UTC
Size:
1.48 KB
patch
obsolete
>--- python.eclass >+++ python.eclass >@@ -774,6 +774,7 @@ > import sys > > EPYTHON_re = re.compile(r"^python(\d+\.\d+)$") >+python_shebang_re = re.compile(r"^#!.*python") > > EOF > if [[ "$?" != "0" ]]; then >@@ -841,13 +842,27 @@ > fi > cat << EOF >> "${file}" > >-os.environ["PYTHON_SCRIPT_NAME"] = sys.argv[0] >-target_executable = "%s-%s" % (os.path.realpath(sys.argv[0]), PYTHON_ABI) >-if not os.path.exists(target_executable): >- sys.stderr.write("'%s' does not exist\n" % target_executable) >+wrapper_script_path = os.path.realpath(sys.argv[0]) >+target_executable_path = "%s-%s" % (wrapper_script_path, PYTHON_ABI) >+os.environ["GENTOO_PYTHON_WRAPPER_SCRIPT_PATH"] = sys.argv[0] >+os.environ["GENTOO_PYTHON_TARGET_SCRIPT_PATH"] = target_executable_path >+if not os.path.exists(target_executable_path): >+ sys.stderr.write("'%s' does not exist\n" % target_executable_path) > sys.exit(1) > >-os.execv(target_executable, sys.argv) >+target_executable = open(target_executable_path, "rb") >+target_executable_first_line = target_executable.readline() >+if not isinstance(target_executable_first_line, str): >+ # Python 3 >+ target_executable_first_line = target_executable_first_line.decode("utf_8", "replace") >+ >+python_shebang_matched = python_shebang_re.match(target_executable_first_line) >+target_executable.close() >+ >+if python_shebang_matched: >+ os.execv(wrapper_script_path, sys.argv) >+else: >+ os.execv(target_executable_path, sys.argv) > EOF > if [[ "$?" != "0" ]]; then > die "${FUNCNAME}(): Generation of '$1' failed"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 286191
:
205104
|
213083
|
213125
|
220639
|
220641
|
221107
|
222473
|
222883
|
222885
|
222887
|
223211
|
223213