Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 222883 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 app-admin/eselect-python
eselect-python.patch (text/plain), 2.12 KB, created by
Arfrever Frehtes Taifersar Arahesis (RETIRED)
on 2010-03-09 18:53:58 UTC
(
hide
)
Description:
Patch for app-admin/eselect-python
Filename:
MIME Type:
Creator:
Arfrever Frehtes Taifersar Arahesis (RETIRED)
Created:
2010-03-09 18:53:58 UTC
Size:
2.12 KB
patch
obsolete
>Index: configure.ac >=================================================================== >--- configure.ac (revision 305) >+++ configure.ac (working copy) >@@ -1,4 +1,4 @@ >-AC_INIT([eselect-python], [20091230]) >+AC_INIT([eselect-python], [20100312]) > > CFLAGS="${CFLAGS--march=native -O3 -pipe -fno-ident}" > LDFLAGS="${LDFLAGS--Wl,-O1,--as-needed,--gc-sections,--hash-style=gnu}" >@@ -28,6 +28,8 @@ > fi > CFLAGS="${old_CFLAGS}" > >+AC_CHECK_FUNCS(setenv) >+ > AC_SUBST([MKDIR]) > > # Create output files. >Index: python-wrapper.c >=================================================================== >--- python-wrapper.c (revision 305) >+++ python-wrapper.c (working copy) >@@ -1,4 +1,4 @@ >-/* Copyright 1999-2009 Gentoo Foundation >+/* Copyright 1999-2010 Gentoo Foundation > * Distributed under the terms of the GNU General Public License v2 > */ > #include <dirent.h> >@@ -165,9 +165,10 @@ > return ret; > } > >-int main(__attribute__((unused)) int argc, char** argv) >+int main(int argc, char** argv) > { > const char* EPYTHON = getenv("EPYTHON"); >+ int script_name_index = -1; > if (! valid_interpreter(EPYTHON)) > { > FILE* f = fopen(ENVD_CONFIG, "r"); >@@ -198,6 +199,24 @@ > return EXIT_ERROR; > } > >+ /* Set GENTOO_PYTHON_PROCESS_NAME environment variable, if a script with a Python shebang is probably being executed. >+ * argv[0] can be "python", when "#!/usr/bin/env python" shebang is used. */ >+ if (argc >= 2 && (argv[0][0] == '/' || strcmp(argv[0], "python") == 0) && (argv[1][0] == '/' || strncmp(argv[1], "./", 2) == 0)) >+ script_name_index = 1; >+ else if (argc >= 3 && argv[0][0] == '/' && argv[1][0] == '-' && (argv[2][0] == '/' || strncmp(argv[2], "./", 2) == 0)) >+ script_name_index = 2; >+ if (script_name_index > 0) >+ { >+ char* script_name = strrchr(argv[script_name_index], '/') + 1; >+#ifdef HAVE_SETENV >+ setenv("GENTOO_PYTHON_PROCESS_NAME", script_name, 1); >+#else >+ char* script_name_variable = malloc(sizeof(char) * (strlen("GENTOO_PYTHON_PROCESS_NAME=") + strlen(script_name))); >+ sprintf(script_name_variable, "GENTOO_PYTHON_PROCESS_NAME=%s", script_name); >+ putenv(script_name_variable); >+#endif >+ } >+ > const char* path = find_path(argv[0]); > if (path) > {
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