Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9366 - main/branches/2.1.2/bin
Date: Fri, 22 Feb 2008 06:48:06
Message-Id: E1JSRhT-00016e-Vx@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-02-22 06:48:03 +0000 (Fri, 22 Feb 2008)
3 New Revision: 9366
4
5 Modified:
6 main/branches/2.1.2/bin/repoman
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 (trunk r9365)
15
16
17 Modified: main/branches/2.1.2/bin/repoman
18 ===================================================================
19 --- main/branches/2.1.2/bin/repoman 2008-02-22 06:46:49 UTC (rev 9365)
20 +++ main/branches/2.1.2/bin/repoman 2008-02-22 06:48:03 UTC (rev 9366)
21 @@ -614,12 +614,12 @@
22 # the current working directory (from the shell).
23 mydir = os.environ["PWD"]
24 mydir = normalize_path(mydir)
25 -path_ids = set()
26 +path_ids = {}
27 p = mydir
28 s = None
29 while True:
30 s = os.stat(p)
31 - path_ids.add((s.st_dev, s.st_ino))
32 + path_ids[(s.st_dev, s.st_ino)] = p
33 if p == "/":
34 break
35 p = os.path.dirname(p)
36 @@ -632,10 +632,12 @@
37 s = os.stat(overlay)
38 except OSError:
39 continue
40 - overlay_id = (s.st_dev, s.st_ino)
41 + overlay = path_ids.get((s.st_dev, s.st_ino))
42 + if overlay is None:
43 + continue
44 if overlay[-1] != "/":
45 overlay += "/"
46 - if overlay_id in path_ids:
47 + if True:
48 portdir_overlay = overlay
49 subdir = mydir[len(overlay):]
50 if subdir and subdir[-1] != "/":
51
52 --
53 gentoo-commits@l.g.o mailing list