summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Harring <ferringb@gentoo.org>2005-09-24 02:56:18 +0000
committerBrian Harring <ferringb@gentoo.org>2005-09-24 02:56:18 +0000
commitf913d92453517074c89a4cd59004d72bee5ba7d8 (patch)
treea90682e9f841989d310bc523c8d81e33e37714a5
parent415435eafe50a9063f712d8b81a3b803644beda5 (diff)
downloadportage-f913d92453517074c89a4cd59004d72bee5ba7d8.tar.gz
portage-f913d92453517074c89a4cd59004d72bee5ba7d8.tar.bz2
portage-f913d92453517074c89a4cd59004d72bee5ba7d8.zip
cleanse_cache cleanups.
svn path=/main/branches/2.0/; revision=2021
-rw-r--r--ChangeLog6
-rwxr-xr-xbin/emerge47
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 <ferringb@gentoo.org> bin/emerge:
+ cleanse_cache cleanups, should kill off all remaining issues
+ in bug #100444 .
+
23 Sep 2005; Brian Harring <ferringb@gentoo.org> bin/repoman:
- bug 106544, glep31 enforcement checks.
+ bug #106544, glep31 enforcement checks.
20 Sep 2005; Brian Harring <ferringb@gentoo.org> 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 = []