public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r15363 - in main/trunk: cnf pym/_emerge pym/portage/sets
@ 2010-02-17  5:30 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2010-02-17  5:30 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2010-02-17 05:30:40 +0000 (Wed, 17 Feb 2010)
New Revision: 15363

Modified:
   main/trunk/cnf/sets.conf
   main/trunk/pym/_emerge/depgraph.py
   main/trunk/pym/_emerge/main.py
   main/trunk/pym/portage/sets/dbapi.py
Log:
Add @rebuilt-binaries set which uses BUILD_TIME to pull in binary packages
that have a different build time from a currently installed package of the
exact same version.


Modified: main/trunk/cnf/sets.conf
===================================================================
--- main/trunk/cnf/sets.conf	2010-02-17 03:50:39 UTC (rev 15362)
+++ main/trunk/cnf/sets.conf	2010-02-17 05:30:40 UTC (rev 15363)
@@ -65,6 +65,12 @@
 world-candidate = False
 files = %(ROOT)slib/modules
 
+# Binary packages that have a different build time from a currently
+# installed package of the exact same version.
+[rebuilt-binaries]
+class = portage.sets.dbapi.RebuiltBinaries
+world-candidate = False
+
 # Installed packages for which the highest visible ebuild
 # version is lower than the currently installed version.
 [downgrade]

Modified: main/trunk/pym/_emerge/depgraph.py
===================================================================
--- main/trunk/pym/_emerge/depgraph.py	2010-02-17 03:50:39 UTC (rev 15362)
+++ main/trunk/pym/_emerge/depgraph.py	2010-02-17 05:30:40 UTC (rev 15363)
@@ -229,11 +229,6 @@
 				]["vartree"].dbapi._aux_cache_keys)
 			dbs.append((vardb, "installed", True, True, db_keys))
 			self._filtered_trees[myroot]["dbs"] = dbs
-			if "--usepkg" in depgraph._frozen_config.myopts:
-				depgraph._frozen_config._trees_orig[myroot
-					]["bintree"].populate(
-					"--getbinpkg" in depgraph._frozen_config.myopts,
-					"--getbinpkgonly" in depgraph._frozen_config.myopts)
 
 class depgraph(object):
 

Modified: main/trunk/pym/_emerge/main.py
===================================================================
--- main/trunk/pym/_emerge/main.py	2010-02-17 03:50:39 UTC (rev 15362)
+++ main/trunk/pym/_emerge/main.py	2010-02-17 05:30:40 UTC (rev 15363)
@@ -1208,10 +1208,43 @@
 		config_protect_check(trees)
 	check_procfs()
 
+	if "getbinpkg" in settings.features:
+		myopts["--getbinpkg"] = True
+
+	if "--getbinpkgonly" in myopts:
+		myopts["--getbinpkg"] = True
+
+	if "--getbinpkgonly" in myopts:
+		myopts["--usepkgonly"] = True
+
+	if "--getbinpkg" in myopts:
+		myopts["--usepkg"] = True
+
+	if "--usepkgonly" in myopts:
+		myopts["--usepkg"] = True
+
+	if "buildpkg" in settings.features or "--buildpkgonly" in myopts:
+		myopts["--buildpkg"] = True
+
+	if "--buildpkgonly" in myopts:
+		# --buildpkgonly will not merge anything, so
+		# it cancels all binary package options.
+		for opt in ("--getbinpkg", "--getbinpkgonly",
+			"--usepkg", "--usepkgonly"):
+			myopts.pop(opt, None)
+
 	for mytrees in trees.values():
 		mydb = mytrees["porttree"].dbapi
 		# Freeze the portdbapi for performance (memoize all xmatch results).
 		mydb.freeze()
+
+		if "--usepkg" in myopts:
+			# Populate the bintree with current --getbinpkg setting.
+			# This needs to happen before expand_set_arguments(), in case
+			# any sets use the bintree.
+			mytrees["bintree"].populate(
+				getbinpkgs="--getbinpkg" in myopts)
+
 	del mytrees, mydb
 
 	if "moo" in myfiles:
@@ -1270,42 +1303,12 @@
 		spinner.update = spinner.update_quiet
 		portage.util.noiselimit = -1
 
-	# Always create packages if FEATURES=buildpkg
-	# Imply --buildpkg if --buildpkgonly
-	if ("buildpkg" in settings.features) or ("--buildpkgonly" in myopts):
-		if "--buildpkg" not in myopts:
-			myopts["--buildpkg"] = True
-
-	# Always try and fetch binary packages if FEATURES=getbinpkg
-	if ("getbinpkg" in settings.features):
-		myopts["--getbinpkg"] = True
-
-	if "--buildpkgonly" in myopts:
-		# --buildpkgonly will not merge anything, so
-		# it cancels all binary package options.
-		for opt in ("--getbinpkg", "--getbinpkgonly",
-			"--usepkg", "--usepkgonly"):
-			myopts.pop(opt, None)
-
 	if "--fetch-all-uri" in myopts:
 		myopts["--fetchonly"] = True
 
 	if "--skipfirst" in myopts and "--resume" not in myopts:
 		myopts["--resume"] = True
 
-	if ("--getbinpkgonly" in myopts) and not ("--usepkgonly" in myopts):
-		myopts["--usepkgonly"] = True
-
-	if ("--getbinpkgonly" in myopts) and not ("--getbinpkg" in myopts):
-		myopts["--getbinpkg"] = True
-
-	if ("--getbinpkg" in myopts) and not ("--usepkg" in myopts):
-		myopts["--usepkg"] = True
-
-	# Also allow -K to apply --usepkg/-k
-	if ("--usepkgonly" in myopts) and not ("--usepkg" in myopts):
-		myopts["--usepkg"] = True
-
 	# Allow -p to remove --ask
 	if "--pretend" in myopts:
 		myopts.pop("--ask", None)

Modified: main/trunk/pym/portage/sets/dbapi.py
===================================================================
--- main/trunk/pym/portage/sets/dbapi.py	2010-02-17 03:50:39 UTC (rev 15362)
+++ main/trunk/pym/portage/sets/dbapi.py	2010-02-17 05:30:40 UTC (rev 15363)
@@ -21,7 +21,7 @@
 		"atoms to match all installed packages"
 	_filter = None
 
-	def __init__(self, vdbapi):
+	def __init__(self, vdbapi, **kwargs):
 		super(EverythingSet, self).__init__()
 		self._db = vdbapi
 
@@ -313,3 +313,26 @@
 		return AgeSet(vardb=trees["vartree"].dbapi, mode=mode, age=age)
 
 	singleBuilder = classmethod(singleBuilder)
+
+class RebuiltBinaries(EverythingSet):
+	_operations = ('merge',)
+	_aux_keys = ('BUILD_TIME',)
+
+	def __init__(self, vardb, bindb=None):
+		super(RebuiltBinaries, self).__init__(vardb, bindb=bindb)
+		self._bindb = bindb
+
+	def _filter(self, atom):
+		cpv = self._db.match(atom)[0]
+		inst_build_time, = self._db.aux_get(cpv, self._aux_keys)
+		try:
+			bin_build_time, = self._bindb.aux_get(cpv, self._aux_keys)
+		except KeyError:
+			return False
+		return inst_build_time != bin_build_time
+
+	def singleBuilder(cls, options, settings, trees):
+		return RebuiltBinaries(trees["vartree"].dbapi,
+			bindb=trees["bintree"].dbapi)
+
+	singleBuilder = classmethod(singleBuilder)




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

only message in thread, other threads:[~2010-02-17  5:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-17  5:30 [gentoo-commits] portage r15363 - in main/trunk: cnf pym/_emerge pym/portage/sets 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