getmaskingreason: handle UNKNOWN_REPO
authorZac Medico <zmedico@gentoo.org>
Tue, 23 Jul 2013 20:26:34 +0000 (13:26 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 23 Jul 2013 20:26:34 +0000 (13:26 -0700)
pym/portage/package/ebuild/getmaskingreason.py

index 53895749a4cb2854a0a33cb3a2f29a95c3bd73d1..70a6bf2e611675055da15984eb4d12e8f849dfb4 100644 (file)
@@ -69,8 +69,9 @@ def getmaskingreason(mycpv, metadata=None, settings=None,
        mycp = pkg.cp
 
        locations = []
-       for repo in settings.repositories[pkg.repo].masters + (settings.repositories[pkg.repo],):
-               locations.append(os.path.join(repo.location, "profiles"))
+       if pkg.repo in settings.repositories:
+               for repo in settings.repositories[pkg.repo].masters + (settings.repositories[pkg.repo],):
+                       locations.append(os.path.join(repo.location, "profiles"))
        locations.extend(settings.profiles)
        locations.append(os.path.join(settings["PORTAGE_CONFIGROOT"],
                USER_CONFIG_PATH))