Make sure that each new build attempt gets it's own unique log file for bug #135856.
authorZac Medico <zmedico@gentoo.org>
Wed, 7 Jun 2006 10:32:28 +0000 (10:32 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 7 Jun 2006 10:32:28 +0000 (10:32 -0000)
svn path=/main/trunk/; revision=3464

pym/portage.py

index 3ac06617a2822a0d51b026687fe3384d25fbf2d2..8dc6d4c0ccb85ce60d6c822257423604dbe13dc5 100644 (file)
@@ -2860,6 +2860,16 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                                "%s-%s.log" % (str(vartree.dbapi.get_counter_tick_core("/")),
                                mysettings["PF"]))
 
+       if logfile and mydo in actionmap_deps and "PORTAGE_CALLER" in os.environ \
+               and os.environ["PORTAGE_CALLER"] == "emerge":
+               # Increment the counter so that each new build attempt gets it's
+               # own unique log file (portage uses the counter for nothing more than
+               # log handling, though it can be used to determine merge order).
+               while os.path.exists(logfile):
+                       logfile = os.path.join(mysettings["PORT_LOGDIR"],
+                               "%s-%s.log" % (str(vartree.dbapi.counter_tick("/") + 1),
+                               mysettings["PF"]))
+
        # if any of these are being called, handle them -- running them out of the sandbox -- and stop now.
        if mydo in ["clean","cleanrm"]:
                return spawn(EBUILD_SH_BINARY+" clean",mysettings,debug=debug,free=1,logfile=None)