Blame SOURCES/00174-fix-for-usr-move.patch

6e8c2f
diff -up Python-2.7.3/Modules/getpath.c.fix-for-usr-move Python-2.7.3/Modules/getpath.c
6e8c2f
--- Python-2.7.3/Modules/getpath.c.fix-for-usr-move	2013-03-06 14:25:32.801828698 -0500
6e8c2f
+++ Python-2.7.3/Modules/getpath.c	2013-03-06 15:59:30.872443168 -0500
6e8c2f
@@ -510,6 +510,24 @@ calculate_path(void)
6e8c2f
        MAXPATHLEN bytes long.
6e8c2f
     */
6e8c2f
 
6e8c2f
+    /*
6e8c2f
+      Workaround for rhbz#817554, where an empty argv0_path erroneously
6e8c2f
+      locates "prefix" as "/lib[64]/python2.7" due to it finding
6e8c2f
+      "/lib[64]/python2.7/os.py" via the /lib -> /usr/lib symlink for
6e8c2f
+      https://fedoraproject.org/wiki/Features/UsrMove
6e8c2f
+    */
6e8c2f
+    if (argv0_path[0] == '\0' && 0 == strcmp(prog, "cmpi_swig")) {
6e8c2f
+        /*
6e8c2f
+          We have an empty argv0_path, presumably because prog aka
6e8c2f
+          Py_GetProgramName() was not found on $PATH.
6e8c2f
+
6e8c2f
+          Set argv0_path to "/usr/" so that search_for_prefix() and
6e8c2f
+          search_for_exec_prefix() don't erroneously pick up
6e8c2f
+          on /lib/ via the UsrMove symlink:
6e8c2f
+        */
6e8c2f
+        strcpy(argv0_path, "/usr/");
6e8c2f
+    }
6e8c2f
+
6e8c2f
     if (!(pfound = search_for_prefix(argv0_path, home))) {
6e8c2f
         if (!Py_FrozenFlag)
6e8c2f
             fprintf(stderr,