summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-02-19 23:52:50 +0000
committerZac Medico <zmedico@gentoo.org>2006-02-19 23:52:50 +0000
commit076d6bab41d0282a2ec8eca8fe73bed9d983f151 (patch)
tree44ab0275405b82b2c028bd23541b5f4832b1799d
parentfb4c9c58095c0a78cf065c2b59ba75e374667a1f (diff)
downloadportage-076d6bab41d0282a2ec8eca8fe73bed9d983f151.tar.gz
portage-076d6bab41d0282a2ec8eca8fe73bed9d983f151.tar.bz2
portage-076d6bab41d0282a2ec8eca8fe73bed9d983f151.zip
Remove temporary file usage from fixpackages update_ents routine.
svn path=/main/trunk/; revision=2752
-rw-r--r--pym/portage.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 8b3f289cd..e0ed563f8 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -106,7 +106,7 @@ try:
from portage_checksum import perform_md5,perform_checksum,prelink_capable
import eclass_cache
from portage_localization import _
- from portage_update import fixdbentries
+ from portage_update import fixdbentries, update_dbentries
# Need these functions directly in portage namespace to not break every external tool in existence
from portage_versions import ververify,vercmp,catsplit,catpkgsplit,pkgsplit,pkgcmp
@@ -5339,8 +5339,7 @@ class binarytree(packagetree):
mytbz2.recompose(mytmpdir, cleanup=1)
return 1
- def update_ents(self,mybiglist,mytmpdir):
- #XXX mytmpdir=settings["PORTAGE_TMPDIR"]+"/tbz2"
+ def update_ents(self, update_iter):
if not self.populated:
self.populate()
@@ -5351,12 +5350,12 @@ class binarytree(packagetree):
continue
#print ">>> Updating binary data:",mycpv
writemsg("*")
- mytbz2=xpak.tbz2(tbz2path)
- mytbz2.decompose(mytmpdir,cleanup=1)
- if fixdbentries(mybiglist, mytmpdir):
- mytbz2.recompose(mytmpdir,cleanup=1)
- else:
- mytbz2.cleanup(mytmpdir)
+ mytbz2 = xpak.tbz2(tbz2path)
+ mydata = mytbz2.get_data()
+ updated_items = update_dbentries(update_iter, mydata)
+ if len(updated_items) > 0:
+ mydata.update(updated_items)
+ mytbz2.recompose_mem(xpak.xpak_mem(mydata))
return 1
def populate(self, getbinpkgs=0,getbinpkgsonly=0):
@@ -6944,7 +6943,7 @@ def global_updates():
# We gotta do the brute force updates for these now.
if settings["PORTAGE_CALLER"] == "fixpackages" or \
"fixpackages" in features:
- db["/"]["bintree"].update_ents(myupd, os.path.join(settings["PORTAGE_TMPDIR"], "tbz2"))
+ db["/"]["bintree"].update_ents(myupd)
else:
do_upgrade_packagesmessage = 1