From: Zac Medico Date: Sat, 5 Apr 2008 06:25:49 +0000 (-0000) Subject: In dbapi.move_ent(), never assume that any of the expected metadata X-Git-Tag: v2.2_pre6~252 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fbafde51eb38816ae6d199a204b36c2673c920c2;p=portage.git In dbapi.move_ent(), never assume that any of the expected metadata entries exist (PF, CATEGORY, or *.ebuild). svn path=/main/trunk/; revision=9712 --- diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index c51bfa4f9..f920c0fab 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -204,11 +204,13 @@ class binarytree(object): mydata = mytbz2.get_data() updated_items = update_dbentries([mylist], mydata) mydata.update(updated_items) + mydata["PF"] = mynewpkg + "\n" mydata["CATEGORY"] = mynewcat+"\n" if mynewpkg != myoldpkg: - mydata[mynewpkg+".ebuild"] = mydata[myoldpkg+".ebuild"] - del mydata[myoldpkg+".ebuild"] - mydata["PF"] = mynewpkg + "\n" + ebuild_data = mydata.get(myoldpkg+".ebuild") + if ebuild_data is not None: + mydata[mynewpkg+".ebuild"] = ebuild_data + del mydata[myoldpkg+".ebuild"] mytbz2.recompose_mem(portage.xpak.xpak_mem(mydata)) self.dbapi.cpv_remove(mycpv) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index a47bbb6d9..5a085f405 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -335,8 +335,7 @@ class vardbapi(dbapi): if e.errno != errno.ENOENT: raise del e - write_atomic(os.path.join(newpath, "PF"), new_pf+"\n") - + write_atomic(os.path.join(newpath, "PF"), new_pf+"\n") write_atomic(os.path.join(newpath, "CATEGORY"), mynewcat+"\n") fixdbentries([mylist], newpath) return moves