getmaskingreason: handle UNKNOWN_REPO
[portage.git] / pym / portage / package / ebuild / getmaskingreason.py
index 1c167140ed7b9822a1ac0c95ac63c15677bcbf2d..70a6bf2e611675055da15984eb4d12e8f849dfb4 100644 (file)
@@ -68,13 +68,11 @@ def getmaskingreason(mycpv, metadata=None, settings=None,
 
        mycp = pkg.cp
 
-       # XXX- This is a temporary duplicate of code from the config constructor.
-       locations = [os.path.join(settings["PORTDIR"], "profiles")]
+       locations = []
+       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)
-       for ov in portage.util.shlex_split(settings["PORTDIR_OVERLAY"]):
-               profdir = os.path.join(normalize_path(ov), "profiles")
-               if os.path.isdir(profdir):
-                       locations.append(profdir)
        locations.append(os.path.join(settings["PORTAGE_CONFIGROOT"],
                USER_CONFIG_PATH))
        locations.reverse()