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

pym/portage/__init__.py

index 771e720d36d0802fa61b7d0e939a4910e27b9cd5..e2328edab92f99fe296cf18bcdb3384448deb632 100644 (file)
@@ -2086,16 +2086,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