diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-04-05 06:25:49 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-04-05 06:25:49 +0000 |
commit | fbafde51eb38816ae6d199a204b36c2673c920c2 (patch) | |
tree | 6953113d6948660940449792d7e3b1938e555908 | |
parent | 83ac43eb75f201ccf0cee350da1bd1e7df8f902a (diff) | |
download | portage-fbafde51eb38816ae6d199a204b36c2673c920c2.tar.gz portage-fbafde51eb38816ae6d199a204b36c2673c920c2.tar.bz2 portage-fbafde51eb38816ae6d199a204b36c2673c920c2.zip |
In dbapi.move_ent(), never assume that any of the expected metadata
entries exist (PF, CATEGORY, or *.ebuild).
svn path=/main/trunk/; revision=9712
-rw-r--r-- | pym/portage/dbapi/bintree.py | 8 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 3 |
2 files changed, 6 insertions, 5 deletions
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 |