summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Stubbs <jstubbs@gentoo.org>2005-04-12 13:50:59 +0000
committerJason Stubbs <jstubbs@gentoo.org>2005-04-12 13:50:59 +0000
commit3f6d8e06e960897293efd4aef28656a1bf41fff2 (patch)
tree32ecadd9f9d01d102c34d2a6dc8b86851f3bdb10
parentFixed emerge to always add packages to world unless --oneshot is specified. (diff)
downloadportage-cvs-3f6d8e06e960897293efd4aef28656a1bf41fff2.tar.gz
portage-cvs-3f6d8e06e960897293efd4aef28656a1bf41fff2.tar.bz2
portage-cvs-3f6d8e06e960897293efd4aef28656a1bf41fff2.zip
Added pusedict optimization. #85786
-rw-r--r--ChangeLog5
-rw-r--r--pym/portage.py26
2 files changed, 20 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index bfb900f..932dc55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,15 @@
# ChangeLog for Portage; the Gentoo Linux ports system
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Id: ChangeLog,v 1.796.2.89 2005/04/12 13:29:35 jstubbs Exp $
+# $Id: ChangeLog,v 1.796.2.90 2005/04/12 13:50:59 jstubbs Exp $
MAJOR CHANGES in 2.0.51:
1. /var/cache/edb/virtuals is no longer used at all. It's calculated now.
2. /var/cache/edb/world is now /var/lib/portage/world.
3. /etc/portage/profile/virtuals is _USER_ configs only.
+ 12 Apr 2005; Jason Stubbs <jstubbs@gentoo.org> pym/portage.py: Added
+ pusedict optimization. #85786
+
12 Apr 2005; Jason Stubbs <jstubbs@gentoo.org> bin/emerge: Fixed emerge to
always add packages to world unless --oneshot is specified.
diff --git a/pym/portage.py b/pym/portage.py
index b92cbe2..819b33c 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1,10 +1,10 @@
# portage.py -- core Portage functionality
# Copyright 1998-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage.py,v 1.524.2.52 2005/04/12 12:23:41 jstubbs Exp $
-cvs_id_string="$Id: portage.py,v 1.524.2.52 2005/04/12 12:23:41 jstubbs Exp $"[5:-2]
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage.py,v 1.524.2.53 2005/04/12 13:50:59 jstubbs Exp $
+cvs_id_string="$Id: portage.py,v 1.524.2.53 2005/04/12 13:50:59 jstubbs Exp $"[5:-2]
-VERSION="$Revision: 1.524.2.52 $"[11:-2] + "-cvs"
+VERSION="$Revision: 1.524.2.53 $"[11:-2] + "-cvs"
# ===========================================================================
# START OF IMPORTS -- START OF IMPORTS -- START OF IMPORTS -- START OF IMPORT
@@ -1047,8 +1047,13 @@ class config:
else:
locations = [self["PORTDIR"] + "/profiles", USER_CONFIG_PATH]
- # Never set anything in this. It's for non-originals.
- self.pusedict=grabdict_package(USER_CONFIG_PATH+"/package.use")
+ pusedict=grabdict_package(USER_CONFIG_PATH+"/package.use")
+ self.pusedict = {}
+ for key in pusedict.keys():
+ cp = dep_getkey(key)
+ if not self.pusedict.has_key(cp):
+ self.pusedict[cp] = {}
+ self.pusedict[cp][key] = pusedict[key]
#package.keywords
pkgdict=grabdict_package(USER_CONFIG_PATH+"/package.keywords")
@@ -1256,11 +1261,12 @@ class config:
def setcpv(self,mycpv,use_cache=1):
self.modifying()
self.mycpv = mycpv
- self.pusekey = best_match_to_list(self.mycpv, self.pusedict.keys())
- if self.pusekey:
- newpuse = string.join(self.pusedict[self.pusekey])
- else:
- newpuse = ""
+ cp = dep_getkey(mycpv)
+ newpuse = ""
+ if self.pusedict.has_key(cp):
+ self.pusekey = best_match_to_list(self.mycpv, self.pusedict[cp].keys())
+ if self.pusekey:
+ newpuse = string.join(self.pusedict[cp][self.pusekey])
if newpuse == self.puse:
return
self.puse = newpuse