diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-02-22 06:46:49 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-02-22 06:46:49 +0000 |
commit | 71b5bbf7516cf75b9dafcdf9558a64b9bfc7bd79 (patch) | |
tree | d0f727f87d01d62e292d3c3abe6a49f34dd2d171 /pym/repoman | |
parent | Make LibraryPackageMap.update() sort the contents of the library_consumers (diff) | |
download | portage-idfetch-71b5bbf7516cf75b9dafcdf9558a64b9bfc7bd79.tar.gz portage-idfetch-71b5bbf7516cf75b9dafcdf9558a64b9bfc7bd79.tar.bz2 portage-idfetch-71b5bbf7516cf75b9dafcdf9558a64b9bfc7bd79.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.
svn path=/main/trunk/; revision=9365
Diffstat (limited to 'pym/repoman')
-rw-r--r-- | pym/repoman/utilities.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py index 379e47e6..3cefff5e 100644 --- a/pym/repoman/utilities.py +++ b/pym/repoman/utilities.py @@ -308,12 +308,12 @@ def FindPortdir(settings): location = normalize_path(location) - path_ids = set() + path_ids = {} p = location 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) @@ -326,10 +326,12 @@ def FindPortdir(settings): 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 = location[len(overlay):] if subdir and subdir[-1] != "/": |