From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 07AF41382C5 for ; Fri, 30 Mar 2018 05:21:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DA3ACE09C2; Fri, 30 Mar 2018 05:20:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 98AF3E09C1 for ; Fri, 30 Mar 2018 05:20:53 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 74848335D35 for ; Fri, 30 Mar 2018 05:20:52 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9AB8A27D for ; Fri, 30 Mar 2018 05:20:47 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1522381880.72ab831df749bef1b337f8787068a004c24432e6.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: repoman/pym/repoman/modules/scan/metadata/, ... X-VCS-Repository: proj/portage X-VCS-Files: repoman/pym/repoman/config.py repoman/pym/repoman/main.py repoman/pym/repoman/modules/linechecks/assignment/__init__.py repoman/pym/repoman/modules/linechecks/config.py repoman/pym/repoman/modules/linechecks/depend/__init__.py repoman/pym/repoman/modules/linechecks/deprecated/__init__.py repoman/pym/repoman/modules/linechecks/do/__init__.py repoman/pym/repoman/modules/linechecks/eapi/__init__.py repoman/pym/repoman/modules/linechecks/emake/__init__.py repoman/pym/repoman/modules/linechecks/gentoo_header/__init__.py repoman/pym/repoman/modules/linechecks/helpers/__init__.py repoman/pym/repoman/modules/linechecks/nested/__init__.py repoman/pym/repoman/modules/linechecks/patches/__init__.py repoman/pym/repoman/modules/linechecks/phases/__init__.py repoman/pym/repoman/modules/linechecks/portage/__init__.py repoman/pym/repoman/modules/linechecks/quotes/__init__.py repoman/pym/repoman/modules/linechecks/uri/__init__.py repoman/pym/repoman/modules/linechecks/use/__init__.py rep oman/pym/repoman/modules/linechecks/useless/__init__.py repoman/pym/repoman/modules/linechecks/whitespace/__init__.py repoman/pym/repoman/modules/linechecks/workaround/__init__.py repoman/pym/repoman/modules/scan/depend/__init__.py repoman/pym/repoman/modules/scan/directories/__init__.py repoman/pym/repoman/modules/scan/eapi/__init__.py repoman/pym/repoman/modules/scan/ebuild/__init__.py repoman/pym/repoman/modules/scan/eclasses/__init__.py repoman/pym/repoman/modules/scan/fetch/__init__.py repoman/pym/repoman/modules/scan/keywords/__init__.py repoman/pym/repoman/modules/scan/manifest/__init__.py repoman/pym/repoman/modules/scan/metadata/__init__.py repoman/pym/repoman/modules/scan/module.py repoman/pym/repoman/modules/scan/options/__init__.py repoman/pym/repoman/qa_data.py repoman/pym/repoman/repos.py repoman/pym/repoman/scanner.py X-VCS-Directories: repoman/pym/repoman/modules/linechecks/eapi/ repoman/pym/repoman/modules/scan/metadata/ repoman/pym/repoman/modules/linechecks/emake/ repoman/pym/repoman/modules/linechecks/depend/ repoman/pym/repoman/modules/linechecks/nested/ repoman/pym/repoman/modules/scan/ebuild/ repoman/pym/repoman/modules/scan/ repoman/pym/repoman/modules/linechecks/workaround/ repoman/pym/repoman/modules/scan/eclasses/ repoman/pym/repoman/modules/scan/eapi/ repoman/pym/repoman/modules/linechecks/deprecated/ repoman/pym/repoman/modules/linechecks/portage/ repoman/pym/repoman/modules/scan/keywords/ repoman/pym/repoman/modules/linechecks/quotes/ repoman/pym/repoman/modules/linechecks/patches/ repoman/pym/repoman/modules/linechecks/whitespace/ repoman/pym/repoman/modules/linechecks/gentoo_header/ repoman/pym/repoman/modules/scan/manifest/ repoman/pym/repoman/modules/linechecks/use/ repoman/pym/repoman/modules/linechecks/phases/ repoman/pym/repoman/modules/scan/options/ repoman/pym/repoman/modul es/linechecks/useless/ repoman/pym/repoman/modules/scan/fetch/ repoman/pym/repoman/modules/linechecks/helpers/ repoman/pym/repoman/modules/scan/directories/ repoman/pym/repoman/modules/scan/depend/ repoman/pym/repoman/modules/linechecks/uri/ repoman/pym/repoman/modules/linechecks/ repoman/pym/repoman/modules/linechecks/assignment/ repoman/pym/repoman/modules/linechecks/do/ repoman/pym/repoman/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 72ab831df749bef1b337f8787068a004c24432e6 X-VCS-Branch: repoman Date: Fri, 30 Mar 2018 05:20:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 44832328-4d70-497c-9208-0b3ee498b39c X-Archives-Hash: 46f1cdb70224a49fbaa9a24696dda83d commit: 72ab831df749bef1b337f8787068a004c24432e6 Author: Brian Dolbec gentoo org> AuthorDate: Wed Aug 16 23:24:24 2017 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Mar 30 03:51:20 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=72ab831d repoman: Initial adding file/module/API version repoman/pym/repoman/config.py | 7 +++++-- repoman/pym/repoman/main.py | 3 +++ repoman/pym/repoman/modules/linechecks/assignment/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/config.py | 2 +- repoman/pym/repoman/modules/linechecks/depend/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/deprecated/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/do/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/eapi/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/emake/__init__.py | 3 ++- .../pym/repoman/modules/linechecks/gentoo_header/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/helpers/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/nested/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/patches/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/phases/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/portage/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/quotes/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/uri/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/use/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/useless/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/whitespace/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/workaround/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/depend/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/directories/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/eapi/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/ebuild/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/eclasses/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/fetch/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/keywords/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/manifest/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/metadata/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/module.py | 10 +++++++--- repoman/pym/repoman/modules/scan/options/__init__.py | 3 ++- repoman/pym/repoman/qa_data.py | 4 ++-- repoman/pym/repoman/repos.py | 2 +- repoman/pym/repoman/scanner.py | 3 ++- 35 files changed, 77 insertions(+), 38 deletions(-) diff --git a/repoman/pym/repoman/config.py b/repoman/pym/repoman/config.py index 9da30ed9e..0f2358cd9 100644 --- a/repoman/pym/repoman/config.py +++ b/repoman/pym/repoman/config.py @@ -144,8 +144,11 @@ def load_config(conf_dirs, file_extensions=None, valid_versions=None): if config: if config['version'] not in valid_versions: - raise ConfigError("Invalid file version: %s in: %s\nPlease upgrade repoman: current valid versions: %s" - % (config['version'], filename, valid_versions)) + raise ConfigError( + "Invalid file version: %s in: %s\nPlease upgrade to " + ">=app-portage/repoman-%s, current valid API versions: %s" + % (config['version'], filename, + config['repoman_version'], valid_versions)) result = merge_config(result, config) return result diff --git a/repoman/pym/repoman/main.py b/repoman/pym/repoman/main.py index c1e3b99fe..81e2ff61e 100755 --- a/repoman/pym/repoman/main.py +++ b/repoman/pym/repoman/main.py @@ -47,10 +47,12 @@ os.umask(0o22) LOGLEVEL = logging.WARNING portage.util.initialize_logger(LOGLEVEL) +VALID_VERSIONS = [1,] def repoman_main(argv): config_root = os.environ.get("PORTAGE_CONFIGROOT") repoman_settings = portage.config(config_root=config_root, local_config=False) + repoman_settings.valid_versions = VALID_VERSIONS if repoman_settings.get("NOCOLOR", "").lower() in ("yes", "true") or \ repoman_settings.get('TERM') == 'dumb' or \ @@ -92,6 +94,7 @@ def repoman_main(argv): config_root, portdir, portdir_overlay, repoman_settings, vcs_settings, options, qadata) repoman_settings = repo_settings.repoman_settings + repoman_settings.valid_versions = VALID_VERSIONS # Now set repo_settings vcs_settings.repo_settings = repo_settings diff --git a/repoman/pym/repoman/modules/linechecks/assignment/__init__.py b/repoman/pym/repoman/modules/linechecks/assignment/__init__.py index 6223baa9f..b95a25a74 100644 --- a/repoman/pym/repoman/modules/linechecks/assignment/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/assignment/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "Eapi3EbuildAssignment", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/config.py b/repoman/pym/repoman/modules/linechecks/config.py index bba43a875..bde2e587f 100644 --- a/repoman/pym/repoman/modules/linechecks/config.py +++ b/repoman/pym/repoman/modules/linechecks/config.py @@ -69,7 +69,7 @@ class LineChecksConfig(object): self.infopaths = infopaths elif not self.infopaths: logging.error("LineChecksConfig; Error: No linechecks.yaml files defined") - configs = load_config(self.infopaths, 'yaml') + configs = load_config(self.infopaths, 'yaml', self.repo_settings.repoman_settings.valid_versions) if configs == {}: logging.error("LineChecksConfig: Failed to load a valid 'linechecks.yaml' file at paths: %s", self.infopaths) return False diff --git a/repoman/pym/repoman/modules/linechecks/depend/__init__.py b/repoman/pym/repoman/modules/linechecks/depend/__init__.py index e564948c5..2ea95347e 100644 --- a/repoman/pym/repoman/modules/linechecks/depend/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/depend/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "ImplicitRuntimeDeps", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py b/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py index 8c5f61d49..258683345 100644 --- a/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py @@ -41,6 +41,7 @@ module_spec = { 'class': "InheritDeprecated", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/do/__init__.py b/repoman/pym/repoman/modules/linechecks/do/__init__.py index a56204794..dc5af701c 100644 --- a/repoman/pym/repoman/modules/linechecks/do/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/do/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "EbuildNonRelativeDosym", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/eapi/__init__.py b/repoman/pym/repoman/modules/linechecks/eapi/__init__.py index e598fdfe3..31993df20 100644 --- a/repoman/pym/repoman/modules/linechecks/eapi/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/eapi/__init__.py @@ -46,6 +46,7 @@ module_spec = { 'class': "Eapi4GoneVars", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/emake/__init__.py b/repoman/pym/repoman/modules/linechecks/emake/__init__.py index 2e930dae8..cecdc5fcf 100644 --- a/repoman/pym/repoman/modules/linechecks/emake/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/emake/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "WantAutoDefaultValue", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/gentoo_header/__init__.py b/repoman/pym/repoman/modules/linechecks/gentoo_header/__init__.py index b80a83ecf..205cc32c2 100644 --- a/repoman/pym/repoman/modules/linechecks/gentoo_header/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/gentoo_header/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "EbuildHeader", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/helpers/__init__.py b/repoman/pym/repoman/modules/linechecks/helpers/__init__.py index e2d12afe4..0f41f0136 100644 --- a/repoman/pym/repoman/modules/linechecks/helpers/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/helpers/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "NoOffsetWithHelpers", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/nested/__init__.py b/repoman/pym/repoman/modules/linechecks/nested/__init__.py index 8eeeccbac..6c8a70a52 100644 --- a/repoman/pym/repoman/modules/linechecks/nested/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/nested/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "EbuildNestedDie", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/patches/__init__.py b/repoman/pym/repoman/modules/linechecks/patches/__init__.py index 67434f911..4fe0fcf5e 100644 --- a/repoman/pym/repoman/modules/linechecks/patches/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/patches/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "EbuildPatches", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/phases/__init__.py b/repoman/pym/repoman/modules/linechecks/phases/__init__.py index 476443b25..b3228c0f7 100644 --- a/repoman/pym/repoman/modules/linechecks/phases/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/phases/__init__.py @@ -29,6 +29,7 @@ module_spec = { 'class': "SrcUnpackPatches", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/portage/__init__.py b/repoman/pym/repoman/modules/linechecks/portage/__init__.py index d390c6054..b9a84b507 100644 --- a/repoman/pym/repoman/modules/linechecks/portage/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/portage/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "PortageInternalVariableAssignment", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/quotes/__init__.py b/repoman/pym/repoman/modules/linechecks/quotes/__init__.py index 6043ab20c..894ef58d2 100644 --- a/repoman/pym/repoman/modules/linechecks/quotes/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/quotes/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "EbuildQuotedA", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/uri/__init__.py b/repoman/pym/repoman/modules/linechecks/uri/__init__.py index a7731e3cc..e19617257 100644 --- a/repoman/pym/repoman/modules/linechecks/uri/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/uri/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "UriUseHttps", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/use/__init__.py b/repoman/pym/repoman/modules/linechecks/use/__init__.py index e5665d2d8..e97b0d61d 100644 --- a/repoman/pym/repoman/modules/linechecks/use/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/use/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "BuiltWithUse", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/useless/__init__.py b/repoman/pym/repoman/modules/linechecks/useless/__init__.py index acc4479f5..5cf978137 100644 --- a/repoman/pym/repoman/modules/linechecks/useless/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/useless/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "EbuildUselessDodoc", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/__init__.py b/repoman/pym/repoman/modules/linechecks/whitespace/__init__.py index ded690ed7..716c5129c 100644 --- a/repoman/pym/repoman/modules/linechecks/whitespace/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/whitespace/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "EbuildBlankLine", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/workaround/__init__.py b/repoman/pym/repoman/modules/linechecks/workaround/__init__.py index 0b5aa70c8..425085a5c 100644 --- a/repoman/pym/repoman/modules/linechecks/workaround/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/workaround/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "NoAsNeeded", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/depend/__init__.py b/repoman/pym/repoman/modules/scan/depend/__init__.py index bd6905c0b..c3cc0ddeb 100644 --- a/repoman/pym/repoman/modules/scan/depend/__init__.py +++ b/repoman/pym/repoman/modules/scan/depend/__init__.py @@ -28,6 +28,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/directories/__init__.py b/repoman/pym/repoman/modules/scan/directories/__init__.py index 18ca086ce..276bc7ae9 100644 --- a/repoman/pym/repoman/modules/scan/directories/__init__.py +++ b/repoman/pym/repoman/modules/scan/directories/__init__.py @@ -45,6 +45,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/eapi/__init__.py b/repoman/pym/repoman/modules/scan/eapi/__init__.py index f6306b3e1..94759fdd7 100644 --- a/repoman/pym/repoman/modules/scan/eapi/__init__.py +++ b/repoman/pym/repoman/modules/scan/eapi/__init__.py @@ -25,6 +25,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/ebuild/__init__.py b/repoman/pym/repoman/modules/scan/ebuild/__init__.py index 1d8ec1941..328a0d626 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/__init__.py +++ b/repoman/pym/repoman/modules/scan/ebuild/__init__.py @@ -55,6 +55,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/eclasses/__init__.py b/repoman/pym/repoman/modules/scan/eclasses/__init__.py index 9b1f203ce..234ef9fca 100644 --- a/repoman/pym/repoman/modules/scan/eclasses/__init__.py +++ b/repoman/pym/repoman/modules/scan/eclasses/__init__.py @@ -44,6 +44,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/fetch/__init__.py b/repoman/pym/repoman/modules/scan/fetch/__init__.py index d1b4f8d0e..30db3f529 100644 --- a/repoman/pym/repoman/modules/scan/fetch/__init__.py +++ b/repoman/pym/repoman/modules/scan/fetch/__init__.py @@ -29,6 +29,7 @@ module_spec = { }, 'module_runsIn': ['pkgs', 'ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/keywords/__init__.py b/repoman/pym/repoman/modules/scan/keywords/__init__.py index 88ea5aca9..d4c1281bc 100644 --- a/repoman/pym/repoman/modules/scan/keywords/__init__.py +++ b/repoman/pym/repoman/modules/scan/keywords/__init__.py @@ -29,6 +29,7 @@ module_spec = { }, 'module_runsIn': ['pkgs', 'ebuilds', 'final'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/manifest/__init__.py b/repoman/pym/repoman/modules/scan/manifest/__init__.py index 94f0a1f35..9e05c5288 100644 --- a/repoman/pym/repoman/modules/scan/manifest/__init__.py +++ b/repoman/pym/repoman/modules/scan/manifest/__init__.py @@ -26,6 +26,7 @@ module_spec = { }, 'module_runsIn': ['pkgs'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/metadata/__init__.py b/repoman/pym/repoman/modules/scan/metadata/__init__.py index 2d111b4e0..fccde99b5 100644 --- a/repoman/pym/repoman/modules/scan/metadata/__init__.py +++ b/repoman/pym/repoman/modules/scan/metadata/__init__.py @@ -84,6 +84,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/module.py b/repoman/pym/repoman/modules/scan/module.py index 5d34eaef0..28d6668d6 100644 --- a/repoman/pym/repoman/modules/scan/module.py +++ b/repoman/pym/repoman/modules/scan/module.py @@ -10,6 +10,7 @@ import yaml from portage.module import InvalidModuleName, Modules from portage.util import stack_lists +from repoman.config import ConfigError MODULES_PATH = os.path.dirname(__file__) # initial development debug info @@ -20,7 +21,7 @@ class ModuleConfig(object): '''Holds the scan modules configuration information and creates the ordered list of modulles to run''' - def __init__(self, configpaths): + def __init__(self, configpaths, valid_versions=None): '''Module init @param configpaths: ordered list of filepaths to load @@ -37,13 +38,13 @@ class ModuleConfig(object): self.ebuilds_loop = [] self.final_loop = [] self.modules_forced = ['ebuild', 'mtime'] - self.load_configs() + self.load_configs(valid_versions=valid_versions) for loop in ['pkgs', 'ebuilds', 'final']: logging.debug("ModuleConfig; Processing loop %s", loop) setattr(self, '%s_loop' % loop, self._determine_list(loop)) self.linechecks = stack_lists(c['linechecks_modules'].split() for c in self._configs) - def load_configs(self, configpaths=None): + def load_configs(self, configpaths=None, valid_versions=None): '''load the config files in order @param configpaths: ordered list of filepaths to load @@ -62,6 +63,9 @@ class ModuleConfig(object): except IOError as error: logging,error("Failed to load file: %s", inputfile) logging.exception(error) + else: + if configs[-1]['version'] not in valid_versions: + raise ConfigError("Invalid file version: %s in: %s\nPlease upgrade repoman" % (configs['version'], path)) logging.debug("ModuleConfig; completed : %s", path) logging.debug("ModuleConfig; new _configs: %s", configs) self._configs = configs diff --git a/repoman/pym/repoman/modules/scan/options/__init__.py b/repoman/pym/repoman/modules/scan/options/__init__.py index d62e75274..ffce474e5 100644 --- a/repoman/pym/repoman/modules/scan/options/__init__.py +++ b/repoman/pym/repoman/modules/scan/options/__init__.py @@ -24,6 +24,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/qa_data.py b/repoman/pym/repoman/qa_data.py index fba0c2d64..11f00d897 100644 --- a/repoman/pym/repoman/qa_data.py +++ b/repoman/pym/repoman/qa_data.py @@ -28,14 +28,14 @@ class QAData(object): self.no_exec = None - def load_repo_config(self, repopaths, options): + def load_repo_config(self, repopaths, options, valid_versions): '''Load the repository repoman qa_data.yml config @param repopaths: list of strings, The path of the repository being scanned This could be a parent repository using the repoman_masters layout.conf variable ''' - qadata = load_config([os.path.join(path,'qa_data.yaml') for path in repopaths], 'yaml') + qadata = load_config([os.path.join(path,'qa_data.yaml') for path in repopaths], 'yaml', valid_versions) if qadata == {}: logging.error("QAData: Failed to load a valid 'qa_data.yaml' file at paths: %s", repopaths) return False diff --git a/repoman/pym/repoman/repos.py b/repoman/pym/repoman/repos.py index e383dbfd1..9c820b08c 100644 --- a/repoman/pym/repoman/repos.py +++ b/repoman/pym/repoman/repos.py @@ -53,7 +53,7 @@ class RepoSettings(object): logging.debug("RepoSettings: init(); load qadata") # load the repo specific configuration self.qadata = qadata - if not self.qadata.load_repo_config(self.masters_list, options): + if not self.qadata.load_repo_config(self.masters_list, options, repoman_settings.valid_versions): logging.error("Aborting...") sys.exit(1) logging.debug("RepoSettings: qadata loaded: %s", qadata.no_exec) diff --git a/repoman/pym/repoman/scanner.py b/repoman/pym/repoman/scanner.py index d61e50131..f203011e4 100644 --- a/repoman/pym/repoman/scanner.py +++ b/repoman/pym/repoman/scanner.py @@ -116,7 +116,8 @@ class Scanner(object): # Initialize the ModuleConfig class here # TODO Add layout.conf masters repository.yml config to the list to load/stack - self.moduleconfig = ModuleConfig(self.repo_settings.masters_list) + self.moduleconfig = ModuleConfig(self.repo_settings.masters_list, + self.repo_settings.repoman_settings.valid_versions) checks = {} # The --echangelog option causes automatic ChangeLog generation, From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 25BE9138331 for ; Fri, 30 Mar 2018 04:23:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 89128E0976; Fri, 30 Mar 2018 04:23:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 512FFE0976 for ; Fri, 30 Mar 2018 04:23:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A8B06335D3A for ; Fri, 30 Mar 2018 04:23:43 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B8F8727B for ; Fri, 30 Mar 2018 04:23:40 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1522381880.72ab831df749bef1b337f8787068a004c24432e6.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/scan/depend/, ... X-VCS-Repository: proj/portage X-VCS-Files: repoman/pym/repoman/config.py repoman/pym/repoman/main.py repoman/pym/repoman/modules/linechecks/assignment/__init__.py repoman/pym/repoman/modules/linechecks/config.py repoman/pym/repoman/modules/linechecks/depend/__init__.py repoman/pym/repoman/modules/linechecks/deprecated/__init__.py repoman/pym/repoman/modules/linechecks/do/__init__.py repoman/pym/repoman/modules/linechecks/eapi/__init__.py repoman/pym/repoman/modules/linechecks/emake/__init__.py repoman/pym/repoman/modules/linechecks/gentoo_header/__init__.py repoman/pym/repoman/modules/linechecks/helpers/__init__.py repoman/pym/repoman/modules/linechecks/nested/__init__.py repoman/pym/repoman/modules/linechecks/patches/__init__.py repoman/pym/repoman/modules/linechecks/phases/__init__.py repoman/pym/repoman/modules/linechecks/portage/__init__.py repoman/pym/repoman/modules/linechecks/quotes/__init__.py repoman/pym/repoman/modules/linechecks/uri/__init__.py repoman/pym/repoman/modules/linechecks/use/__init__.py rep oman/pym/repoman/modules/linechecks/useless/__init__.py repoman/pym/repoman/modules/linechecks/whitespace/__init__.py repoman/pym/repoman/modules/linechecks/workaround/__init__.py repoman/pym/repoman/modules/scan/depend/__init__.py repoman/pym/repoman/modules/scan/directories/__init__.py repoman/pym/repoman/modules/scan/eapi/__init__.py repoman/pym/repoman/modules/scan/ebuild/__init__.py repoman/pym/repoman/modules/scan/eclasses/__init__.py repoman/pym/repoman/modules/scan/fetch/__init__.py repoman/pym/repoman/modules/scan/keywords/__init__.py repoman/pym/repoman/modules/scan/manifest/__init__.py repoman/pym/repoman/modules/scan/metadata/__init__.py repoman/pym/repoman/modules/scan/module.py repoman/pym/repoman/modules/scan/options/__init__.py repoman/pym/repoman/qa_data.py repoman/pym/repoman/repos.py repoman/pym/repoman/scanner.py X-VCS-Directories: repoman/pym/repoman/modules/scan/metadata/ repoman/pym/repoman/modules/linechecks/gentoo_header/ repoman/pym/repoman/modules/linechecks/useless/ repoman/pym/repoman/ repoman/pym/repoman/modules/linechecks/nested/ repoman/pym/repoman/modules/scan/fetch/ repoman/pym/repoman/modules/linechecks/patches/ repoman/pym/repoman/modules/linechecks/whitespace/ repoman/pym/repoman/modules/linechecks/workaround/ repoman/pym/repoman/modules/scan/eclasses/ repoman/pym/repoman/modules/scan/keywords/ repoman/pym/repoman/modules/linechecks/phases/ repoman/pym/repoman/modules/scan/manifest/ repoman/pym/repoman/modules/linechecks/depend/ repoman/pym/repoman/modules/scan/ebuild/ repoman/pym/repoman/modules/linechecks/portage/ repoman/pym/repoman/modules/linechecks/quotes/ repoman/pym/repoman/modules/linechecks/ repoman/pym/repoman/modules/linechecks/do/ repoman/pym/repoman/modules/scan/depend/ repoman/pym/repoman/modules/linechecks/deprecated/ repoman/pym/repoman/modules/scan/eapi/ rep oman/pym/repoman/modules/scan/directories/ repoman/pym/repoman/modules/linechecks/uri/ repoman/pym/repoman/modules/scan/options/ repoman/pym/repoman/modules/linechecks/emake/ repoman/pym/repoman/modules/linechecks/eapi/ repoman/pym/repoman/modules/scan/ repoman/pym/repoman/modules/linechecks/assignment/ repoman/pym/repoman/modules/linechecks/use/ repoman/pym/repoman/modules/linechecks/helpers/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 72ab831df749bef1b337f8787068a004c24432e6 X-VCS-Branch: master Date: Fri, 30 Mar 2018 04:23:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: f62a0382-2929-4936-b088-922cdd2bb19c X-Archives-Hash: c2739da8d01a9fc9eeb879d991d230e9 Message-ID: <20180330042340.2TAXpwUNygMQvEUONn6kzXVRb2Ws5whPHwZDj-AzL1E@z> commit: 72ab831df749bef1b337f8787068a004c24432e6 Author: Brian Dolbec gentoo org> AuthorDate: Wed Aug 16 23:24:24 2017 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Mar 30 03:51:20 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=72ab831d repoman: Initial adding file/module/API version repoman/pym/repoman/config.py | 7 +++++-- repoman/pym/repoman/main.py | 3 +++ repoman/pym/repoman/modules/linechecks/assignment/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/config.py | 2 +- repoman/pym/repoman/modules/linechecks/depend/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/deprecated/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/do/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/eapi/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/emake/__init__.py | 3 ++- .../pym/repoman/modules/linechecks/gentoo_header/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/helpers/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/nested/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/patches/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/phases/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/portage/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/quotes/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/uri/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/use/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/useless/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/whitespace/__init__.py | 3 ++- repoman/pym/repoman/modules/linechecks/workaround/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/depend/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/directories/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/eapi/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/ebuild/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/eclasses/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/fetch/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/keywords/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/manifest/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/metadata/__init__.py | 3 ++- repoman/pym/repoman/modules/scan/module.py | 10 +++++++--- repoman/pym/repoman/modules/scan/options/__init__.py | 3 ++- repoman/pym/repoman/qa_data.py | 4 ++-- repoman/pym/repoman/repos.py | 2 +- repoman/pym/repoman/scanner.py | 3 ++- 35 files changed, 77 insertions(+), 38 deletions(-) diff --git a/repoman/pym/repoman/config.py b/repoman/pym/repoman/config.py index 9da30ed9e..0f2358cd9 100644 --- a/repoman/pym/repoman/config.py +++ b/repoman/pym/repoman/config.py @@ -144,8 +144,11 @@ def load_config(conf_dirs, file_extensions=None, valid_versions=None): if config: if config['version'] not in valid_versions: - raise ConfigError("Invalid file version: %s in: %s\nPlease upgrade repoman: current valid versions: %s" - % (config['version'], filename, valid_versions)) + raise ConfigError( + "Invalid file version: %s in: %s\nPlease upgrade to " + ">=app-portage/repoman-%s, current valid API versions: %s" + % (config['version'], filename, + config['repoman_version'], valid_versions)) result = merge_config(result, config) return result diff --git a/repoman/pym/repoman/main.py b/repoman/pym/repoman/main.py index c1e3b99fe..81e2ff61e 100755 --- a/repoman/pym/repoman/main.py +++ b/repoman/pym/repoman/main.py @@ -47,10 +47,12 @@ os.umask(0o22) LOGLEVEL = logging.WARNING portage.util.initialize_logger(LOGLEVEL) +VALID_VERSIONS = [1,] def repoman_main(argv): config_root = os.environ.get("PORTAGE_CONFIGROOT") repoman_settings = portage.config(config_root=config_root, local_config=False) + repoman_settings.valid_versions = VALID_VERSIONS if repoman_settings.get("NOCOLOR", "").lower() in ("yes", "true") or \ repoman_settings.get('TERM') == 'dumb' or \ @@ -92,6 +94,7 @@ def repoman_main(argv): config_root, portdir, portdir_overlay, repoman_settings, vcs_settings, options, qadata) repoman_settings = repo_settings.repoman_settings + repoman_settings.valid_versions = VALID_VERSIONS # Now set repo_settings vcs_settings.repo_settings = repo_settings diff --git a/repoman/pym/repoman/modules/linechecks/assignment/__init__.py b/repoman/pym/repoman/modules/linechecks/assignment/__init__.py index 6223baa9f..b95a25a74 100644 --- a/repoman/pym/repoman/modules/linechecks/assignment/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/assignment/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "Eapi3EbuildAssignment", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/config.py b/repoman/pym/repoman/modules/linechecks/config.py index bba43a875..bde2e587f 100644 --- a/repoman/pym/repoman/modules/linechecks/config.py +++ b/repoman/pym/repoman/modules/linechecks/config.py @@ -69,7 +69,7 @@ class LineChecksConfig(object): self.infopaths = infopaths elif not self.infopaths: logging.error("LineChecksConfig; Error: No linechecks.yaml files defined") - configs = load_config(self.infopaths, 'yaml') + configs = load_config(self.infopaths, 'yaml', self.repo_settings.repoman_settings.valid_versions) if configs == {}: logging.error("LineChecksConfig: Failed to load a valid 'linechecks.yaml' file at paths: %s", self.infopaths) return False diff --git a/repoman/pym/repoman/modules/linechecks/depend/__init__.py b/repoman/pym/repoman/modules/linechecks/depend/__init__.py index e564948c5..2ea95347e 100644 --- a/repoman/pym/repoman/modules/linechecks/depend/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/depend/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "ImplicitRuntimeDeps", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py b/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py index 8c5f61d49..258683345 100644 --- a/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/deprecated/__init__.py @@ -41,6 +41,7 @@ module_spec = { 'class': "InheritDeprecated", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/do/__init__.py b/repoman/pym/repoman/modules/linechecks/do/__init__.py index a56204794..dc5af701c 100644 --- a/repoman/pym/repoman/modules/linechecks/do/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/do/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "EbuildNonRelativeDosym", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/eapi/__init__.py b/repoman/pym/repoman/modules/linechecks/eapi/__init__.py index e598fdfe3..31993df20 100644 --- a/repoman/pym/repoman/modules/linechecks/eapi/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/eapi/__init__.py @@ -46,6 +46,7 @@ module_spec = { 'class': "Eapi4GoneVars", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/emake/__init__.py b/repoman/pym/repoman/modules/linechecks/emake/__init__.py index 2e930dae8..cecdc5fcf 100644 --- a/repoman/pym/repoman/modules/linechecks/emake/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/emake/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "WantAutoDefaultValue", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/gentoo_header/__init__.py b/repoman/pym/repoman/modules/linechecks/gentoo_header/__init__.py index b80a83ecf..205cc32c2 100644 --- a/repoman/pym/repoman/modules/linechecks/gentoo_header/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/gentoo_header/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "EbuildHeader", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/helpers/__init__.py b/repoman/pym/repoman/modules/linechecks/helpers/__init__.py index e2d12afe4..0f41f0136 100644 --- a/repoman/pym/repoman/modules/linechecks/helpers/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/helpers/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "NoOffsetWithHelpers", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/nested/__init__.py b/repoman/pym/repoman/modules/linechecks/nested/__init__.py index 8eeeccbac..6c8a70a52 100644 --- a/repoman/pym/repoman/modules/linechecks/nested/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/nested/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "EbuildNestedDie", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/patches/__init__.py b/repoman/pym/repoman/modules/linechecks/patches/__init__.py index 67434f911..4fe0fcf5e 100644 --- a/repoman/pym/repoman/modules/linechecks/patches/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/patches/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "EbuildPatches", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/phases/__init__.py b/repoman/pym/repoman/modules/linechecks/phases/__init__.py index 476443b25..b3228c0f7 100644 --- a/repoman/pym/repoman/modules/linechecks/phases/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/phases/__init__.py @@ -29,6 +29,7 @@ module_spec = { 'class': "SrcUnpackPatches", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/portage/__init__.py b/repoman/pym/repoman/modules/linechecks/portage/__init__.py index d390c6054..b9a84b507 100644 --- a/repoman/pym/repoman/modules/linechecks/portage/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/portage/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "PortageInternalVariableAssignment", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/quotes/__init__.py b/repoman/pym/repoman/modules/linechecks/quotes/__init__.py index 6043ab20c..894ef58d2 100644 --- a/repoman/pym/repoman/modules/linechecks/quotes/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/quotes/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "EbuildQuotedA", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/uri/__init__.py b/repoman/pym/repoman/modules/linechecks/uri/__init__.py index a7731e3cc..e19617257 100644 --- a/repoman/pym/repoman/modules/linechecks/uri/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/uri/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "UriUseHttps", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/use/__init__.py b/repoman/pym/repoman/modules/linechecks/use/__init__.py index e5665d2d8..e97b0d61d 100644 --- a/repoman/pym/repoman/modules/linechecks/use/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/use/__init__.py @@ -16,6 +16,7 @@ module_spec = { 'class': "BuiltWithUse", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/useless/__init__.py b/repoman/pym/repoman/modules/linechecks/useless/__init__.py index acc4479f5..5cf978137 100644 --- a/repoman/pym/repoman/modules/linechecks/useless/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/useless/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "EbuildUselessDodoc", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/__init__.py b/repoman/pym/repoman/modules/linechecks/whitespace/__init__.py index ded690ed7..716c5129c 100644 --- a/repoman/pym/repoman/modules/linechecks/whitespace/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/whitespace/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "EbuildBlankLine", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/linechecks/workaround/__init__.py b/repoman/pym/repoman/modules/linechecks/workaround/__init__.py index 0b5aa70c8..425085a5c 100644 --- a/repoman/pym/repoman/modules/linechecks/workaround/__init__.py +++ b/repoman/pym/repoman/modules/linechecks/workaround/__init__.py @@ -22,6 +22,7 @@ module_spec = { 'class': "NoAsNeeded", 'description': doc, }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/depend/__init__.py b/repoman/pym/repoman/modules/scan/depend/__init__.py index bd6905c0b..c3cc0ddeb 100644 --- a/repoman/pym/repoman/modules/scan/depend/__init__.py +++ b/repoman/pym/repoman/modules/scan/depend/__init__.py @@ -28,6 +28,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/directories/__init__.py b/repoman/pym/repoman/modules/scan/directories/__init__.py index 18ca086ce..276bc7ae9 100644 --- a/repoman/pym/repoman/modules/scan/directories/__init__.py +++ b/repoman/pym/repoman/modules/scan/directories/__init__.py @@ -45,6 +45,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/eapi/__init__.py b/repoman/pym/repoman/modules/scan/eapi/__init__.py index f6306b3e1..94759fdd7 100644 --- a/repoman/pym/repoman/modules/scan/eapi/__init__.py +++ b/repoman/pym/repoman/modules/scan/eapi/__init__.py @@ -25,6 +25,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/ebuild/__init__.py b/repoman/pym/repoman/modules/scan/ebuild/__init__.py index 1d8ec1941..328a0d626 100644 --- a/repoman/pym/repoman/modules/scan/ebuild/__init__.py +++ b/repoman/pym/repoman/modules/scan/ebuild/__init__.py @@ -55,6 +55,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/eclasses/__init__.py b/repoman/pym/repoman/modules/scan/eclasses/__init__.py index 9b1f203ce..234ef9fca 100644 --- a/repoman/pym/repoman/modules/scan/eclasses/__init__.py +++ b/repoman/pym/repoman/modules/scan/eclasses/__init__.py @@ -44,6 +44,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/fetch/__init__.py b/repoman/pym/repoman/modules/scan/fetch/__init__.py index d1b4f8d0e..30db3f529 100644 --- a/repoman/pym/repoman/modules/scan/fetch/__init__.py +++ b/repoman/pym/repoman/modules/scan/fetch/__init__.py @@ -29,6 +29,7 @@ module_spec = { }, 'module_runsIn': ['pkgs', 'ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/keywords/__init__.py b/repoman/pym/repoman/modules/scan/keywords/__init__.py index 88ea5aca9..d4c1281bc 100644 --- a/repoman/pym/repoman/modules/scan/keywords/__init__.py +++ b/repoman/pym/repoman/modules/scan/keywords/__init__.py @@ -29,6 +29,7 @@ module_spec = { }, 'module_runsIn': ['pkgs', 'ebuilds', 'final'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/manifest/__init__.py b/repoman/pym/repoman/modules/scan/manifest/__init__.py index 94f0a1f35..9e05c5288 100644 --- a/repoman/pym/repoman/modules/scan/manifest/__init__.py +++ b/repoman/pym/repoman/modules/scan/manifest/__init__.py @@ -26,6 +26,7 @@ module_spec = { }, 'module_runsIn': ['pkgs'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/metadata/__init__.py b/repoman/pym/repoman/modules/scan/metadata/__init__.py index 2d111b4e0..fccde99b5 100644 --- a/repoman/pym/repoman/modules/scan/metadata/__init__.py +++ b/repoman/pym/repoman/modules/scan/metadata/__init__.py @@ -84,6 +84,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/modules/scan/module.py b/repoman/pym/repoman/modules/scan/module.py index 5d34eaef0..28d6668d6 100644 --- a/repoman/pym/repoman/modules/scan/module.py +++ b/repoman/pym/repoman/modules/scan/module.py @@ -10,6 +10,7 @@ import yaml from portage.module import InvalidModuleName, Modules from portage.util import stack_lists +from repoman.config import ConfigError MODULES_PATH = os.path.dirname(__file__) # initial development debug info @@ -20,7 +21,7 @@ class ModuleConfig(object): '''Holds the scan modules configuration information and creates the ordered list of modulles to run''' - def __init__(self, configpaths): + def __init__(self, configpaths, valid_versions=None): '''Module init @param configpaths: ordered list of filepaths to load @@ -37,13 +38,13 @@ class ModuleConfig(object): self.ebuilds_loop = [] self.final_loop = [] self.modules_forced = ['ebuild', 'mtime'] - self.load_configs() + self.load_configs(valid_versions=valid_versions) for loop in ['pkgs', 'ebuilds', 'final']: logging.debug("ModuleConfig; Processing loop %s", loop) setattr(self, '%s_loop' % loop, self._determine_list(loop)) self.linechecks = stack_lists(c['linechecks_modules'].split() for c in self._configs) - def load_configs(self, configpaths=None): + def load_configs(self, configpaths=None, valid_versions=None): '''load the config files in order @param configpaths: ordered list of filepaths to load @@ -62,6 +63,9 @@ class ModuleConfig(object): except IOError as error: logging,error("Failed to load file: %s", inputfile) logging.exception(error) + else: + if configs[-1]['version'] not in valid_versions: + raise ConfigError("Invalid file version: %s in: %s\nPlease upgrade repoman" % (configs['version'], path)) logging.debug("ModuleConfig; completed : %s", path) logging.debug("ModuleConfig; new _configs: %s", configs) self._configs = configs diff --git a/repoman/pym/repoman/modules/scan/options/__init__.py b/repoman/pym/repoman/modules/scan/options/__init__.py index d62e75274..ffce474e5 100644 --- a/repoman/pym/repoman/modules/scan/options/__init__.py +++ b/repoman/pym/repoman/modules/scan/options/__init__.py @@ -24,6 +24,7 @@ module_spec = { }, 'module_runsIn': ['ebuilds'], }, - } + }, + 'version': 1, } diff --git a/repoman/pym/repoman/qa_data.py b/repoman/pym/repoman/qa_data.py index fba0c2d64..11f00d897 100644 --- a/repoman/pym/repoman/qa_data.py +++ b/repoman/pym/repoman/qa_data.py @@ -28,14 +28,14 @@ class QAData(object): self.no_exec = None - def load_repo_config(self, repopaths, options): + def load_repo_config(self, repopaths, options, valid_versions): '''Load the repository repoman qa_data.yml config @param repopaths: list of strings, The path of the repository being scanned This could be a parent repository using the repoman_masters layout.conf variable ''' - qadata = load_config([os.path.join(path,'qa_data.yaml') for path in repopaths], 'yaml') + qadata = load_config([os.path.join(path,'qa_data.yaml') for path in repopaths], 'yaml', valid_versions) if qadata == {}: logging.error("QAData: Failed to load a valid 'qa_data.yaml' file at paths: %s", repopaths) return False diff --git a/repoman/pym/repoman/repos.py b/repoman/pym/repoman/repos.py index e383dbfd1..9c820b08c 100644 --- a/repoman/pym/repoman/repos.py +++ b/repoman/pym/repoman/repos.py @@ -53,7 +53,7 @@ class RepoSettings(object): logging.debug("RepoSettings: init(); load qadata") # load the repo specific configuration self.qadata = qadata - if not self.qadata.load_repo_config(self.masters_list, options): + if not self.qadata.load_repo_config(self.masters_list, options, repoman_settings.valid_versions): logging.error("Aborting...") sys.exit(1) logging.debug("RepoSettings: qadata loaded: %s", qadata.no_exec) diff --git a/repoman/pym/repoman/scanner.py b/repoman/pym/repoman/scanner.py index d61e50131..f203011e4 100644 --- a/repoman/pym/repoman/scanner.py +++ b/repoman/pym/repoman/scanner.py @@ -116,7 +116,8 @@ class Scanner(object): # Initialize the ModuleConfig class here # TODO Add layout.conf masters repository.yml config to the list to load/stack - self.moduleconfig = ModuleConfig(self.repo_settings.masters_list) + self.moduleconfig = ModuleConfig(self.repo_settings.masters_list, + self.repo_settings.repoman_settings.valid_versions) checks = {} # The --echangelog option causes automatic ChangeLog generation,