Make the argument hash in config.setcpv() a little stronger. (trunk r13232) v2.1.6.11
authorZac Medico <zmedico@gentoo.org>
Fri, 27 Mar 2009 09:40:37 +0000 (09:40 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 27 Mar 2009 09:40:37 +0000 (09:40 -0000)
svn path=/main/branches/2.1.6/; revision=13233

pym/portage/__init__.py

index b209fe65765a387b8b36f0ae1870a7e06422d555..5df90ab7ec95a43c8d90fe3b1686332670bafb16 100644 (file)
@@ -2076,16 +2076,18 @@ class config(object):
 
                self.modifying()
 
-               args_hash = (id(mycpv), id(mydb))
-               if args_hash == self._setcpv_args_hash:
-                       return
-               self._setcpv_args_hash = args_hash
-
                pkg = None
                if not isinstance(mycpv, basestring):
                        pkg = mycpv
                        mycpv = pkg.cpv
                        mydb = pkg.metadata
+                       args_hash = (mycpv, id(pkg))
+               else:
+                       args_hash = (mycpv, id(mydb))
+
+               if args_hash == self._setcpv_args_hash:
+                       return
+               self._setcpv_args_hash = args_hash
 
                has_changed = False
                self.mycpv = mycpv