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

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