Bug #262211 - Make vardbapi.aux_get() translate empty SLOT to 0 since other
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 23:49:03 +0000 (23:49 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 23:49:03 +0000 (23:49 -0000)
code expects non-empty SLOT (for generation package slot atoms).

svn path=/main/trunk/; revision=13060

pym/portage/dbapi/vartree.py

index 48a2a16391dcef780b84a9f8c5acb47cde00cb40..9f6a72b07d9f7eff460173152ce0c21bf6155b51 100644 (file)
@@ -1179,6 +1179,10 @@ class vardbapi(dbapi):
                                        cache_data[aux_key] = mydata[aux_key]
                                self._aux_cache["packages"][mycpv] = (mydir_mtime, cache_data)
                                self._aux_cache["modified"].add(mycpv)
+               if not mydata['SLOT']:
+                       # Empty slot triggers InvalidAtom exceptions when generating slot
+                       # atoms for packages, so translate it to '0' here.
+                       mydata['SLOT'] = '0'
                return [mydata[x] for x in wants]
 
        def _aux_get(self, mycpv, wants, st=None):