Add warning for missing masters attribute in layout.conf.
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Tue, 23 Jul 2013 21:52:47 +0000 (23:52 +0200)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Tue, 23 Jul 2013 21:52:47 +0000 (23:52 +0200)
pym/portage/repository/config.py

index 1bfe2f8068cb0c9e5ed48b172c09d56bbc4ce544..68e812119dbf89dae712fc3118741e318a8e366d 100644 (file)
@@ -197,7 +197,6 @@ class RepoConfig(object):
 
                # Parse layout.conf.
                if self.location:
-                       layout_filename = os.path.join(self.location, "metadata", "layout.conf")
                        layout_data = parse_layout_conf(self.location, self.name)[0]
 
                        # layout.conf masters may be overridden here if we have a masters
@@ -767,6 +766,17 @@ class RepoConfigLoader(object):
                                        eclass_db.append(tree_db)
                        repo.eclass_db = eclass_db
 
+               for repo_name, repo in prepos.items():
+                       if repo_name == "DEFAULT":
+                               continue
+
+                       if parse_layout_conf(repo.location, repo_name)[0]["masters"] is None and self.mainRepo() and \
+                               repo_name != self.mainRepo().name and not portage._sync_disabled_warnings:
+                               writemsg_level("!!! %s\n" % _("Repository '%s' is missing masters attribute in '%s'") %
+                                       (repo_name, os.path.join(repo.location, "metadata", "layout.conf")) +
+                                       "!!! %s\n" % _("Set 'masters = %s' in this file for future compatibility") %
+                                       self.mainRepo().name, level=logging.WARNING, noiselevel=-1)
+
                self._prepos_changed = True
                self._repo_location_list = []