From a8c810018c46c7ee12e9bb479ef9bff8b9c6def5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 23 Sep 2006 06:56:16 +0000 Subject: Move PORTAGE_LOG_FILE initialization from doebuild to prepare_build_dirs. svn path=/main/trunk/; revision=4510 --- pym/portage.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index b8f984f5c..9486d61c2 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -2792,6 +2792,18 @@ def prepare_build_dirs(myroot, mysettings, cleanup): writemsg("!!! Disabling logging.\n", noiselevel=-1) while "PORT_LOGDIR" in mysettings: del mysettings["PORT_LOGDIR"] + if "PORT_LOGDIR" in mysettings: + logid_path = os.path.join(mysettings["PORTAGE_BUILDDIR"], ".logid") + if not os.path.exists(logid_path): + f = open(logid_path, "w") + f.close() + del f + logid_time = time.strftime("%Y%m%d-%H%M%S", + time.gmtime(os.stat(logid_path).st_mtime)) + mysettings["PORTAGE_LOG_FILE"] = os.path.join( + mysettings["PORT_LOGDIR"], "%s:%s:%s.log" % \ + (mysettings["CATEGORY"], mysettings["PF"], logid_time)) + del logid_path, logid_time def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, fetchonly=0, cleanup=0, dbkey=None, use_cache=1, fetchall=0, tree=None, @@ -2868,24 +2880,12 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0, mystatus = prepare_build_dirs(myroot, mysettings, cleanup) if mystatus: return mystatus + # PORTAGE_LOG_FILE is set above by the prepare_build_dirs() call. + logfile = mysettings.get("PORTAGE_LOG_FILE", None) if mydo == "unmerge": return unmerge(mysettings["CATEGORY"], mysettings["PF"], myroot, mysettings, vartree=vartree) - if "PORT_LOGDIR" in mysettings and builddir_lock: - logid_path = os.path.join(mysettings["PORTAGE_BUILDDIR"], ".logid") - if not os.path.exists(logid_path): - f = open(logid_path, "w") - f.close() - del f - logid_time = time.strftime("%Y%m%d-%H%M%S", - time.gmtime(os.stat(logid_path).st_mtime)) - logfile = os.path.join( - mysettings["PORT_LOGDIR"], "%s:%s:%s.log" % \ - (mysettings["CATEGORY"], mysettings["PF"], logid_time)) - mysettings["PORTAGE_LOG_FILE"] = logfile - del logid_path, logid_time - # if any of these are being called, handle them -- running them out of # the sandbox -- and stop now. if mydo in ["clean","cleanrm"]: -- cgit v1.2.3-1-g7c22