From f913d92453517074c89a4cd59004d72bee5ba7d8 Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Sat, 24 Sep 2005 02:56:18 +0000 Subject: cleanse_cache cleanups. svn path=/main/branches/2.0/; revision=2021 --- ChangeLog | 6 +++++- bin/emerge | 47 +++++++++++++++++++++++++++++++---------------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index b153cbac8..7bc4c0ba2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,8 +7,12 @@ 2. /var/cache/edb/world is now /var/lib/portage/world. 3. /etc/portage/profile/virtuals is _USER_ configs only. + 23 Sep 2005; Brian Harring bin/emerge: + cleanse_cache cleanups, should kill off all remaining issues + in bug #100444 . + 23 Sep 2005; Brian Harring bin/repoman: - bug 106544, glep31 enforcement checks. + bug #106544, glep31 enforcement checks. 20 Sep 2005; Brian Harring pym/portage.py: Cleanup after python, remove module from sys.modules that was a failed import diff --git a/bin/emerge b/bin/emerge index ce45fe3b4..7f482eed7 100755 --- a/bin/emerge +++ b/bin/emerge @@ -2205,7 +2205,7 @@ def unmerge(unmerge_action, unmerge_files): #avoid cluttering the preview printout with stuff that isn't getting unmerged continue if not (pkgmap[x]["protected"] or pkgmap[x]["omitted"]) and (x in syslist): - print red("\a\n\n!!! '%s' is part of your system profile. '%s'" % (mykey)) + print red("\a\n\n!!! '%s' is part of your system profile." % mykey) print yellow("\a!!! Unmerging it may be damaging to your system.\n") if "--pretend" not in myopts and "--ask" not in myopts: global EMERGE_WARNING_DELAY @@ -2685,8 +2685,19 @@ if myaction in ["sync","rsync","metadata"] and (not "--help" in myopts): pass # we don't make overlay trees cache here, plus we don't trust portage.settings.categories porttree_root = portage.portdb.porttree_root - pdb = portage.portdbapi(porttree_root, portage.config(config_profile_path=portage.settings.profile_path[:], \ - config_incrementals=portage.settings.incrementals[:])) + conf = portage.config(config_profile_path=portage.settings.profile_path[:], \ + config_incrementals=portage.settings.incrementals[:]) + + conf["PORTDIR_OVERLAY"] = '' + conf.categories = portage.grabfile(os.path.join(porttree_root, "profiles", "categories")) + try: + i = conf.categories.index("virtual") + if i != -1: + conf.categories.remove(i) + except (ValueError, IndexError): + pass + + pdb = portage.portdbapi(porttree_root, conf) cp_list = pdb.cp_all() if len(cp_list) == 0: print "no metadata to transfer, exiting" @@ -2699,19 +2710,23 @@ if myaction in ["sync","rsync","metadata"] and (not "--help" in myopts): current=1 def cleanse_cache(pdb, cat, saves, porttree_root=porttree_root): - if len(saves): - d={} - for v in saves: - d[portage.catsplit(v)[1]] = True - for pv in pdb.auxdb[porttree_root][cat].keys(): - if pv not in d: - pdb.auxdb[porttree_root][cat].del_key(pv) - else: - try: - pdb.auxdb[porttree_root][cat].clear() - del pdb.auxdb[porttree_root][cat] - except KeyError: - pass + try: + if len(saves): + d={} + for v in saves: + d[portage.catsplit(v)[1]] = True + for pv in pdb.auxdb[porttree_root][cat].keys(): + if pv not in d: + pdb.auxdb[porttree_root][cat].del_key(pv) + else: + try: + pdb.auxdb[porttree_root][cat].clear() + del pdb.auxdb[porttree_root][cat] + except KeyError: + pass + except KeyError: + # stop breaking things, cleansing is minor. + pass savelist = [] catlist = [] -- cgit v1.2.3-1-g7c22