When restarting emerge, don't trust sys.argv[0] since eselect-python may
authorZac Medico <zmedico@gentoo.org>
Tue, 6 Oct 2009 05:45:55 +0000 (05:45 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 6 Oct 2009 05:45:55 +0000 (05:45 -0000)
modify it.

svn path=/main/trunk/; revision=14499

pym/_emerge/Scheduler.py

index b6f08307d4e137ec551b80ebd2eeca68cc331d94..e1eb2672ff82b05e7fd8c614b3f47812d66e2f38 100644 (file)
@@ -753,7 +753,9 @@ class Scheduler(PollScheduler):
                mtimedb["resume"]["mergelist"].remove(list(pkg))
                mtimedb.commit()
                portage.run_exitfuncs()
-               mynewargv = [sys.argv[0], "--resume"]
+               # Don't trust sys.argv[0] here because eselect-python may modify it.
+               emerge_binary = os.path.join(portage.const.PORTAGE_BIN_PATH, 'emerge')
+               mynewargv = [emerge_binary, "--resume"]
                resume_opts = self.myopts.copy()
                # For automatic resume, we need to prevent
                # any of bad_resume_opts from leaking in