Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13680 - main/trunk/pym/portage/dbapi
Date: Wed, 24 Jun 2009 06:47:59
Message-Id: E1MJMGz-0008Nm-Oy@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-06-24 06:47:57 +0000 (Wed, 24 Jun 2009)
3 New Revision: 13680
4
5 Modified:
6 main/trunk/pym/portage/dbapi/bintree.py
7 Log:
8 In binarytree.inject(), when a symlink is created for the current package
9 and it overwrites another package, delete the corresponding metadata from
10 the Packages file. Thanks to Eitan Mosenkis <eitan@××××××××.net> for
11 reporting.
12
13
14 Modified: main/trunk/pym/portage/dbapi/bintree.py
15 ===================================================================
16 --- main/trunk/pym/portage/dbapi/bintree.py 2009-06-24 03:18:01 UTC (rev 13679)
17 +++ main/trunk/pym/portage/dbapi/bintree.py 2009-06-24 06:47:57 UTC (rev 13680)
18 @@ -833,6 +833,7 @@
19 # process) and then updated it, all while holding a lock.
20 from portage.locks import lockfile, unlockfile
21 pkgindex_lock = None
22 + created_symlink = False
23 try:
24 pkgindex_lock = lockfile(self._pkgindex_file,
25 wantnewlockfile=1)
26 @@ -843,6 +844,7 @@
27 if self._all_directory and \
28 self.getname(cpv).split(os.path.sep)[-2] == "All":
29 self._create_symlink(cpv)
30 + created_symlink = True
31 pkgindex = self._new_pkgindex()
32 try:
33 f = open(self._pkgindex_file)
34 @@ -874,8 +876,14 @@
35 # Handle path collisions in $PKGDIR/All
36 # when CPV is not identical.
37 del pkgindex.packages[i]
38 - elif cpv == d2.get("CPV") and path == d2.get("PATH", ""):
39 - del pkgindex.packages[i]
40 + elif cpv == d2.get("CPV"):
41 + if path == d2.get("PATH", ""):
42 + del pkgindex.packages[i]
43 + elif created_symlink and not d2.get("PATH", ""):
44 + # Delete entry for the package that was just
45 + # overwritten by a symlink to this package.
46 + del pkgindex.packages[i]
47 +
48 pkgindex.packages.append(d)
49
50 self._update_pkgindex_header(pkgindex.header)