1 |
Author: zmedico |
2 |
Date: 2008-02-22 06:46:49 +0000 (Fri, 22 Feb 2008) |
3 |
New Revision: 9365 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/repoman/utilities.py |
7 |
Log: |
8 |
Bug #211067 - Make the "portdir_overlay" and "mydir" variables contain |
9 |
paths that are consistent wrt eachother regardless of any path |
10 |
irregularities that can be induced by symlinks. Consistency is achieved |
11 |
by regenerating one of the paths to ensure that both paths have the exact |
12 |
same mapping between inodes and paths. This consistency ensures that the |
13 |
path manipulations used to calculate "repolevel" will work as intended. |
14 |
|
15 |
|
16 |
Modified: main/trunk/pym/repoman/utilities.py |
17 |
=================================================================== |
18 |
--- main/trunk/pym/repoman/utilities.py 2008-02-21 09:29:10 UTC (rev 9364) |
19 |
+++ main/trunk/pym/repoman/utilities.py 2008-02-22 06:46:49 UTC (rev 9365) |
20 |
@@ -308,12 +308,12 @@ |
21 |
|
22 |
location = normalize_path(location) |
23 |
|
24 |
- path_ids = set() |
25 |
+ path_ids = {} |
26 |
p = location |
27 |
s = None |
28 |
while True: |
29 |
s = os.stat(p) |
30 |
- path_ids.add((s.st_dev, s.st_ino)) |
31 |
+ path_ids[(s.st_dev, s.st_ino)] = p |
32 |
if p == "/": |
33 |
break |
34 |
p = os.path.dirname(p) |
35 |
@@ -326,10 +326,12 @@ |
36 |
s = os.stat(overlay) |
37 |
except OSError: |
38 |
continue |
39 |
- overlay_id = (s.st_dev, s.st_ino) |
40 |
+ overlay = path_ids.get((s.st_dev, s.st_ino)) |
41 |
+ if overlay is None: |
42 |
+ continue |
43 |
if overlay[-1] != "/": |
44 |
overlay += "/" |
45 |
- if overlay_id in path_ids: |
46 |
+ if True: |
47 |
portdir_overlay = overlay |
48 |
subdir = location[len(overlay):] |
49 |
if subdir and subdir[-1] != "/": |
50 |
|
51 |
-- |
52 |
gentoo-commits@l.g.o mailing list |