public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r10125 - main/branches/2.1.2/bin
@ 2008-05-03  3:49 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-05-03  3:49 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-05-03 03:49:45 +0000 (Sat, 03 May 2008)
New Revision: 10125

Modified:
   main/branches/2.1.2/bin/emerge
Log:
Move --resume options handling to the beginning of action_build() so
that the current options are updated with the saved options as soon
as possible. (trunk r10122:10124)


Modified: main/branches/2.1.2/bin/emerge
===================================================================
--- main/branches/2.1.2/bin/emerge	2008-05-03 03:47:21 UTC (rev 10124)
+++ main/branches/2.1.2/bin/emerge	2008-05-03 03:49:45 UTC (rev 10125)
@@ -7585,6 +7585,41 @@
 
 def action_build(settings, trees, mtimedb,
 	myopts, myaction, myfiles, spinner):
+
+	# validate the state of the resume data
+	# so that we can make assumptions later.
+	for k in ("resume", "resume_backup"):
+		if k in mtimedb:
+			if "mergelist" in mtimedb[k]:
+				if not mtimedb[k]["mergelist"]:
+					del mtimedb[k]
+			else:
+				del mtimedb[k]
+
+	resume = False
+	if "--resume" in myopts and \
+		("resume" in mtimedb or
+		"resume_backup" in mtimedb):
+		resume = True
+		if "resume" not in mtimedb:
+			mtimedb["resume"] = mtimedb["resume_backup"]
+			del mtimedb["resume_backup"]
+			mtimedb.commit()
+		# "myopts" is a list for backward compatibility.
+		resume_opts = mtimedb["resume"].get("myopts", [])
+		if isinstance(resume_opts, list):
+			resume_opts = dict((k,True) for k in resume_opts)
+		for opt in ("--skipfirst", "--ask", "--tree"):
+			resume_opts.pop(opt, None)
+		myopts.update(resume_opts)
+		# Adjust config according to options of the command being resumed.
+		for myroot in trees:
+			mysettings =  trees[myroot]["vartree"].settings
+			mysettings.unlock()
+			adjust_config(myopts, mysettings)
+			mysettings.lock()
+			del myroot, mysettings
+
 	ldpath_mtimes = mtimedb["ldpath"]
 	favorites=[]
 	merge_count = 0
@@ -7635,65 +7670,15 @@
 			print darkgreen("These are the packages that would be %s, in order:") % action
 			print
 
-	# validate the state of the resume data
-	# so that we can make assumptions later.
-	for k in ("resume", "resume_backup"):
-		if k in mtimedb:
-			if "mergelist" in mtimedb[k]:
-				if not mtimedb[k]["mergelist"]:
-					del mtimedb[k]
-			else:
-				del mtimedb[k]
-
 	show_spinner = "--quiet" not in myopts and "--nodeps" not in myopts
 	if not show_spinner:
 		spinner.update = spinner.update_quiet
 
-	if "--resume" in myopts and \
-		("resume" in mtimedb or
-		"resume_backup" in mtimedb):
-		if "resume" not in mtimedb:
-			mtimedb["resume"] = mtimedb["resume_backup"]
-			del mtimedb["resume_backup"]
-			mtimedb.commit()
-
-		# Adjust config according to options of the command being resumed.
-		for myroot in trees:
-			mysettings =  trees[myroot]["vartree"].settings
-			mysettings.unlock()
-			adjust_config(myopts, mysettings)
-			mysettings.lock()
-			del myroot, mysettings
-
+	if resume:
 		favorites = mtimedb["resume"].get("favorites")
 		if not isinstance(favorites, list):
 			favorites = []
 
-		# "myopts" is a list for backward compatibility.
-		resume_opts = mtimedb["resume"].get("myopts", [])
-		if isinstance(resume_opts, list):
-			resume_opts = dict((k,True) for k in resume_opts)
-		for opt in ("--skipfirst", "--ask", "--tree"):
-			resume_opts.pop(opt, None)
-		myopts.update(resume_opts)
-
-		buildpkgonly = "--buildpkgonly" in myopts
-		pretend = "--pretend" in myopts
-		fetchonly = "--fetchonly" in myopts or "--fetch-all-uri" in myopts
-		ask = "--ask" in myopts
-		nodeps = "--nodeps" in myopts
-		tree = "--tree" in myopts
-		if nodeps and tree:
-			tree = False
-			del myopts["--tree"]
-			portage.writemsg(colorize("WARN", " * ") + \
-				"--tree is broken with --nodeps. Disabling...\n")
-		verbose = "--verbose" in myopts
-		quiet = "--quiet" in myopts
-		if pretend or fetchonly:
-			# make the mtimedb readonly
-			mtimedb.filename = None
-
 		if show_spinner:
 			print "Calculating dependencies  ",
 		myparams = create_depgraph_params(myopts, myaction)

-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-03  3:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-03  3:49 [gentoo-commits] portage r10125 - main/branches/2.1.2/bin Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox