diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-02-22 06:48:03 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-02-22 06:48:03 +0000 |
commit | 9b66f7391911cc02bc9efec2702d16d77f0d0d9f (patch) | |
tree | 13a17d3324a4fc596e7d5788443a720ef80ac32f | |
parent | 3d282f932d98123cf6a0c13ba23423efe151bd4e (diff) | |
download | portage-9b66f7391911cc02bc9efec2702d16d77f0d0d9f.tar.gz portage-9b66f7391911cc02bc9efec2702d16d77f0d0d9f.tar.bz2 portage-9b66f7391911cc02bc9efec2702d16d77f0d0d9f.zip |
Bug #211067 - Make the "portdir_overlay" and "mydir" variables contain
paths that are consistent wrt eachother regardless of any path
irregularities that can be induced by symlinks. Consistency is achieved
by regenerating one of the paths to ensure that both paths have the exact
same mapping between inodes and paths. This consistency ensures that the
path manipulations used to calculate "repolevel" will work as intended.
(trunk r9365)
svn path=/main/branches/2.1.2/; revision=9366
-rwxr-xr-x | bin/repoman | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/repoman b/bin/repoman index 801390e77..3d079f1e7 100755 --- a/bin/repoman +++ b/bin/repoman @@ -614,12 +614,12 @@ if "PWD" in os.environ and os.environ["PWD"] != mydir and \ # the current working directory (from the shell). mydir = os.environ["PWD"] mydir = normalize_path(mydir) -path_ids = set() +path_ids = {} p = mydir s = None while True: s = os.stat(p) - path_ids.add((s.st_dev, s.st_ino)) + path_ids[(s.st_dev, s.st_ino)] = p if p == "/": break p = os.path.dirname(p) @@ -632,10 +632,12 @@ for overlay in repoman_settings["PORTDIR_OVERLAY"].split(): s = os.stat(overlay) except OSError: continue - overlay_id = (s.st_dev, s.st_ino) + overlay = path_ids.get((s.st_dev, s.st_ino)) + if overlay is None: + continue if overlay[-1] != "/": overlay += "/" - if overlay_id in path_ids: + if True: portdir_overlay = overlay subdir = mydir[len(overlay):] if subdir and subdir[-1] != "/": |