diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-06-24 06:47:57 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-06-24 06:47:57 +0000 |
commit | 463b82e15e317cd210b78886a319fbdee8981a63 (patch) | |
tree | a57db3df5417bb6c3cdb59e3e8e323a31ae28522 | |
parent | abf3368c778c9e615e5fa8acffcb2aa56fdd6a80 (diff) | |
download | portage-463b82e15e317cd210b78886a319fbdee8981a63.tar.gz portage-463b82e15e317cd210b78886a319fbdee8981a63.tar.bz2 portage-463b82e15e317cd210b78886a319fbdee8981a63.zip |
In binarytree.inject(), when a symlink is created for the current package
and it overwrites another package, delete the corresponding metadata from
the Packages file. Thanks to Eitan Mosenkis <eitan@mosenkis.net> for
reporting.
svn path=/main/trunk/; revision=13680
-rw-r--r-- | pym/portage/dbapi/bintree.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index b2984fafc..41da32d39 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -833,6 +833,7 @@ class binarytree(object): # process) and then updated it, all while holding a lock. from portage.locks import lockfile, unlockfile pkgindex_lock = None + created_symlink = False try: pkgindex_lock = lockfile(self._pkgindex_file, wantnewlockfile=1) @@ -843,6 +844,7 @@ class binarytree(object): if self._all_directory and \ self.getname(cpv).split(os.path.sep)[-2] == "All": self._create_symlink(cpv) + created_symlink = True pkgindex = self._new_pkgindex() try: f = open(self._pkgindex_file) @@ -874,8 +876,14 @@ class binarytree(object): # Handle path collisions in $PKGDIR/All # when CPV is not identical. del pkgindex.packages[i] - elif cpv == d2.get("CPV") and path == d2.get("PATH", ""): - del pkgindex.packages[i] + elif cpv == d2.get("CPV"): + if path == d2.get("PATH", ""): + del pkgindex.packages[i] + elif created_symlink and not d2.get("PATH", ""): + # Delete entry for the package that was just + # overwritten by a symlink to this package. + del pkgindex.packages[i] + pkgindex.packages.append(d) self._update_pkgindex_header(pkgindex.header) |