repoman: make virtual.oldstyle an error
authorZac Medico <zmedico@gentoo.org>
Fri, 17 Feb 2012 23:56:56 +0000 (15:56 -0800)
committerZac Medico <zmedico@gentoo.org>
Sat, 18 Feb 2012 00:00:32 +0000 (16:00 -0800)
Also, add "allow-provide-virtuals = true" setting for
metadata/layout.conf which reduces it to a warning.

bin/repoman
man/repoman.1
pym/portage/repository/config.py

index f3946eae5cb2b6bb843ef270493a55d9b9de40e7..bcb48e464a8de69d4540a0aa5369ca7c169aad44 100755 (executable)
@@ -427,7 +427,6 @@ qawarnings = set((
 "portage.internal",
 "usage.obsolete",
 "upstream.workaround",
-"virtual.oldstyle",
 "LIVEVCS.stable",
 "LIVEVCS.unmasked",
 ))
@@ -580,6 +579,9 @@ repo_config = repoman_settings.repositories.get_repo_for_location(repodir)
 portdb.porttrees = list(repo_config.eclass_db.porttrees)
 portdir = portdb.porttrees[0]
 
+if repo_config.allow_provide_virtual:
+       qawarnings.add("virtual.oldstyle")
+
 if repo_config.sign_commit:
        if vcs == 'git':
                # NOTE: It's possible to use --gpg-sign=key_id to specify the key in
index f53a19e5f199cc4864ed9263cb8d691729a24bea..ddabbbb5bb87e7dd68444b0a58e6322fe16d97b6 100644 (file)
@@ -1,4 +1,4 @@
-.TH "REPOMAN" "1" "Oct 2011" "Portage VERSION" "Portage"
+.TH "REPOMAN" "1" "Feb 2012" "Portage VERSION" "Portage"
 .SH NAME
 repoman \- Gentoo's program to enforce a minimal level of quality assurance in packages added to the portage tree
 .SH SYNOPSIS
@@ -363,7 +363,8 @@ Assigning a readonly variable
 Ebuild uses D, ROOT, ED, EROOT or EPREFIX with helpers
 .TP
 .B virtual.oldstyle
-The ebuild PROVIDEs an old-style virtual (see GLEP 37)
+The ebuild PROVIDEs an old-style virtual (see GLEP 37). This is an error
+unless "allow\-provide\-virtuals = true" is set in metadata/layout.conf.
 .TP
 .B wxwidgets.eclassnotused
 Ebuild DEPENDs on x11-libs/wxGTK without inheriting wxwidgets.eclass. Refer to
index 84d97411ec05605bb69db1b410bd9de141177f9d..defdb47c86a50dfa234cbdc0430692da097123e2 100644 (file)
@@ -45,7 +45,7 @@ def _gen_valid_repo(name):
 class RepoConfig(object):
        """Stores config of one repository"""
 
-       __slots__ = ('aliases', 'allow_missing_manifest',
+       __slots__ = ('aliases', 'allow_missing_manifest', 'allow_provide_virtual',
                'cache_formats', 'create_manifest', 'disable_manifest', 'eapi',
                'eclass_db', 'eclass_locations', 'eclass_overrides', 'format', 'location',
                'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
@@ -123,6 +123,7 @@ class RepoConfig(object):
                self.sign_manifest = True
                self.thin_manifest = False
                self.allow_missing_manifest = False
+               self.allow_provide_virtual = False
                self.create_manifest = True
                self.disable_manifest = False
                self.manifest_hashes = None
@@ -149,7 +150,8 @@ class RepoConfig(object):
                                # them the ability to do incremental overrides
                                self.aliases = layout_data['aliases'] + tuple(aliases)
 
-                       for value in ('allow-missing-manifest', 'cache-formats',
+                       for value in ('allow-missing-manifest',
+                               'allow-provide-virtual', 'cache-formats',
                                'create-manifest', 'disable-manifest', 'manifest-hashes',
                                'sign-commit', 'sign-manifest', 'thin-manifest', 'update-changelog'):
                                setattr(self, value.lower().replace("-", "_"), layout_data[value])
@@ -691,6 +693,9 @@ def parse_layout_conf(repo_location, repo_name=None):
        data['masters'] = masters
        data['aliases'] = tuple(layout_data.get('aliases', '').split())
 
+       data['allow-provide-virtual'] = \
+               layout_data.get('allow-provide-virtuals', 'false').lower() == 'true'
+
        data['sign-commit'] = layout_data.get('sign-commits', 'false').lower() \
                == 'true'