Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Zac Medico (zmedico)" <zmedico@g.o>
Subject: portage r12388 - main/trunk/pym/_emerge
Date: Wed, 07 Jan 2009 22:37:07 +0000
Author: zmedico
Date: 2009-01-07 22:37:06 +0000 (Wed, 07 Jan 2009)
New Revision: 12388

Modified:
   main/trunk/pym/_emerge/__init__.py
Log:
Bug #254114 - Fix ValueError triggered by missing COUNTER. Also, fix broken
mtime check inside FakeVartree._sync().


Modified: main/trunk/pym/_emerge/__init__.py
===================================================================
--- main/trunk/pym/_emerge/__init__.py	2009-01-07 01:30:06 UTC (rev 12387)
+++ main/trunk/pym/_emerge/__init__.py	2009-01-07 22:37:06 UTC (rev 12388)
@@ -1047,6 +1047,9 @@
 		self.root = real_vartree.root
 		self.settings = real_vartree.settings
 		mykeys = list(real_vartree.dbapi._aux_cache_keys)
+		if "_mtime_" not in mykeys:
+			mykeys.append("_mtime_")
+		self._db_keys = mykeys
 		self._pkg_cache = pkg_cache
 		self.dbapi = PackageVirtualDbapi(real_vartree.settings)
 		vdb_path = os.path.join(self.root, portage.VDB_PATH)
@@ -1185,8 +1188,12 @@
 			pkg = pkg_vardb.get(pkg_hash_key)
 			if pkg is not None:
 				counter, mtime = real_vardb.aux_get(cpv, validation_keys)
+				try:
+					counter = long(counter)
+				except ValueError:
+					counter = 0
 
-				if counter != pkg.metadata["COUNTER"] or \
+				if counter != pkg.counter or \
 					mtime != pkg.mtime:
 					pkg_vardb.cpv_remove(pkg)
 					aux_get_history.discard(pkg.cpv)
@@ -1208,11 +1215,18 @@
 	def _pkg(self, cpv):
 		root_config = self._root_config
 		real_vardb = root_config.trees["vartree"].dbapi
-		db_keys = list(real_vardb._aux_cache_keys)
 		pkg = Package(cpv=cpv, installed=True,
-			metadata=izip(db_keys, real_vardb.aux_get(cpv, db_keys)),
+			metadata=izip(self._db_keys,
+			real_vardb.aux_get(cpv, self._db_keys)),
 			root_config=root_config,
 			type_name="installed")
+
+		try:
+			mycounter = long(pkg.metadata["COUNTER"])
+		except ValueError:
+			mycounter = 0
+			pkg.metadata["COUNTER"] = str(mycounter)
+
 		return pkg
 
 def grab_global_updates(portdir):
@@ -1559,7 +1573,7 @@
 	def _set_counter(self, k, v):
 		if isinstance(v, basestring):
 			try:
-				v = int(v.strip())
+				v = long(v.strip())
 			except ValueError:
 				v = 0
 		self._pkg.counter = v



Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in games-strategy/glest/files: glest-2.0.1-home.patch
Next by thread:
portage r12389 - main/trunk/bin
Previous by date:
gentoo-x86 commit in games-strategy/glest/files: glest-2.0.1-home.patch
Next by date:
portage r12389 - main/trunk/bin


Updated Jun 07, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.