From: Fabian Groffen Date: Sat, 9 Jan 2010 15:29:51 +0000 (-0000) Subject: Because of my setup, one of my repos often changes location due to a symlink switch... X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=3ef0dce92902180e34ef33105a21cff63c1c5a93;p=portage.git 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 --- 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