From 2a7d1d6d4e4fc14f20f16481c5ac9c8b11cf5ff7 Mon Sep 17 00:00:00 2001 From: lxnay Date: Tue, 28 Oct 2008 11:29:18 +0000 Subject: [PATCH] Equo/text_rescue: - when resurrecting db, verify that atom from clientdb has been retrieved correctly git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@2580 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- client/text_rescue.py | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/client/text_rescue.py b/client/text_rescue.py index 63fb4f60a..199b26a1d 100644 --- a/client/text_rescue.py +++ b/client/text_rescue.py @@ -456,22 +456,25 @@ def database(options): if x[0] not in installedCounters: # check if the package is in toBeAdded if (toBeAdded): - atomkey = Equo.entropyTools.dep_getkey(Equo.clientDbconn.retrieveAtom(x[1])) - atomslot = Equo.clientDbconn.retrieveSlot(x[1]) + atom = Equo.clientDbconn.retrieveAtom(x[1]) add = True - for pkgdata in toBeAdded: - try: - addslot = Spm.get_installed_package_slot(pkgdata[0]) - except KeyError: - continue - addkey = Equo.entropyTools.dep_getkey(pkgdata[0]) - # workaround for ebuilds not having slot - if addslot == None: - addslot = '0' - if (atomkey == addkey) and (str(atomslot) == str(addslot)): - # do not add to toBeRemoved - add = False - break + if atom: + atomkey = Equo.entropyTools.dep_getkey(atom) + atomslot = Equo.clientDbconn.retrieveSlot(x[1]) + add = True + for pkgdata in toBeAdded: + try: + addslot = Spm.get_installed_package_slot(pkgdata[0]) + except KeyError: + continue + addkey = Equo.entropyTools.dep_getkey(pkgdata[0]) + # workaround for ebuilds not having slot + if addslot == None: + addslot = '0' + if (atomkey == addkey) and (str(atomslot) == str(addslot)): + # do not add to toBeRemoved + add = False + break if add: toBeRemoved.add(x[1]) else: