From: Zac Medico Date: Sun, 19 Feb 2006 23:52:50 +0000 (-0000) Subject: Remove temporary file usage from fixpackages update_ents routine. X-Git-Tag: v2.1_pre5_2760~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=076d6bab41d0282a2ec8eca8fe73bed9d983f151;p=portage.git Remove temporary file usage from fixpackages update_ents routine. svn path=/main/trunk/; revision=2752 --- 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