From 3ef0dce92902180e34ef33105a21cff63c1c5a93 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sat, 9 Jan 2010 15:29:51 +0000 Subject: [PATCH] Because of my setup, one of my repos often changes location due to a symlink switch. Don't backtrace but just give me an "unknown repo" message instead. This fix is eligable for trunk to take over. svn path=/main/branches/prefix/; revision=15184 --- pym/_emerge/RepoDisplay.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pym/_emerge/RepoDisplay.py b/pym/_emerge/RepoDisplay.py index 67bf62672..17df5f5fd 100644 --- a/pym/_emerge/RepoDisplay.py +++ b/pym/_emerge/RepoDisplay.py @@ -32,7 +32,18 @@ class RepoDisplay(object): def repoStr(self, repo_path_real): real_index = -1 if repo_path_real: - real_index = self._repo_paths_real.index(repo_path_real) + try: + real_index = self._repo_paths_real.index(repo_path_real) + except ValueError: + # This typically happens when a repo is on a symlink and + # the symlink is switched to a different target during + # the dep-calculations, causing the realpath here to + # resolve in a different location than the one + # formally known. Since this should be pretty rare + # (although I hit it often enough to fix it), making + # this case equal to an "unknown repo" should be + # sufficient to cover the case. + real_index = -1 if real_index == -1: s = "?" self._unknown_repo = True -- 2.26.2