[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/, repoman/lib/repoman/modules/scan/metadata/, ...

2022-02-09 Thread Sam James
commit: baf79da44e543cc0fd12f64a2c99b49b66727f39
Author: Sam James  gentoo  org>
AuthorDate: Wed Feb  9 10:44:56 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Feb  9 10:45:35 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=baf79da4

*/*: reformat with latest Black 22.1.0

Black is now stable so this shouldn't be needed in future.

Signed-off-by: Sam James  gentoo.org>

 bin/filter-bash-environment.py | 18 ++--
 bin/xattr-helper.py|  2 +-
 lib/portage/_sets/__init__.py  |  2 +-
 lib/portage/package/ebuild/config.py   | 16 --
 lib/portage/tests/bin/test_filter_bash_env.py  |  4 +--
 lib/portage/tests/dep/testAtom.py  | 34 +-
 lib/portage/tests/process/test_PipeLogger.py   | 14 -
 lib/portage/tests/process/test_PopenProcess.py |  2 +-
 .../tests/process/test_PopenProcessBlockingIO.py   |  2 +-
 lib/portage/tests/process/test_poll.py |  2 +-
 lib/portage/tests/util/file_copy/test_copyfile.py  |  6 ++--
 lib/portage/tests/xpak/test_decodeint.py   |  2 +-
 lib/portage/util/backoff.py|  2 +-
 lib/portage/util/lafilefixer.py|  6 ++--
 repoman/lib/repoman/copyrights.py  |  6 ++--
 .../modules/scan/metadata/ebuild_metadata.py   | 14 -
 repoman/lib/repoman/modules/vcs/cvs/changes.py |  2 +-
 17 files changed, 66 insertions(+), 68 deletions(-)

diff --git a/bin/filter-bash-environment.py b/bin/filter-bash-environment.py
index f36df091e..5ec795999 100755
--- a/bin/filter-bash-environment.py
+++ b/bin/filter-bash-environment.py
@@ -6,17 +6,17 @@ import os
 import re
 import sys
 
-here_doc_re = re.compile(br".*\s<<[-]?(\w+)$")
-func_start_re = re.compile(br"^[-\w]+\s*\(\)\s*$")
-func_end_re = re.compile(br"^\}$")
+here_doc_re = re.compile(rb".*\s<<[-]?(\w+)$")
+func_start_re = re.compile(rb"^[-\w]+\s*\(\)\s*$")
+func_end_re = re.compile(rb"^\}$")
 
 var_assign_re = re.compile(
-br'(^|^declare\s+-\S+\s+|^declare\s+|^export\s+)([^=\s]+)=("|\')?.*$'
+rb'(^|^declare\s+-\S+\s+|^declare\s+|^export\s+)([^=\s]+)=("|\')?.*$'
 )
-close_quote_re = re.compile(br'(\\"|"|\')\s*$')
-readonly_re = re.compile(br"^declare\s+-(\S*)r(\S*)\s+")
+close_quote_re = re.compile(rb'(\\"|"|\')\s*$')
+readonly_re = re.compile(rb"^declare\s+-(\S*)r(\S*)\s+")
 # declare without assignment
-var_declare_re = re.compile(br"^declare(\s+-\S+)?\s+([^=\s]+)\s*$")
+var_declare_re = re.compile(rb"^declare(\s+-\S+)?\s+([^=\s]+)\s*$")
 
 
 def have_end_quote(quote, line):
@@ -146,8 +146,8 @@ if __name__ == "__main__":
 var_pattern = os.fsencode(args[0]).split()
 
 # Filter invalid variable names that are not supported by bash.
-var_pattern.append(br"\d.*")
-var_pattern.append(br".*\W.*")
+var_pattern.append(rb"\d.*")
+var_pattern.append(rb".*\W.*")
 
 var_pattern = b"^(" + b"|".join(var_pattern) + b")$"
 filter_bash_environment(re.compile(var_pattern), file_in, file_out)

diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py
index b62a4de44..9d519b61c 100755
--- a/bin/xattr-helper.py
+++ b/bin/xattr-helper.py
@@ -22,7 +22,7 @@ import sys
 from portage.util._xattr import xattr
 
 
-_UNQUOTE_RE = re.compile(br"\\[0-7]{3}")
+_UNQUOTE_RE = re.compile(rb"\\[0-7]{3}")
 _FS_ENCODING = sys.getfilesystemencoding()
 
 

diff --git a/lib/portage/_sets/__init__.py b/lib/portage/_sets/__init__.py
index 15f942b10..4d7b2c3ec 100644
--- a/lib/portage/_sets/__init__.py
+++ b/lib/portage/_sets/__init__.py
@@ -181,7 +181,7 @@ class SetConfig:
 import random
 
 while setname in parser.sections():
-setname = "%08d" % random.randint(0, 10 ** 10)
+setname = "%08d" % random.randint(0, 10**10)
 
 parser.add_section(setname)
 for k, v in options.items():

diff --git a/lib/portage/package/ebuild/config.py 
b/lib/portage/package/ebuild/config.py
index 8fe51784e..99fd2c31e 100644
--- a/lib/portage/package/ebuild/config.py
+++ b/lib/portage/package/ebuild/config.py
@@ -3317,16 +3317,12 @@ class config:
 mydict.pop("EROOT", None)
 mydict.pop("ESYSROOT", None)
 
-if (
-phase
-not in (
-"pretend",
-"setup",
-"preinst",
-"postinst",
-)
-or not eapi_exports_replace_vars(eapi)
-):
+if phase not in (
+"pretend",
+"setup",
+"preinst",
+"postinst",
+) or not eapi_exports_replace_vars(eapi):
 mydict.pop("REPLACING_VERSIONS", None)
 
 if phase not in ("prerm", "postrm") or not 
eapi_exports_replace_vars(eapi):

diff --git a/lib/portage/tests/bin/test_filter_bash_env.py 
b/lib/portage/tests/bin/test_filter_bash_env.py
index 7f0bdf52f..501420560 100644

[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/scan/metadata/

2022-01-29 Thread Ulrich Müller
commit: 0ec131cc84893f429da2c4486545a6c93d3447c0
Author: Ulrich Müller  gentoo  org>
AuthorDate: Tue Jan 25 16:41:18 2022 +
Commit: Ulrich Müller  gentoo  org>
CommitDate: Tue Jan 25 16:41:18 2022 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=0ec131cc

repoman: Remove http compatibility code for metadata DTD

Commit 3950d76df says: "The http:// compat can be removed once the
Gentoo repository is updated to use https:// everywhere."

Bug: https://bugs.gentoo.org/552720
Signed-off-by: Ulrich Müller  gentoo.org>

 repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py 
b/repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py
index b4e0ee933..0fb97a0df 100644
--- a/repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py
+++ b/repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py
@@ -127,7 +127,7 @@ class PkgMetadata(ScanBase, USEFlagChecks):
 )
 else:
 doctype_system = _metadata_xml.docinfo.system_url
-if doctype_system.replace("http://;, "https://;) != 
metadata_dtd_uri:
+if doctype_system != metadata_dtd_uri:
 if doctype_system is None:
 system_problem = "but it is undefined"
 else:



[gentoo-commits] proj/portage:master commit in: repoman/

2021-06-05 Thread Zac Medico
commit: b18d15009ba91ce2603f298290fccbe94d519ced
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Jun  5 20:55:20 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Jun  5 20:55:46 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=b18d1500

repoman/setup.py: prefer setuptools over distutils (bug 794166)

Bug: https://bugs.gentoo.org/794166
Signed-off-by: Zac Medico  gentoo.org>

 repoman/setup.py | 40 +++-
 1 file changed, 27 insertions(+), 13 deletions(-)

diff --git a/repoman/setup.py b/repoman/setup.py
index 8a926..f8a019b24 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -1,19 +1,33 @@
 #!/usr/bin/env python
-# Copyright 1998-2020 Gentoo Authors
+# Copyright 1998-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-from distutils.core import setup, Command
-from distutils.command.build import build
-from distutils.command.build_scripts import build_scripts
-from distutils.command.clean import clean
-from distutils.command.install import install
-from distutils.command.install_data import install_data
-from distutils.command.install_lib import install_lib
-from distutils.command.install_scripts import install_scripts
-from distutils.command.sdist import sdist
-from distutils.dep_util import newer
-from distutils.dir_util import mkpath, remove_tree
-from distutils.util import change_root, subst_vars
+try:
+   from setuptools.core import setup, Command
+   from setuptools.command.build import build
+   from setuptools.command.build_scripts import build_scripts
+   from setuptools.command.clean import clean
+   from setuptools.command.install import install
+   from setuptools.command.install_data import install_data
+   from setuptools.command.install_lib import install_lib
+   from setuptools.command.install_scripts import install_scripts
+   from setuptools.command.sdist import sdist
+   from setuptools.dep_util import newer
+   from setuptools.dir_util import mkpath, remove_tree
+   from setuptools.util import change_root, subst_vars
+except ImportError:
+   from distutils.core import setup, Command
+   from distutils.command.build import build
+   from distutils.command.build_scripts import build_scripts
+   from distutils.command.clean import clean
+   from distutils.command.install import install
+   from distutils.command.install_data import install_data
+   from distutils.command.install_lib import install_lib
+   from distutils.command.install_scripts import install_scripts
+   from distutils.command.sdist import sdist
+   from distutils.dep_util import newer
+   from distutils.dir_util import mkpath, remove_tree
+   from distutils.util import change_root, subst_vars
 
 import codecs
 import collections



[gentoo-commits] proj/portage:master commit in: repoman/

2021-04-19 Thread Zac Medico
commit: a6762ba01343311670579d98a39732b494454f18
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Apr 19 07:51:38 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Apr 19 08:13:07 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a6762ba0

repoman/setup.py: update sdist for xz support

Signed-off-by: Zac Medico  gentoo.org>

 repoman/setup.py | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/repoman/setup.py b/repoman/setup.py
index e99189d06..8a926 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -337,10 +337,13 @@ class x_install_scripts(install_scripts):
 
 
 class x_sdist(sdist):
-   """ sdist defaulting to .tar.bz2 format, and archive files owned by 
root """
+   """ sdist defaulting to .tar.xz format, and archive files owned by root 
"""
+
+   def initialize_options(self):
+   super().initialize_options()
+   self.formats = ['xztar']
 
def finalize_options(self):
-   self.formats = ['bztar']
if self.owner is None:
self.owner = 'root'
if self.group is None:



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/tests/simple/

2021-04-11 Thread Zac Medico
commit: 2eb3ca092a528e0722e0ca32f616836ed8039936
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Apr 11 17:47:21 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Apr 11 18:04:22 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=2eb3ca09

SimpleRepomanTestCase: update portage.const.EPREFIX after fork

Update portage.const.EPREFIX in each RepomanRun fork, since
the portage.const PORTAGE_OVERRIDE_EPREFIX logic only executes
when the module is first loaded in the parent process.

Fixes: ba58bc1ae12a ("SimpleRepomanTestCase: collect results from subprocesses")
Bug: https://bugs.gentoo.org/779508
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/tests/simple/test_simple.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/repoman/lib/repoman/tests/simple/test_simple.py 
b/repoman/lib/repoman/tests/simple/test_simple.py
index c4a864ff8..9ec01df3b 100644
--- a/repoman/lib/repoman/tests/simple/test_simple.py
+++ b/repoman/lib/repoman/tests/simple/test_simple.py
@@ -62,6 +62,7 @@ class RepomanRun(types.SimpleNamespace):
def _subprocess(args, cwd, env, expected, debug):
os.chdir(cwd)
os.environ.update(env)
+   portage.const.EPREFIX = env["PORTAGE_OVERRIDE_EPREFIX"]
if debug:
args = ["-"] + args
repoman_vars = _repoman_init(["repoman"] + args)



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/tests/simple/, repoman/lib/repoman/

2021-04-04 Thread Zac Medico
commit: e29177fcd2950199afa4f83673c0771afb261123
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Apr  4 11:18:01 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Apr  4 11:29:40 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=e29177fc

repoman: fix --version TypeError

Bug: https://bugs.gentoo.org/779967
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/main.py | 2 +-
 repoman/lib/repoman/tests/simple/test_simple.py | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/repoman/lib/repoman/main.py b/repoman/lib/repoman/main.py
index 78be31df3..d84abf3ae 100755
--- a/repoman/lib/repoman/main.py
+++ b/repoman/lib/repoman/main.py
@@ -82,7 +82,7 @@ def _repoman_init(argv):
 
if options.version:
print("Repoman", VERSION, "(portage-%s)" % portage.VERSION)
-   return _repoman_main_vars(exitcode=0)
+   return _repoman_main_vars(None, 0, None, None, None, None, None)
 
logger = logging.getLogger()
 

diff --git a/repoman/lib/repoman/tests/simple/test_simple.py 
b/repoman/lib/repoman/tests/simple/test_simple.py
index 60c62acc1..c4a864ff8 100644
--- a/repoman/lib/repoman/tests/simple/test_simple.py
+++ b/repoman/lib/repoman/tests/simple/test_simple.py
@@ -66,7 +66,7 @@ class RepomanRun(types.SimpleNamespace):
args = ["-"] + args
repoman_vars = _repoman_init(["repoman"] + args)
if repoman_vars.exitcode is not None:
-   return repoman_vars.exitcode
+   return {"returncode": repoman_vars.exitcode}
result = _repoman_scan(*repoman_vars)
returncode = _handle_result(*repoman_vars, result)
qawarnings = repoman_vars.vcs_settings.qatracker.qawarnings
@@ -313,6 +313,7 @@ pkg_preinst() {
}
 
git_test = (
+   ("", RepomanRun(args=["--version"])),
("", RepomanRun(args=["manifest"])),
("", git_cmd + ("config", "--global", "user.name", 
committer_name,)),
("", git_cmd + ("config", "--global", "user.email", 
committer_email,)),



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/tests/simple/

2021-03-31 Thread Zac Medico
commit: b09b4071151d8e3a81f3576843d00f88eb407799
Author: Zac Medico  gentoo  org>
AuthorDate: Wed Mar 31 07:45:23 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Mar 31 07:46:15 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=b09b4071

SimpleRepomanTestCase: use - for debug mode

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/tests/simple/test_simple.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/repoman/lib/repoman/tests/simple/test_simple.py 
b/repoman/lib/repoman/tests/simple/test_simple.py
index 3a699a708..60c62acc1 100644
--- a/repoman/lib/repoman/tests/simple/test_simple.py
+++ b/repoman/lib/repoman/tests/simple/test_simple.py
@@ -62,6 +62,8 @@ class RepomanRun(types.SimpleNamespace):
def _subprocess(args, cwd, env, expected, debug):
os.chdir(cwd)
os.environ.update(env)
+   if debug:
+   args = ["-"] + args
repoman_vars = _repoman_init(["repoman"] + args)
if repoman_vars.exitcode is not None:
return repoman_vars.exitcode



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/scan/

2021-03-31 Thread Zac Medico
commit: d04486767159f9dba443e7a9d1a6c3854db00400
Author: Zac Medico  gentoo  org>
AuthorDate: Wed Mar 31 07:30:51 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Mar 31 07:33:50 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=d0448676

repoman: fix ModuleConfig _not_installed path (bug 779055)

Bug: https://bugs.gentoo.org/779055
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/modules/scan/module.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/repoman/lib/repoman/modules/scan/module.py 
b/repoman/lib/repoman/modules/scan/module.py
index 3321cb224..41c1becfc 100644
--- a/repoman/lib/repoman/modules/scan/module.py
+++ b/repoman/lib/repoman/modules/scan/module.py
@@ -31,9 +31,9 @@ class ModuleConfig:
if repository_modules:
self.configpaths = [os.path.join(path, 
'repository.yaml') for path in configpaths]
elif _not_installed:
-   self.configpaths = 
[os.path.realpath(os.path.join(os.path.dirname(
+   self.configpaths = [os.path.realpath(os.path.join(

os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(
-   os.path.dirname(__file__)), 
'repoman/cnf/repository/repository.yaml'))]
+   os.path.dirname(__file__), 
'cnf/repository/repository.yaml'))]
else:
self.configpaths = [os.path.join(portage.const.EPREFIX 
or '/',
'usr/share/repoman/repository/repository.yaml')]



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2021-03-31 Thread Zac Medico
commit: 1b0cbed41a380e9603b12b1f1dec1e6dd42a8aeb
Author: Zac Medico  gentoo  org>
AuthorDate: Wed Mar 31 06:33:04 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Mar 31 06:33:32 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=1b0cbed4

repoman/lib/repoman/argparser.py: W0611: Unused import sys (unused-import)

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/argparser.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/repoman/lib/repoman/argparser.py b/repoman/lib/repoman/argparser.py
index 47215693c..495fdfa60 100644
--- a/repoman/lib/repoman/argparser.py
+++ b/repoman/lib/repoman/argparser.py
@@ -6,7 +6,6 @@
 
 import argparse
 import logging
-import sys
 
 # import our initialized portage instance
 from repoman._portage import portage



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2021-03-31 Thread Zac Medico
commit: 3964690033e37c097b7ba2e207c0962144761757
Author: Zac Medico  gentoo  org>
AuthorDate: Wed Mar 31 06:25:04 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Mar 31 06:26:56 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=39646900

repoman: correct parse_args local sys.argv reference

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/argparser.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/repoman/lib/repoman/argparser.py b/repoman/lib/repoman/argparser.py
index 6d545ccca..47215693c 100644
--- a/repoman/lib/repoman/argparser.py
+++ b/repoman/lib/repoman/argparser.py
@@ -1,5 +1,5 @@
 # repoman: Argument parser
-# Copyright 2007-2019 Gentoo Authors
+# Copyright 2007-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 """This module contains functions used in Repoman to parse CLI arguments."""
@@ -222,7 +222,7 @@ def parse_args(argv, repoman_default_opts):
if not opts.ignore_default_opts:
default_opts = util.shlex_split(repoman_default_opts)
if default_opts:
-   opts = parser.parse_args(default_opts + sys.argv[1:])
+   opts = parser.parse_args(default_opts + argv[1:])
 
args = []
if opts.mode is not None:



[gentoo-commits] proj/portage:master commit in: repoman/

2021-03-29 Thread Zac Medico
commit: 285d3ae987a079f32b909c6e6eddde9bc45a4a25
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Mar 29 07:39:28 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Mar 29 07:45:59 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=285d3ae9

repoman: Update for a repoman-3.0.3 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 6 ++
 repoman/setup.py  | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index a09845b79..df34803cc 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,12 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-3.0.3
+==
+* Bug Fixes:
+- Bug 608664 variable.phase check like pkgcheck VariableScopeCheck
+- Bug 692486 Change message for preserve_old_lib
+
 repoman-3.0.2
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index a405e7816..e99189d06 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -448,7 +448,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '3.0.2',
+   version = '3.0.3',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/man/, repoman/cnf/repository/, repoman/cnf/qa_data/, ...

2021-03-28 Thread Zac Medico
commit: 15cbe87076b512b318fac1729ec94e6d6674a95a
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Mar 27 23:15:16 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Mar 29 04:46:41 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=15cbe870

repoman: add variable.phase check like pkgcheck VariableScopeCheck (bug 608664)

The variable.phase check is inspired by pkgcheck's VariableScopeCheck,
and uses essentially the same PMS data to drive the check.

References:
- https://projects.gentoo.org/pms/7/pms.html#x1-10900011.1
- 
https://pkgcore.github.io/pkgcheck/_modules/pkgcheck/checks/codingstyle.html#VariableScopeCheck
- https://bugs.gentoo.org/775191

Bug: https://bugs.gentoo.org/608664
Signed-off-by: Zac Medico  gentoo.org>

 repoman/cnf/qa_data/qa_data.yaml   |   1 +
 repoman/cnf/repository/qa_data.yaml|   1 +
 repoman/cnf/repository/repository.yaml |   1 +
 .../repoman/modules/linechecks/phases/__init__.py  |   6 +
 .../lib/repoman/modules/linechecks/phases/phase.py | 132 +++--
 repoman/lib/repoman/tests/simple/test_simple.py|  28 -
 repoman/man/repoman.1  |   5 +-
 7 files changed, 162 insertions(+), 12 deletions(-)

diff --git a/repoman/cnf/qa_data/qa_data.yaml b/repoman/cnf/qa_data/qa_data.yaml
index 29a3d6e9f..530c8c806 100644
--- a/repoman/cnf/qa_data/qa_data.yaml
+++ b/repoman/cnf/qa_data/qa_data.yaml
@@ -129,6 +129,7 @@ qahelp:
 obsolete: "The ebuild makes use of an obsolete construct"
 variable:
 invalidchar: "A variable contains an invalid character that is not 
part of the ASCII character set"
+phase: "Variable referenced found within scope of incorrect ebuild 
phase as specified by PMS"
 readonly: "Assigning a readonly variable"
 usedwithhelpers: "Ebuild uses D, ROOT, BROOT, ED, EROOT or EPREFIX 
with helpers"
 virtual:

diff --git a/repoman/cnf/repository/qa_data.yaml 
b/repoman/cnf/repository/qa_data.yaml
index 3fe6b53d5..2249000c3 100644
--- a/repoman/cnf/repository/qa_data.yaml
+++ b/repoman/cnf/repository/qa_data.yaml
@@ -80,6 +80,7 @@ qawarnings:
 - usage.obsolete
 - upstream.workaround
 - uri.https
+- variable.phase
 - virtual.suspect
 - wxwidgets.eclassnotused
 

diff --git a/repoman/cnf/repository/repository.yaml 
b/repoman/cnf/repository/repository.yaml
index ad00d18c1..dbc1decaa 100644
--- a/repoman/cnf/repository/repository.yaml
+++ b/repoman/cnf/repository/repository.yaml
@@ -61,6 +61,7 @@ linechecks_modules:
 emakeparallel
 srccompileeconf
 srcunpackpatches
+pmsvariablerefphasescope
 portageinternal
 portageinternalvariableassignment
 quote

diff --git a/repoman/lib/repoman/modules/linechecks/phases/__init__.py 
b/repoman/lib/repoman/modules/linechecks/phases/__init__.py
index 686c675d2..e166b31a3 100644
--- a/repoman/lib/repoman/modules/linechecks/phases/__init__.py
+++ b/repoman/lib/repoman/modules/linechecks/phases/__init__.py
@@ -29,6 +29,12 @@ module_spec = {
'class': "SrcUnpackPatches",
'description': doc,
},
+   'pmsvariablerefphasescope-check': {
+   'name': "pmsvariablerefphasescope",
+   'sourcefile': "phase",
+   'class': "PMSVariableReference",
+   'description': doc,
+   },
},
'version': 1,
 }

diff --git a/repoman/lib/repoman/modules/linechecks/phases/phase.py 
b/repoman/lib/repoman/modules/linechecks/phases/phase.py
index 74cf4608f..433e93601 100644
--- a/repoman/lib/repoman/modules/linechecks/phases/phase.py
+++ b/repoman/lib/repoman/modules/linechecks/phases/phase.py
@@ -1,7 +1,19 @@
 
+import fnmatch
 import re
-
-from portage.eapi import eapi_has_src_prepare_and_src_configure
+import types
+
+from portage.eapi import (
+   eapi_has_broot,
+   eapi_has_sysroot,
+   eapi_has_src_prepare_and_src_configure,
+   eapi_exports_AA,
+   eapi_exports_replace_vars,
+   eapi_exports_ECLASSDIR,
+   eapi_exports_PORTDIR,
+   eapi_supports_prefix,
+   eapi_exports_merge_type,
+)
 from repoman.modules.linechecks.base import LineCheck
 
 
@@ -9,11 +21,22 @@ class PhaseCheck(LineCheck):
""" basic class for function detection """
 
func_end_re = re.compile(r'^\}$')
-   phases_re = re.compile('(%s)' % '|'.join((
-   'pkg_pretend', 'pkg_setup', 'src_unpack', 'src_prepare',
-   'src_configure', 'src_compile', 'src_test', 'src_install',
-   'pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm',
-   'pkg_config')))
+   phase_funcs = (
+   'pkg_pretend',
+   'pkg_setup',
+   'src_unpack',
+   'src_prepare',
+   'src_configure',
+   'src_compile',
+   'src_test',
+ 

[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/tests/simple/

2021-03-28 Thread Zac Medico
commit: f84d0e45ca4cda2674d3f47f51729a6a8d0c7600
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Mar 29 04:18:57 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Mar 29 04:26:23 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=f84d0e45

SimpleRepomanTestCase: compare QATracker results to expected values

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/tests/simple/test_simple.py | 29 +++--
 1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/repoman/lib/repoman/tests/simple/test_simple.py 
b/repoman/lib/repoman/tests/simple/test_simple.py
index 2439c936b..e64ba4f07 100644
--- a/repoman/lib/repoman/tests/simple/test_simple.py
+++ b/repoman/lib/repoman/tests/simple/test_simple.py
@@ -1,6 +1,7 @@
 # Copyright 2011-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+import collections
 import subprocess
 import time
 import types
@@ -65,7 +66,20 @@ class RepomanRun(types.SimpleNamespace):
return repoman_vars.exitcode
result = _repoman_scan(*repoman_vars)
returncode = _handle_result(*repoman_vars, result)
-   return {"returncode": returncode}
+   qawarnings = repoman_vars.vcs_settings.qatracker.qawarnings
+   warns = collections.defaultdict(list)
+   fails = collections.defaultdict(list)
+   for qacat, issues in 
repoman_vars.vcs_settings.qatracker.fails.items():
+   if qacat in qawarnings:
+   warns[qacat].extend(issues)
+   else:
+   fails[qacat].extend(issues)
+   result = {"returncode": returncode}
+   if fails:
+   result["fails"] = fails
+   if warns:
+   result["warns"] = warns
+   return result
 
 
 class SimpleRepomanTestCase(TestCase):
@@ -122,9 +136,9 @@ class SimpleRepomanTestCase(TestCase):
self.assertFalse(True, skip_reason)
return
 
-   copyright_header = """# Copyright 1999-%s Gentoo Foundation
+   copyright_header = """# Copyright 1999-%s Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
-# $Header: $
+
 """ % time.gmtime().tm_year
 
repo_configs = {
@@ -278,6 +292,7 @@ class SimpleRepomanTestCase(TestCase):
 
committer_name = "Gentoo Dev"
committer_email = "gentoo-...@gentoo.org"
+   expected_warnings = {"returncode": 0}
 
git_test = (
("", RepomanRun(args=["manifest"])),
@@ -286,14 +301,14 @@ class SimpleRepomanTestCase(TestCase):
("", git_cmd + ("init-db",)),
("", git_cmd + ("add", ".")),
("", git_cmd + ("commit", "-a", "-m", "add whole 
repo")),
-   ("", RepomanRun(args=["full", "-d"])),
-   ("", RepomanRun(args=["full", "--include-profiles", 
"default/linux/x86/test_profile"])),
+   ("", RepomanRun(args=["full", "-d"], 
expected=expected_warnings)),
+   ("", RepomanRun(args=["full", "--include-profiles", 
"default/linux/x86/test_profile"], expected=expected_warnings)),
("", cp_cmd + (test_ebuild, test_ebuild[:-8] + 
"2.ebuild")),
("", git_cmd + ("add", test_ebuild[:-8] + "2.ebuild")),
-   ("", RepomanRun(args=["commit", "-m", "cat/pkg: bump to 
version 2"])),
+   ("", RepomanRun(args=["commit", "-m", "cat/pkg: bump to 
version 2"], expected=expected_warnings)),
("", cp_cmd + (test_ebuild, test_ebuild[:-8] + 
"3.ebuild")),
("", git_cmd + ("add", test_ebuild[:-8] + "3.ebuild")),
-   ("dev-libs", RepomanRun(args=["commit", "-m", "cat/pkg: 
bump to version 3"])),
+   ("dev-libs", RepomanRun(args=["commit", "-m", "cat/pkg: 
bump to version 3"], expected=expected_warnings)),
("", cp_cmd + (test_ebuild, test_ebuild[:-8] + 
"4.ebuild")),
("", git_cmd + ("add", test_ebuild[:-8] + "4.ebuild")),
("dev-libs/A", RepomanRun(args=["commit", "-m", 
"cat/pkg: bump to version 4"])),



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/tests/simple/

2021-03-28 Thread Zac Medico
commit: ba58bc1ae12a59c5a5a7c2cd8ed747084c5b0fe1
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Mar 28 15:43:54 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Mar 29 00:19:50 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=ba58bc1a

SimpleRepomanTestCase: collect results from subprocesses

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/tests/simple/test_simple.py | 73 +++--
 1 file changed, 67 insertions(+), 6 deletions(-)

diff --git a/repoman/lib/repoman/tests/simple/test_simple.py 
b/repoman/lib/repoman/tests/simple/test_simple.py
index a4cdf5207..2439c936b 100644
--- a/repoman/lib/repoman/tests/simple/test_simple.py
+++ b/repoman/lib/repoman/tests/simple/test_simple.py
@@ -3,6 +3,7 @@
 
 import subprocess
 import time
+import types
 
 from repoman._portage import portage
 from portage import os
@@ -10,13 +11,63 @@ from portage.process import find_binary
 from portage.tests.resolver.ResolverPlayground import ResolverPlayground
 from portage.util import ensure_dirs
 from portage.util.futures import asyncio
+from portage.util.futures._asyncio.streams import _reader
+from portage.util._async.AsyncFunction import AsyncFunction
 
 # pylint: disable=ungrouped-imports
 from repoman import REPOMAN_BASE_PATH
 from repoman.copyrights import update_copyright_year
+from repoman.main import _repoman_init, _repoman_scan, _handle_result
 from repoman.tests import TestCase
 
 
+class RepomanRun(types.SimpleNamespace):
+   async def run(self):
+   self.expected = getattr(self, "expected", None) or 
{"returncode": 0}
+   if self.debug:
+   fd_pipes = {}
+   pr = None
+   pw = None
+   else:
+   pr, pw = os.pipe()
+   fd_pipes = {1: pw, 2: pw}
+   pr = open(pr, "rb", 0)
+
+   proc = AsyncFunction(
+   scheduler=asyncio.get_event_loop(),
+   target=self._subprocess,
+   args=(self.args, self.cwd, self.env, self.expected, 
self.debug),
+   fd_pipes=fd_pipes,
+   )
+
+   proc.start()
+   if pw is not None:
+   os.close(pw)
+
+   await proc.async_wait()
+
+   if pr is None:
+   stdio = None
+   else:
+   stdio = await _reader(pr)
+
+   self.result = {
+   "stdio": stdio,
+   "result": proc.result,
+   }
+
+   @staticmethod
+   def _subprocess(args, cwd, env, expected, debug):
+   os.chdir(cwd)
+   os.environ.update(env)
+   repoman_vars = _repoman_init(["repoman"] + args)
+   if repoman_vars.exitcode is not None:
+   return repoman_vars.exitcode
+   result = _repoman_scan(*repoman_vars)
+   returncode = _handle_result(*repoman_vars, result)
+   return {"returncode": returncode}
+
+
 class SimpleRepomanTestCase(TestCase):
 
def testCopyrightUpdate(self):
@@ -229,23 +280,23 @@ class SimpleRepomanTestCase(TestCase):
committer_email = "gentoo-...@gentoo.org"
 
git_test = (
-   ("", repoman_cmd + ("manifest",)),
+   ("", RepomanRun(args=["manifest"])),
("", git_cmd + ("config", "--global", "user.name", 
committer_name,)),
("", git_cmd + ("config", "--global", "user.email", 
committer_email,)),
("", git_cmd + ("init-db",)),
("", git_cmd + ("add", ".")),
("", git_cmd + ("commit", "-a", "-m", "add whole 
repo")),
-   ("", repoman_cmd + ("full", "-d")),
-   ("", repoman_cmd + ("full", "--include-profiles", 
"default/linux/x86/test_profile")),
+   ("", RepomanRun(args=["full", "-d"])),
+   ("", RepomanRun(args=["full", "--include-profiles", 
"default/linux/x86/test_profile"])),
("", cp_cmd + (test_ebuild, test_ebuild[:-8] + 
"2.ebuild")),
("", git_cmd + ("add", test_ebuild[:-8] + "2.ebuild")),
-   ("", repoman_cmd + ("commit", "-m", "cat/pkg: bump to 
version 2")),
+   ("", RepomanRun(args=["commit", "-m", "cat/pkg: bump to 
version 2"])),
("", cp_cmd + (test_ebuild, test_ebuild[:-8] + 
"3.ebuild")),
("", git_cmd + ("add", test_ebuild[:-8] + "3.ebuild")),
-   ("dev-libs", repoman_cmd + ("commit", "-m", "cat/pkg: 
bump to version 3")),
+   ("dev-libs", RepomanRun(args=["commit", "-m", "cat/pkg: 
bump to version 3"])),
("", 

[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2021-03-28 Thread Zac Medico
commit: 050592ba4be9eac4af714a8c34f9f89984962b28
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Mar 28 22:54:48 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Mar 28 22:58:18 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=050592ba

repoman: change sys.exit in actions.py to return in main.py

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/actions.py | 1 -
 repoman/lib/repoman/main.py| 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
index 0f89572b9..351df07be 100644
--- a/repoman/lib/repoman/actions.py
+++ b/repoman/lib/repoman/actions.py
@@ -307,7 +307,6 @@ the whole commit message to abort.
utilities.repoman_sez(
"\"Make your QA payment on time"
" and you'll never see the likes of 
me.\"\n")
-   sys.exit(1)
 
 
def _fail(self, result, can_force):

diff --git a/repoman/lib/repoman/main.py b/repoman/lib/repoman/main.py
index a694410d7..78be31df3 100755
--- a/repoman/lib/repoman/main.py
+++ b/repoman/lib/repoman/main.py
@@ -222,5 +222,7 @@ def _handle_result(can_force, exitcode, options, qadata, 
repo_settings, scanner,
if actions.inform(can_force.get(), result):
# perform any other actions
actions.perform(qa_output)
+   elif result['fail']:
+   return 1
 
return 0



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/tests/simple/

2021-03-28 Thread Zac Medico
commit: c9ffa3aa5fab400a3232cfa46c2e194d874ba649
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Mar 28 19:42:25 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Mar 28 19:52:04 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=c9ffa3aa

SimpleRepomanTestCase: use asyncio

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/tests/simple/test_simple.py | 89 ++---
 1 file changed, 66 insertions(+), 23 deletions(-)

diff --git a/repoman/lib/repoman/tests/simple/test_simple.py 
b/repoman/lib/repoman/tests/simple/test_simple.py
index 2448bb117..a4cdf5207 100644
--- a/repoman/lib/repoman/tests/simple/test_simple.py
+++ b/repoman/lib/repoman/tests/simple/test_simple.py
@@ -2,15 +2,14 @@
 # Distributed under the terms of the GNU General Public License v2
 
 import subprocess
-import sys
 import time
 
 from repoman._portage import portage
 from portage import os
-from portage import _unicode_decode
 from portage.process import find_binary
 from portage.tests.resolver.ResolverPlayground import ResolverPlayground
 from portage.util import ensure_dirs
+from portage.util.futures import asyncio
 
 # pylint: disable=ungrouped-imports
 from repoman import REPOMAN_BASE_PATH
@@ -169,6 +168,39 @@ class SimpleRepomanTestCase(TestCase):
 
playground = ResolverPlayground(ebuilds=ebuilds,
profile=profile, repo_configs=repo_configs, debug=debug)
+
+   loop = asyncio._wrap_loop()
+   loop.run_until_complete(
+   asyncio.ensure_future(
+   self._async_test_simple(
+   playground,
+   metadata_xml_files,
+   profiles,
+   profile,
+   licenses,
+   arch_list,
+   use_desc,
+   metadata_xsd,
+   copyright_header,
+   debug,
+   ),
+   loop=loop,
+   )
+   )
+
+   async def _async_test_simple(
+   self,
+   playground,
+   metadata_xml_files,
+   profiles,
+   profile,
+   licenses,
+   arch_list,
+   use_desc,
+   metadata_xsd,
+   copyright_header,
+   debug,
+   ):
settings = playground.settings
eprefix = settings["EPREFIX"]
eroot = settings["EROOT"]
@@ -284,39 +316,50 @@ class SimpleRepomanTestCase(TestCase):
 
for cwd in ("", "dev-libs", "dev-libs/A", "dev-libs/B"):
abs_cwd = os.path.join(test_repo_symlink, cwd)
-   proc = subprocess.Popen(repoman_cmd + ("full",),
-   cwd=abs_cwd, env=env, stdout=stdout)
+
+   proc = await asyncio.create_subprocess_exec(
+   *(repoman_cmd + ("full",)),
+   env=env,
+   stderr=None,
+   stdout=stdout,
+   cwd=abs_cwd
+   )
 
if debug:
-   proc.wait()
+   await proc.wait()
else:
-   output = proc.stdout.readlines()
-   proc.wait()
-   proc.stdout.close()
+   output, _err = await proc.communicate()
+   await proc.wait()
if proc.returncode != os.EX_OK:
-   for line in output:
-   
sys.stderr.write(_unicode_decode(line))
+   portage.writemsg(output)
 
-   self.assertEqual(os.EX_OK, proc.returncode,
-   "repoman failed in %s" % (cwd,))
+   self.assertEqual(
+   os.EX_OK, proc.returncode, "repoman 
failed in %s" % (cwd,)
+   )
 
if git_binary is not None:
for cwd, cmd in git_test:
abs_cwd = 
os.path.join(test_repo_symlink, cwd)
-   proc = subprocess.Popen(cmd,
-   

[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2021-03-28 Thread Zac Medico
commit: 3d7ed631ecc2f4f75beab3d6d17b75d6fc0ecd3c
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Mar 28 15:43:54 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Mar 28 18:42:07 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=3d7ed631

repoman: split up repoman_main

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/main.py | 39 ---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/repoman/lib/repoman/main.py b/repoman/lib/repoman/main.py
index dc791ad71..a694410d7 100755
--- a/repoman/lib/repoman/main.py
+++ b/repoman/lib/repoman/main.py
@@ -3,6 +3,7 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+import collections
 import io
 import logging
 import sys
@@ -47,7 +48,26 @@ portage.util.initialize_logger(LOGLEVEL)
 
 VALID_VERSIONS = [1,]
 
+_repoman_main_vars = collections.namedtuple("_repoman_main_vars", (
+   "can_force",
+   "exitcode",
+   "options",
+   "qadata",
+   "repo_settings",
+   "scanner",
+   "vcs_settings",
+))
+
+
 def repoman_main(argv):
+   repoman_vars = _repoman_init(argv)
+   if repoman_vars.exitcode is not None:
+   return repoman_vars.exitcode
+   result = _repoman_scan(*repoman_vars)
+   return _handle_result(*repoman_vars, result)
+
+
+def _repoman_init(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
@@ -62,7 +82,7 @@ def repoman_main(argv):
 
if options.version:
print("Repoman", VERSION, "(portage-%s)" % portage.VERSION)
-   sys.exit(0)
+   return _repoman_main_vars(exitcode=0)
 
logger = logging.getLogger()
 
@@ -75,10 +95,15 @@ def repoman_main(argv):
# something other than a QA issue) makes it impossible to
# commit (like if Manifest generation fails).
can_force = ExtendedFuture(True)
+   repo_settings, vcs_settings, scanner, qadata = _create_scanner(options, 
can_force, config_root, repoman_settings)
+   return _repoman_main_vars(can_force, None, options, qadata, 
repo_settings, scanner, vcs_settings)
+
+
+def _create_scanner(options, can_force, config_root, repoman_settings):
 
portdir, portdir_overlay, mydir = 
utilities.FindPortdir(repoman_settings)
if portdir is None:
-   sys.exit(1)
+   return (None, None, None, None)
 
myreporoot = os.path.basename(portdir_overlay)
myreporoot += mydir[len(portdir_overlay):]
@@ -117,6 +142,10 @@ def repoman_main(argv):
# Perform the main checks
scanner = Scanner(repo_settings, myreporoot, config_root, options,
vcs_settings, mydir, env)
+   return repo_settings, vcs_settings, scanner, qadata
+
+
+def _repoman_scan(can_force, exitcode, options, qadata, repo_settings, 
scanner, vcs_settings):
scanner.scan_pkgs(can_force)
 
if options.if_modified == "y" and len(scanner.effective_scanlist) < 1:
@@ -142,6 +171,10 @@ def repoman_main(argv):
(result['warn'] and not (options.quiet or options.mode == 
"scan")):
result['full'] = 0
 
+   return result
+
+
+def _handle_result(can_force, exitcode, options, qadata, repo_settings, 
scanner, vcs_settings, result):
commitmessage = None
if options.commitmsg:
commitmessage = options.commitmsg
@@ -190,4 +223,4 @@ def repoman_main(argv):
# perform any other actions
actions.perform(qa_output)
 
-   sys.exit(0)
+   return 0



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/, repoman/bin/

2021-03-28 Thread Zac Medico
commit: c42f932378d911e0df1e75457931d8ae9670ea95
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Mar 28 18:06:17 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Mar 28 18:06:30 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=c42f9323

repoman: fix argv inconsistency

Signed-off-by: Zac Medico  gentoo.org>

 repoman/bin/repoman | 4 ++--
 repoman/lib/repoman/main.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/repoman/bin/repoman b/repoman/bin/repoman
index 29c630772..c52ab15b7 100755
--- a/repoman/bin/repoman
+++ b/repoman/bin/repoman
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 """Ebuild and tree health checks and maintenance utilities.
@@ -41,7 +41,7 @@ from portage.util._eventloop.global_event_loop import 
global_event_loop
 from repoman.main import repoman_main
 
 try:
-   sys.exit(repoman_main(sys.argv[1:]))
+   sys.exit(repoman_main(sys.argv))
 except IOError as e:
if e.errno == errno.EACCES:
print("\nRepoman: Need user access")

diff --git a/repoman/lib/repoman/main.py b/repoman/lib/repoman/main.py
index 50b99c21f..dc791ad71 100755
--- a/repoman/lib/repoman/main.py
+++ b/repoman/lib/repoman/main.py
@@ -58,7 +58,7 @@ def repoman_main(argv):
nocolor()
 
options, arguments = parse_args(
-   sys.argv, repoman_settings.get("REPOMAN_DEFAULT_OPTS", ""))
+   argv, repoman_settings.get("REPOMAN_DEFAULT_OPTS", ""))
 
if options.version:
print("Repoman", VERSION, "(portage-%s)" % portage.VERSION)



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/deprecated/, repoman/cnf/linechecks/

2021-02-25 Thread Zac Medico
commit: d4bd6045a50c4e662e36c2ad247c6c13d6f3e534
Author: Arfrever Frehtes Taifersar Arahesis  Apache  Org>
AuthorDate: Sun Aug 18 23:23:22 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Thu Feb 25 23:37:29 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=d4bd6045

repoman: Change message for preserve_old_lib (bug 692486)

Bug: https://bugs.gentoo.org/692486
Signed-off-by: Arfrever Frehtes Taifersar Arahesis  Apache.Org>
Signed-off-by: Zac Medico  gentoo.org>

 repoman/cnf/linechecks/linechecks.yaml  | 2 +-
 repoman/lib/repoman/modules/linechecks/deprecated/deprecated.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/repoman/cnf/linechecks/linechecks.yaml 
b/repoman/cnf/linechecks/linechecks.yaml
index 2182b467a..c6c72ab26 100644
--- a/repoman/cnf/linechecks/linechecks.yaml
+++ b/repoman/cnf/linechecks/linechecks.yaml
@@ -25,7 +25,7 @@ errors:
 DEPRECATED_BINDNOW_FLAGS: 'Deprecated bindnow-flags call'
 EAPI_DEFINED_AFTER_INHERIT: 'EAPI defined after inherit'
 NO_AS_NEEDED: 'Upstream asneeded linking bug (no-as-needed)'
-PRESERVE_OLD_LIB: 'Ebuild calls deprecated preserve_old_lib'
+PRESERVE_OLD_LIB: 'Ebuild calls preserve_old_lib function reserved for 
system packages'
 BUILT_WITH_USE: 'built_with_use'
 NO_OFFSET_WITH_HELPERS: 'Helper function is used with D, ROOT, ED, EROOT 
or EPREFIX'
 USEQ_ERROR: 'Ebuild calls deprecated useq function'

diff --git a/repoman/lib/repoman/modules/linechecks/deprecated/deprecated.py 
b/repoman/lib/repoman/modules/linechecks/deprecated/deprecated.py
index d1a590f1d..7c65c9ca0 100644
--- a/repoman/lib/repoman/modules/linechecks/deprecated/deprecated.py
+++ b/repoman/lib/repoman/modules/linechecks/deprecated/deprecated.py
@@ -19,7 +19,7 @@ class DeprecatedHasq(LineCheck):
 
 
 class PreserveOldLib(LineCheck):
-   """Check for calls to the deprecated preserve_old_lib function."""
+   """Check for calls to the preserve_old_lib function reserved for system 
packages."""
repoman_check_name = 'ebuild.minorsyn'
re = re.compile(r'.*preserve_old_lib')
error = 'PRESERVE_OLD_LIB'



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/scan/metadata/

2021-01-18 Thread Zac Medico
commit: 030e2fc8ba6cf6c28b582c9ccbb5343ece887776
Author: Zac Medico  gentoo  org>
AuthorDate: Tue Jan 19 07:32:49 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Jan 19 07:33:33 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=030e2fc8

repoman: fix DeprecationWarning: invalid escape sequence \s

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py 
b/repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py
index c1ba8e9f4..2e85cc3b9 100644
--- a/repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py
+++ b/repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py
@@ -101,7 +101,7 @@ class PkgMetadata(ScanBase, USEFlagChecks):
 
indentation_chars = Counter()
for l in etree.tostring(_metadata_xml).splitlines():
-   indentation_chars.update(re.match(b"\s*", l).group(0))
+   indentation_chars.update(re.match(rb"\s*", l).group(0))
if len(indentation_chars) > 1:
self.qatracker.add_error("metadata.warning", 
"%s/metadata.xml: %s" %
(xpkg, "inconsistent use of tabs and spaces in 
indentation")



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/, repoman/lib/repoman/modules/vcs/svn/, ...

2021-01-18 Thread Zac Medico
can/ebuild/__init__.py repoman/lib/repoman/modules/scan/eclasses/__init__.py 
repoman/lib/repoman/modules/scan/fetch/__init__.py 
repoman/lib/repoman/modules/scan/keywords/__init__.py 
repoman/lib/repoman/modules/scan/manifest/__init__.py 
repoman/lib/repoman/modules/scan/metadata/__init__.py 
repoman/lib/repoman/modules/scan/metadata/ebuild_metadata.py 
repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py 
repoman/lib/repoman/modules/scan/metadata/restrict.py 
repoman/lib/repoman/modules/scan/options/__init__.py 
repoman/lib/repoman/modules/vcs/None/status.py 
repoman/lib/repoman/modules/vcs/__init__.py 
repoman/lib/repoman/modules/vcs/bzr/changes.py 
repoman/lib/repoman/modules/vcs/bzr/status.py 
repoman/lib/repoman/modules/vcs/cvs/status.py 
repoman/lib/repoman/modules/vcs/git/changes.py 
repoman/lib/repoman/modules/vcs/git/status.py 
repoman/lib/repoman/modules/vcs/hg/changes.py 
repoman/lib/repoman/modules/vcs/hg/status.py 
repoman/lib/repoman/modules/vcs/svn/changes.py repoman/lib/repoman/mo
 dules/vcs/svn/status.py repoman/lib/repoman/modules/vcs/vcs.py 
repoman/lib/repoman/repos.py repoman/lib/repoman/tests/commit/__test__.py 
repoman/lib/repoman/tests/runTests.py 
repoman/lib/repoman/tests/simple/__test__.py 
repoman/lib/repoman/tests/simple/test_simple.py repoman/lib/repoman/utilities.py
X-VCS-Directories: repoman/lib/repoman/modules/scan/metadata/ 
repoman/lib/repoman/modules/scan/depend/ 
repoman/lib/repoman/modules/linechecks/quotes/ 
repoman/lib/repoman/modules/scan/fetch/ 
repoman/lib/repoman/modules/linechecks/depend/ 
repoman/lib/repoman/modules/scan/directories/ 
repoman/lib/repoman/modules/scan/eclasses/ 
repoman/lib/repoman/modules/scan/ebuild/ 
repoman/lib/repoman/modules/linechecks/whitespace/ 
repoman/lib/repoman/modules/linechecks/eapi/ 
repoman/lib/repoman/modules/scan/keywords/ 
repoman/lib/repoman/modules/linechecks/useless/ 
repoman/lib/repoman/modules/vcs/cvs/ repoman/lib/repoman/tests/commit/ 
repoman/lib/repoman/modules/linechecks/deprecated/ 
repoman/lib/repoman/modules/linechecks/gentoo_header/ 
repoman/lib/repoman/modules/linechecks/patches/ repoman/lib/repoman/ 
repoman/lib/repoman/tests/simple/ repoman/lib/repoman/modules/vcs/None/ 
repoman/lib/repoman/modules/vcs/svn/ 
repoman/lib/repoman/modules/linechecks/portage/ 
repoman/lib/repoman/modules/vcs/git/ repom
 an/lib/repoman/modules/scan/options/ repoman/lib/repoman/modules/commit/ 
repoman/lib/repoman/modules/linechecks/ 
repoman/lib/repoman/modules/linechecks/do/ 
repoman/lib/repoman/modules/linechecks/use/ repoman/lib/repoman/modules/vcs/ 
repoman/lib/repoman/modules/linechecks/nested/ 
repoman/lib/repoman/modules/linechecks/workaround/ repoman/lib/repoman/tests/ 
repoman/lib/repoman/modules/linechecks/phases/ 
repoman/lib/repoman/modules/linechecks/uri/ 
repoman/lib/repoman/modules/linechecks/helpers/ 
repoman/lib/repoman/modules/scan/eapi/ 
repoman/lib/repoman/modules/scan/manifest/ 
repoman/lib/repoman/modules/linechecks/emake/ 
repoman/lib/repoman/modules/linechecks/assignment/ 
repoman/lib/repoman/modules/vcs/hg/ repoman/lib/repoman/modules/vcs/bzr/
X-VCS-Committer: zmedico
X-VCS-Committer-Name: Zac Medico
X-VCS-Revision: fd216bba8b60335f8ee0119a350dd22ce65331b3
X-VCS-Branch: master
Date: Tue, 19 Jan 2021 07:28:40 + (UTC)

commit: fd216bba8b60335f8ee0119a350dd22ce65331b3
Author: Zac Medico  gentoo  org>
AuthorDate: Tue Jan 19 07:05:46 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Jan 19 07:06:01 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=fd216bba

repoman: misc pylint fixes

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/_subprocess.py |  4 
 repoman/lib/repoman/actions.py |  3 ++-
 repoman/lib/repoman/config.py  |  5 
 repoman/lib/repoman/gpg.py |  2 --
 repoman/lib/repoman/main.py|  3 ++-
 repoman/lib/repoman/metadata.py|  1 -
 repoman/lib/repoman/modules/commit/manifest.py |  1 -
 repoman/lib/repoman/modules/commit/repochecks.py   |  1 -
 repoman/lib/repoman/modules/linechecks/__init__.py |  1 -
 .../modules/linechecks/assignment/__init__.py  |  3 +--
 .../repoman/modules/linechecks/depend/__init__.py  |  3 +--
 .../modules/linechecks/deprecated/__init__.py  |  3 +--
 .../modules/linechecks/deprecated/deprecated.py|  2 +-
 .../lib/repoman/modules/linechecks/do/__init__.py  |  3 +--
 .../repoman/modules/linechecks/eapi/__init__.py|  3 +--
 .../repoman/modules/linechecks/emake/__init__.py   |  3 +--
 .../modules/linechecks/gentoo_header/__init__.py   |  3 +--
 .../repoman/modules/linechecks/helpers/__init__.py |  3 +--
 .../repoman/modules/linechecks/helpers/offset.py   |  2 +-
 .../repoman/modules/linechecks/nested/__init__.py  |  3 +--
 .../repoman/modules/linechecks/patches/__init__.py |  3 +--
 .../repoman/modules/linechecks/patches/patches.py  |  3 +--
 

[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/scan/depend/

2021-01-18 Thread Zac Medico
commit: b5918d7416de7ef2e1b8f0ac86cd2d21cae8405e
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Jan 18 12:39:55 2021 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Jan 18 13:08:03 2021 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=b5918d74

repoman: Use async and await syntax

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/modules/scan/depend/profile.py | 22 +-
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/repoman/lib/repoman/modules/scan/depend/profile.py 
b/repoman/lib/repoman/modules/scan/depend/profile.py
index 468bc55e2..7549a414d 100644
--- a/repoman/lib/repoman/modules/scan/depend/profile.py
+++ b/repoman/lib/repoman/modules/scan/depend/profile.py
@@ -18,7 +18,6 @@ from portage.dep import Atom
 from portage.package.ebuild.profile_iuse import iter_iuse_vars
 from portage.util import getconfig
 from portage.util.futures import asyncio
-from portage.util.futures.compat_coroutine import coroutine, coroutine_return
 from portage.util.futures.executor.fork import ForkExecutor
 from portage.util.futures.iter_completed import async_iter_completed
 
@@ -102,13 +101,12 @@ class ProfileDependsChecks(ScanBase):
for result in results:
self._check_result(task, result)
 
-   loop = asyncio._wrap_loop()
-   loop.run_until_complete(self._async_check(loop=loop, **kwargs))
+   loop = asyncio.get_event_loop()
+   loop.run_until_complete(self._async_check(loop, **kwargs))
 
return False
 
-   @coroutine
-   def _async_check(self, loop=None, **kwargs):
+   async def _async_check(self, loop, **kwargs):
'''Perform async profile dependant dependency checks
 
@param arches:
@@ -118,7 +116,6 @@ class ProfileDependsChecks(ScanBase):
@param unknown_pkgs: set of tuples (type, atom.unevaluated_atom)
@returns: dictionary
'''
-   loop = asyncio._wrap_loop(loop)
ebuild = kwargs.get('ebuild').get()
pkg = kwargs.get('pkg').get()
unknown_pkgs = ebuild.unknown_pkgs
@@ -130,8 +127,8 @@ class ProfileDependsChecks(ScanBase):
 
if self.options.jobs > 1:
for future_done_set in 
async_iter_completed(self._iter_tasks(loop, executor, ebuild, pkg),
-   max_jobs=self.options.jobs, 
max_load=self.options.load_average, loop=loop):
-   for task in (yield future_done_set):
+   max_jobs=self.options.jobs, 
max_load=self.options.load_average):
+   for task in (await future_done_set):
task, results = task.result()
for result in results:
self._check_result(task, result)
@@ -145,10 +142,9 @@ class ProfileDependsChecks(ScanBase):
"dependency.unknown", "%s: %s: %s"
% (ebuild.relative_path, mytype, ", 
".join(sorted(atoms
 
-   @coroutine
-   def _task(self, task, loop=None):
-   yield task.future
-   coroutine_return((task, task.future.result()))
+   async def _task(self, task):
+   await task.future
+   return (task, task.future.result())
 
def _iter_tasks(self, loop, executor, ebuild, pkg):
for keyword, groups, prof in ebuild.relevant_profiles:
@@ -222,7 +218,7 @@ class ProfileDependsChecks(ScanBase):
yield (task, target())
else:
task.future = 
asyncio.ensure_future(loop.run_in_executor(executor, target), loop=loop)
-   yield self._task(task, loop=loop)
+   yield asyncio.ensure_future(self._task(task), 
loop=loop)
 
 
def _task_subprocess(self, task, pkg, dep_settings):



[gentoo-commits] proj/portage:master commit in: /, repoman/

2020-12-30 Thread Zac Medico
commit: 57c13cb8630a7ee78d714a4cc15bceb3d0fd2838
Author: Manuel Rüger  rueg  eu>
AuthorDate: Wed Dec 30 14:40:54 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Thu Dec 31 01:02:45 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=57c13cb8

Test with Python 3.10

Closes: https://github.com/gentoo/portage/pull/649
Signed-off-by: Manuel Rüger  rueg.eu>
Signed-off-by: Zac Medico  gentoo.org>

 .travis.yml  | 5 +++--
 repoman/runtests | 5 +++--
 runtests | 5 +++--
 tox.ini  | 4 ++--
 4 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index d2935fdab..3a40617fb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,10 +1,11 @@
-dist: bionic
+dist: focal
 language: python
 python:
 - 3.6
 - 3.7
 - 3.8
-- 3.9-dev
+- 3.9
+- 3.10-dev
 - pypy3
 
 # command to install dependencies

diff --git a/repoman/runtests b/repoman/runtests
index 3edaaf0a8..5137b5e6e 100755
--- a/repoman/runtests
+++ b/repoman/runtests
@@ -24,12 +24,13 @@ PYTHON_SUPPORTED_VERSIONS = [
'2.7',
'3.6',
'3.7',
-   '3.8'
+   '3.8',
+   '3.9'
 ]
 # The rest are just "nice to have".
 PYTHON_NICE_VERSIONS = [
'pypy3',
-   '3.9'
+   '3.10'
 ]
 
 EPREFIX = os.environ.get('PORTAGE_OVERRIDE_EPREFIX', '/')

diff --git a/runtests b/runtests
index 685a7d9c7..c062f46cb 100755
--- a/runtests
+++ b/runtests
@@ -23,12 +23,13 @@ import tempfile
 PYTHON_SUPPORTED_VERSIONS = [
'3.6',
'3.7',
-   '3.8'
+   '3.8',
+   '3.9'
 ]
 # The rest are just "nice to have".
 PYTHON_NICE_VERSIONS = [
'pypy3',
-   '3.9'
+   '3.10'
 ]
 
 EPREFIX = os.environ.get('PORTAGE_OVERRIDE_EPREFIX', '/')

diff --git a/tox.ini b/tox.ini
index d6c8cf3b3..8aabbd2ce 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = py36,py37,py38,py39,pypy3
+envlist = py36,py37,py38,py39,py310,pypy3
 skipsdist = True
 
 [testenv]
@@ -7,7 +7,7 @@ deps =
pylint
pygost
pyyaml
-   py36,py37,py38,py39,pypy3: lxml!=4.2.0
+   py36,py37,py38,py39,py310,pypy3: lxml!=4.2.0
 setenv =
PYTHONPATH={toxinidir}/lib
 commands =



[gentoo-commits] proj/portage:master commit in: repoman/

2020-10-18 Thread Zac Medico
commit: d8affbd6c2a75c3acd8ecc5dbbad9224ecb43f94
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Oct 18 08:21:36 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Oct 18 08:21:44 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=d8affbd6

repoman: Update for a repoman-3.0.2 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 5 +
 repoman/setup.py  | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index f0b50cef6..a09845b79 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,11 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-3.0.2
+==
+* Bug Fixes:
+- Bug 748144 Make file.size fatal for files larger than 20 KiB
+
 repoman-3.0.1
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index b2c5fd43f..a405e7816 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -448,7 +448,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '3.0.1',
+   version = '3.0.2',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/scan/fetch/, repoman/cnf/qa_data/, repoman/man/, ...

2020-10-18 Thread Zac Medico
commit: 6258c62c84bf60b8ade8b7fb63ed4475c6195f21
Author: Joonas Niilola  gentoo  org>
AuthorDate: Sun Oct 18 06:20:08 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Oct 18 08:16:12 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=6258c62c

repoman: fix file.size-fatal to be 20 KiB

Closes: https://github.com/gentoo/portage/pull/629
Bug: https://bugs.gentoo.org/748144
Signed-off-by: Joonas Niilola  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 repoman/cnf/qa_data/qa_data.yaml  | 1 -
 repoman/cnf/repository/qa_data.yaml   | 1 -
 repoman/lib/repoman/modules/scan/fetch/fetches.py | 7 +--
 repoman/man/repoman.1 | 2 +-
 4 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/repoman/cnf/qa_data/qa_data.yaml b/repoman/cnf/qa_data/qa_data.yaml
index 9a807aaf3..29a3d6e9f 100644
--- a/repoman/cnf/qa_data/qa_data.yaml
+++ b/repoman/cnf/qa_data/qa_data.yaml
@@ -60,7 +60,6 @@ qahelp:
 file:
 executable: "Ebuilds, digests, metadata.xml, Manifest, and ChangeLog 
do not need the executable bit"
 size: "Files in the files directory must be under 20 KiB"
-size-fatal: "Files in the files directory must be under 60 KiB"
 empty: "Empty file in the files directory"
 name: "File/dir name must be composed of only the following chars: %s "
 UTF8: "File is not UTF8 compliant"

diff --git a/repoman/cnf/repository/qa_data.yaml 
b/repoman/cnf/repository/qa_data.yaml
index 464482056..3fe6b53d5 100644
--- a/repoman/cnf/repository/qa_data.yaml
+++ b/repoman/cnf/repository/qa_data.yaml
@@ -59,7 +59,6 @@ qawarnings:
 - ebuild.badheader
 - ebuild.patches
 - file.empty
-- file.size
 - HOMEPAGE.virtual
 - inherit.unused
 - inherit.deprecated

diff --git a/repoman/lib/repoman/modules/scan/fetch/fetches.py 
b/repoman/lib/repoman/modules/scan/fetch/fetches.py
index 5a958a461..7d4c58908 100644
--- a/repoman/lib/repoman/modules/scan/fetch/fetches.py
+++ b/repoman/lib/repoman/modules/scan/fetch/fetches.py
@@ -120,12 +120,7 @@ class FetchChecks(ScanBase):
continue
filesdirlist.append(y + "/" + z)
# Current policy is no files over 20 KiB, these 
are the checks.
-   # File size between 20 KiB and 60 KiB causes a 
warning,
-   # while file size over 60 KiB causes an error.
-   elif mystat.st_size > 61440:
-   self.qatracker.add_error(
-   "file.size-fatal", "(%d KiB) 
%s/files/%s" % (
-   mystat.st_size // 1024, 
xpkg, y))
+   # File size over 20 KiB causes an error.
elif mystat.st_size > 20480:
self.qatracker.add_error(
"file.size", "(%d KiB) 
%s/files/%s" % (

diff --git a/repoman/man/repoman.1 b/repoman/man/repoman.1
index 6f9a24544..0926e806c 100644
--- a/repoman/man/repoman.1
+++ b/repoman/man/repoman.1
@@ -393,7 +393,7 @@ executable bit
 File/dir name must be composed of only the following chars: a-zA-Z0-9._-+:
 .TP
 .B file.size
-Files in the files directory must be under 20k
+Files in the files directory must be under 20 KiB
 .TP
 .B inherit.missing
 Ebuild uses functions from an eclass but does not inherit it



[gentoo-commits] proj/portage:master commit in: repoman/

2020-08-18 Thread Zac Medico
commit: fa69f697fbacc041df1264c61a9987baa14ff2a7
Author: Zac Medico  gentoo  org>
AuthorDate: Wed Aug 19 05:29:04 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Aug 19 05:38:03 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=fa69f697

repoman: Update for a repoman-3.0.1 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 5 +
 repoman/setup.py  | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index 5769eac54..f0b50cef6 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,11 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-3.0.1
+==
+* Bug Fixes:
+- Bug 737698 Update repoman for compatibility with portage-3.0.4.
+
 repoman-3.0.0
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index 6819de46d..b2c5fd43f 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -448,7 +448,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '3.0.0',
+   version = '3.0.1',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/

2020-08-17 Thread Zac Medico
commit: ccff43b2a1a8a9c2a5a4917e19d4dee049c263df
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Aug 17 05:45:41 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Aug 17 05:46:30 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=ccff43b2

repoman: Update for a repoman-3.0.0 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 6 ++
 repoman/setup.py  | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index 0c79956a0..5769eac54 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,12 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-3.0.0
+==
+* Bug Fixes:
+- Bug 448462 Add --jobs and --load-average options which allow
+  dependency checks for multiple profiles to run in parallel.
+
 repoman-2.3.23
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index 5fcfe12e6..6819de46d 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -448,7 +448,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.23',
+   version = '3.0.0',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/scan/depend/, repoman/lib/repoman/, repoman/man/

2020-08-17 Thread Zac Medico
commit: 26524e5fbc8019e22d15765a35570df7c7a315ca
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Aug 15 02:51:38 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Aug 17 05:39:06 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=26524e5f

repoman: Add --jobs and --load-average options (bug 448462)

Add --jobs and --load-average options which allow dependency checks
for multiple profiles to run in parallel. The increase in performance
is non-linear for the number of jobs, but it can be worthwhile
(I measured a 35% decrease in time when running 'repoman -j8 full'
on sys-apps/portage). For the -j1 case (default), all dependency
checks run in the main process as usual, so there is no significant
performance penalty for the default case.

Bug: https://bugs.gentoo.org/448462
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/argparser.py   |   9 ++
 repoman/lib/repoman/modules/scan/depend/profile.py | 117 +
 repoman/man/repoman.1  |   9 +-
 3 files changed, 116 insertions(+), 19 deletions(-)

diff --git a/repoman/lib/repoman/argparser.py b/repoman/lib/repoman/argparser.py
index 670a0e91d..6d545ccca 100644
--- a/repoman/lib/repoman/argparser.py
+++ b/repoman/lib/repoman/argparser.py
@@ -199,6 +199,15 @@ def parse_args(argv, repoman_default_opts):
'--output-style', dest='output_style', choices=output_keys,
help='select output type', default='default')
 
+   parser.add_argument(
+   '-j', '--jobs', dest='jobs', action='store', type=int, 
default=1,
+   help='Specifies the number of jobs (processes) to run 
simultaneously.')
+
+   parser.add_argument(
+   '-l', '--load-average', dest='load_average', action='store', 
type=float, default=None,
+   help='Specifies that no new jobs (processes) should be started 
if there are others '
+   'jobs running and the load average is at least load (a 
floating-point number).')
+
parser.add_argument(
'--mode', dest='mode', choices=mode_keys,
help='specify which mode repoman will run in (default=full)')

diff --git a/repoman/lib/repoman/modules/scan/depend/profile.py 
b/repoman/lib/repoman/modules/scan/depend/profile.py
index 39d8b550c..1eb69422a 100644
--- a/repoman/lib/repoman/modules/scan/depend/profile.py
+++ b/repoman/lib/repoman/modules/scan/depend/profile.py
@@ -2,7 +2,9 @@
 
 
 import copy
+import functools
 import os
+import types
 from pprint import pformat
 
 from _emerge.Package import Package
@@ -15,6 +17,10 @@ from repoman.modules.scan.depend._gen_arches import 
_gen_arches
 from portage.dep import Atom
 from portage.package.ebuild.profile_iuse import iter_iuse_vars
 from portage.util import getconfig
+from portage.util.futures import asyncio
+from portage.util.futures.compat_coroutine import coroutine, coroutine_return
+from portage.util.futures.executor.fork import ForkExecutor
+from portage.util.futures.iter_completed import async_iter_completed
 
 
 def sort_key(item):
@@ -58,16 +64,14 @@ class ProfileDependsChecks(ScanBase):
def check(self, **kwargs):
'''Perform profile dependant dependency checks
 
-   @param arches:
@param pkg: Package in which we check (object).
@param ebuild: Ebuild which we check (object).
-   @param baddepsyntax: boolean
-   @param unknown_pkgs: set of tuples (type, atom.unevaluated_atom)
@returns: dictionary
'''
ebuild = kwargs.get('ebuild').get()
pkg = kwargs.get('pkg').get()
-   unknown_pkgs, baddepsyntax = _depend_checks(
+
+   ebuild.unknown_pkgs, ebuild.baddepsyntax = _depend_checks(
ebuild, pkg, self.portdb, self.qatracker, 
self.repo_metadata,
self.repo_settings.qadata)
 
@@ -90,8 +94,64 @@ class ProfileDependsChecks(ScanBase):
relevant_profiles.append((keyword, groups, 
prof))
 
relevant_profiles.sort(key=sort_key)
+   ebuild.relevant_profiles = relevant_profiles
+
+   if self.options.jobs <= 1:
+   for task in self._iter_tasks(None, None, ebuild, pkg):
+   task, results = task
+   for result in results:
+   self._check_result(task, result)
+
+   loop = asyncio._wrap_loop()
+   loop.run_until_complete(self._async_check(loop=loop, **kwargs))
+
+   return False
+
+   @coroutine
+   def _async_check(self, loop=None, **kwargs):
+   '''Perform async profile dependant dependency checks
+
+   @param arches:
+   @param pkg: Package in which we check (object).
+   @param 

[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2020-08-15 Thread Zac Medico
commit: 164efc2db431e8052597c40cd17e3c38e24a7f8f
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Aug 16 00:37:17 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Aug 16 00:42:15 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=164efc2d

repoman/lib/repoman/scanner.py: Remove unneeded y_ebuild_continue var

Since commit 203bc84894d76f4e17e47b9373e84bebc217a246, this variable
has triggered a continue statement which no longer bypassed any
relevant code in the containing loop.

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/scanner.py | 5 -
 1 file changed, 5 deletions(-)

diff --git a/repoman/lib/repoman/scanner.py b/repoman/lib/repoman/scanner.py
index f9663e013..2e5e5ef31 100644
--- a/repoman/lib/repoman/scanner.py
+++ b/repoman/lib/repoman/scanner.py
@@ -372,7 +372,6 @@ class Scanner:
for y_ebuild in ebuildlist:
self.reset_futures(dynamic_data)
dynamic_data['y_ebuild'] = y_ebuild
-   y_ebuild_continue = False
 
# initialize per ebuild plugin checks here
# need to set it up for ==> self.modules_list or some 
other ordered list
@@ -395,13 +394,9 @@ class Scanner:
# Do not try to do any 
more QA checks on this package since missing
# metadata leads to 
false positives for several checks, and false
# positives confuse 
users.
-   y_ebuild_continue = True
# logging.debug("\t>>> 
Continuing")
break
 
-   if y_ebuild_continue:
-   continue
-
logging.debug("Finished ebuild plugin loop, 
continuing...")
 
# Final checks



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2020-08-15 Thread Zac Medico
commit: a6f90ba17202518ab0c976a32cb216a8e719f8fa
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Aug 15 23:55:50 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Aug 15 23:56:01 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a6f90ba1

repoman/lib/repoman/scanner.py: Fix useless-return

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/scanner.py | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/repoman/lib/repoman/scanner.py b/repoman/lib/repoman/scanner.py
index f9df73d83..f9663e013 100644
--- a/repoman/lib/repoman/scanner.py
+++ b/repoman/lib/repoman/scanner.py
@@ -365,7 +365,6 @@ class Scanner:
dynamic_data["changelog_modified"] = changelog_path in 
self.changed.changelogs
 
self._scan_ebuilds(ebuildlist, dynamic_data)
-   return
 
 
def _scan_ebuilds(self, ebuildlist, dynamic_data):
@@ -408,7 +407,6 @@ class Scanner:
# Final checks
# initialize per pkg plugin final checks here
# need to set it up for ==> self.modules_list or some other 
ordered list
-   xpkg_complete = False
for mod in self.moduleconfig.final_loop:
if mod:
mod_class = 
self.moduleconfig.controller.get_class(mod)
@@ -423,10 +421,5 @@ class Scanner:
logging.debug("\tRunning function: %s", 
func)
_continue = 
func(**self.set_func_kwargs(mod, dynamic_data))
if _continue:
-   xpkg_complete = True
# logging.debug("\t>>> 
Continuing")
break
-
-   if xpkg_complete:
-   return
-   return



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/deprecated/

2020-08-14 Thread Zac Medico
commit: 336df196217d8907788567a0349270348041657e
Author: Michael Orlitzky  gentoo  org>
AuthorDate: Fri Aug 14 21:43:28 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Aug 14 22:11:41 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=336df196

Revert "repoman: deprecate netsurf.eclass."

This reverts commit a73024729860f9224b8d1660d24c450080b67d9f. This
eclass was successfully purged from the tree, so the deprecation is no
longer needed. And eventually, to address an eblit infestation,
another eclass with the same name will return. The new one will not be
deprecated.

Signed-off-by: Michael Orlitzky  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/modules/linechecks/deprecated/inherit.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py 
b/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
index 60410347b..5848a0c37 100644
--- a/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
+++ b/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
@@ -33,7 +33,6 @@ class InheritDeprecated(LineCheck):
"gst-plugins10": "gstreamer",
"ltprune": False,
"mono": "mono-env",
-   "netsurf": False,
"python": "python-r1 / python-single-r1 / python-any-r1",
"ruby": "ruby-ng",
"user": "GLEP 81",



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/vcs/git/, repoman/lib/repoman/modules/vcs/cvs/, ...

2020-07-22 Thread Zac Medico
commit: 41f5049b14beb11e6ae768c8571e7a8a326f701c
Author: Alec Warner  gentoo  org>
AuthorDate: Wed Jul 22 04:04:09 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Jul 22 16:53:06 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=41f5049b

Fix R0205 in repoman.

Do not inherit from object in py3.

Signed-off-by: Alec Warner  gentoo.org>
Change-Id: I52c8f46e16fa1dc9c2b90a6c9a5cdf4a417050a0
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/actions.py | 2 +-
 repoman/lib/repoman/copyrights.py  | 2 +-
 repoman/lib/repoman/modules/commit/manifest.py | 2 +-
 repoman/lib/repoman/modules/linechecks/base.py | 2 +-
 repoman/lib/repoman/modules/linechecks/config.py   | 2 +-
 repoman/lib/repoman/modules/linechecks/controller.py   | 2 +-
 repoman/lib/repoman/modules/scan/metadata/use_flags.py | 2 +-
 repoman/lib/repoman/modules/scan/module.py | 2 +-
 repoman/lib/repoman/modules/scan/scanbase.py   | 2 +-
 repoman/lib/repoman/modules/vcs/None/status.py | 2 +-
 repoman/lib/repoman/modules/vcs/bzr/status.py  | 2 +-
 repoman/lib/repoman/modules/vcs/changes.py | 2 +-
 repoman/lib/repoman/modules/vcs/cvs/status.py  | 2 +-
 repoman/lib/repoman/modules/vcs/git/status.py  | 2 +-
 repoman/lib/repoman/modules/vcs/hg/status.py   | 2 +-
 repoman/lib/repoman/modules/vcs/settings.py| 2 +-
 repoman/lib/repoman/modules/vcs/svn/status.py  | 2 +-
 repoman/lib/repoman/profile.py | 2 +-
 repoman/lib/repoman/qa_data.py | 2 +-
 repoman/lib/repoman/qa_tracker.py  | 2 +-
 repoman/lib/repoman/repos.py   | 2 +-
 repoman/lib/repoman/scanner.py | 2 +-
 22 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
index 64593503a..1afc4acb1 100644
--- a/repoman/lib/repoman/actions.py
+++ b/repoman/lib/repoman/actions.py
@@ -41,7 +41,7 @@ from repoman import VERSION
 bad = create_color_func("BAD")
 
 
-class Actions(object):
+class Actions:
'''Handles post check result output and performs
the various vcs activities for committing the results'''
 

diff --git a/repoman/lib/repoman/copyrights.py 
b/repoman/lib/repoman/copyrights.py
index 275dcbc3f..9e5a32e34 100644
--- a/repoman/lib/repoman/copyrights.py
+++ b/repoman/lib/repoman/copyrights.py
@@ -20,7 +20,7 @@ _copyright_re2 = \
re.compile(br'^(# Copyright )(\d\d\d\d)( Gentoo 
(Foundation|Authors))\b')
 
 
-class _copyright_repl(object):
+class _copyright_repl:
__slots__ = ('year',)
 
def __init__(self, year):

diff --git a/repoman/lib/repoman/modules/commit/manifest.py 
b/repoman/lib/repoman/modules/commit/manifest.py
index 573710a62..e71c1abcb 100644
--- a/repoman/lib/repoman/modules/commit/manifest.py
+++ b/repoman/lib/repoman/modules/commit/manifest.py
@@ -11,7 +11,7 @@ from portage.package.ebuild.digestgen import digestgen
 from portage.util import writemsg_level
 
 
-class Manifest(object):
+class Manifest:
'''Creates as well as checks pkg Manifest entries/files'''
 
def __init__(self, **kwargs):

diff --git a/repoman/lib/repoman/modules/linechecks/base.py 
b/repoman/lib/repoman/modules/linechecks/base.py
index 39d7ebd78..bcd86773b 100644
--- a/repoman/lib/repoman/modules/linechecks/base.py
+++ b/repoman/lib/repoman/modules/linechecks/base.py
@@ -3,7 +3,7 @@ import logging
 import re
 
 
-class LineCheck(object):
+class LineCheck:
"""Run a check on a line of an ebuild."""
"""A regular expression to determine whether to ignore the line"""
ignore_line = False

diff --git a/repoman/lib/repoman/modules/linechecks/config.py 
b/repoman/lib/repoman/modules/linechecks/config.py
index 63a5bc44e..69cf8e8aa 100644
--- a/repoman/lib/repoman/modules/linechecks/config.py
+++ b/repoman/lib/repoman/modules/linechecks/config.py
@@ -35,7 +35,7 @@ def merge(dict1, dict2):
 return result
 
 
-class LineChecksConfig(object):
+class LineChecksConfig:
'''Holds our LineChecks configuration data and operation functions'''
 
def __init__(self, repo_settings):

diff --git a/repoman/lib/repoman/modules/linechecks/controller.py 
b/repoman/lib/repoman/modules/linechecks/controller.py
index a3dfd9bd1..50ca5229f 100644
--- a/repoman/lib/repoman/modules/linechecks/controller.py
+++ b/repoman/lib/repoman/modules/linechecks/controller.py
@@ -18,7 +18,7 @@ MODULES_PATH = os.path.dirname(__file__)
 logging.debug("LineChecks module path: %s", MODULES_PATH)
 
 
-class LineCheckController(object):
+class LineCheckController:
'''Initializes and runs the LineCheck checks'''
 
def __init__(self, repo_settings, linechecks):

diff --git a/repoman/lib/repoman/modules/scan/metadata/use_flags.py 

[gentoo-commits] proj/portage:master commit in: repoman/, /

2020-07-06 Thread Zac Medico
commit: e59ec1924d6db957a01c828ce294a7675be5b27c
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Jul  6 18:18:02 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Jul  7 00:07:27 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=e59ec192

travis.yml: drop python 2.7 (bug 731114)

It should be pretty safe to drop support for python2.7 at this point.

Bug: https://bugs.gentoo.org/731114
Reviewed-by: Brian Dolbec  gentoo.org>
Reviewed-by: Michał Górny  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 .travis.yml  | 1 -
 repoman/setup.py | 2 +-
 setup.py | 2 +-
 tox.ini  | 6 ++
 4 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 2132c8c87..d2935fdab 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,6 @@
 dist: bionic
 language: python
 python:
-- 2.7
 - 3.6
 - 3.7
 - 3.8

diff --git a/repoman/setup.py b/repoman/setup.py
index eae0e09fe..f2664fae4 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -492,7 +492,7 @@ setup(
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License v2 
(GPLv2)',
'Operating System :: POSIX',
-   'Programming Language :: Python',
+   'Programming Language :: Python :: 3',
'Topic :: System :: Installation/Setup'
]
 )

diff --git a/setup.py b/setup.py
index ae00cf736..a3a026203 100755
--- a/setup.py
+++ b/setup.py
@@ -714,7 +714,7 @@ setup(
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License v2 
(GPLv2)',
'Operating System :: POSIX',
-   'Programming Language :: Python',
+   'Programming Language :: Python :: 3',
'Topic :: System :: Installation/Setup'
]
 )

diff --git a/tox.ini b/tox.ini
index 79b5b45cb..050a2c455 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,14 +1,12 @@
 [tox]
-envlist = py27,py36,py37,py38,py39,pypy3
+envlist = py36,py37,py38,py39,pypy3
 skipsdist = True
 
 [testenv]
 deps =
pygost
pyyaml
-   py27,py36,py37,py38,py39,pypy3: lxml!=4.2.0
-   py27: pyblake2
-   py27: pysha3
+   py36,py37,py38,py39,pypy3: lxml!=4.2.0
 setenv =
PYTHONPATH={toxinidir}/lib
 commands =



[gentoo-commits] proj/portage:master commit in: repoman/

2020-06-22 Thread Zac Medico
commit: 6bc3e9674f48d0ffb60c5ad0128276495c7dad3a
Author: Zac Medico  gentoo  org>
AuthorDate: Tue Jun 23 04:27:21 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Jun 23 04:59:23 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=6bc3e967

repoman: Update for a repoman-2.3.23 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 5 +
 repoman/setup.py  | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index 80541fa5c..0c79956a0 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,11 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.23
+==
+* Bug Fixes:
+- Bug 637824 Deprecate netsurf.eclass
+
 repoman-2.3.22
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index c3a7adad9..eae0e09fe 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -450,7 +450,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.22',
+   version = '2.3.23',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/deprecated/

2020-06-16 Thread Zac Medico
commit: a73024729860f9224b8d1660d24c450080b67d9f
Author: Michael Orlitzky  gentoo  org>
AuthorDate: Tue Jun 16 17:36:35 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Jun 16 17:49:02 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a7302472

repoman: deprecate netsurf.eclass.

While investigating bug 489542, it became clear that the netsurf
eclass is deprecated in spirit if not in fact. All of the newer
netsurf ebuilds use a custom function loaded from a script that is
shipped in netsurf-buildsystem's $FILESDIR to do (some of) what the
eclass used to do. That function probably does belong in an eclass,
but at this point, we should throw this thing out and start from
scratch.

By deprecating the eclass, we make sure that no one else inherits it
during the time it takes to purge the two remaining consumers. Then,
once those are gone, the build system script magic can be put back
into an eclass, and its consumers updated one-at-a-time.

Bug: https://bugs.gentoo.org/489542
Bug: https://bugs.gentoo.org/637824
Signed-off-by: Michael Orlitzky  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/modules/linechecks/deprecated/inherit.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py 
b/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
index 5848a0c37..60410347b 100644
--- a/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
+++ b/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
@@ -33,6 +33,7 @@ class InheritDeprecated(LineCheck):
"gst-plugins10": "gstreamer",
"ltprune": False,
"mono": "mono-env",
+   "netsurf": False,
"python": "python-r1 / python-single-r1 / python-any-r1",
"ruby": "ruby-ng",
"user": "GLEP 81",



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/deprecated/

2020-06-08 Thread Zac Medico
commit: 4b88adca550e96ed307ad540641250e6bc25670b
Author: Georgy Yakovlev  gentoo  org>
AuthorDate: Mon Jun  8 10:00:17 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Jun  9 00:14:06 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=4b88adca

repoman: add cmake-utils to deprecated eclasses

Closes: https://github.com/gentoo/portage/pull/554
Signed-off-by: Georgy Yakovlev  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/modules/linechecks/deprecated/inherit.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py 
b/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
index f307d46fd..5848a0c37 100644
--- a/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
+++ b/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
@@ -17,6 +17,7 @@ class InheritDeprecated(LineCheck):
"bash-completion": "bash-completion-r1",
"boost-utils": False,
"clutter": "gnome2",
+   "cmake-utils": "cmake",
"confutils": False,
"distutils": "distutils-r1",
"epatch": "(eapply since EAPI 6)",



[gentoo-commits] proj/portage:master commit in: repoman/

2020-03-25 Thread Zac Medico
commit: ceee38b4b60d57c93774aae04abe4e70448054ac
Author: Zac Medico  gentoo  org>
AuthorDate: Wed Mar 25 20:49:51 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Mar 25 20:50:01 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=ceee38b4

repoman: Update for a repoman-2.3.22 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 5 +
 repoman/setup.py  | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index 486c4f46c..80541fa5c 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,11 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.22
+==
+* Bug Fixes:
+- Bug 712106 only stage changes in index for commit mode
+
 repoman-2.3.21
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index c3059003f..c3a7adad9 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -450,7 +450,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.21',
+   version = '2.3.22',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/vcs/git/

2020-03-25 Thread Zac Medico
commit: f11cabb3c9fe7d09d86f40cc716f14e9b0aed765
Author: Zac Medico  gentoo  org>
AuthorDate: Wed Mar 25 19:53:45 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Mar 25 19:54:48 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=f11cabb3

repoman.modules.vcs.git.changes: reindex only for commit mode (bug 712106)

Automatically reindex for commit mode, but not for other modes
were the user might not want changes to be staged in the index.

Bug: https://bugs.gentoo.org/712106
Suggested-by: Jeroen Roovers  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/modules/vcs/git/changes.py | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/repoman/lib/repoman/modules/vcs/git/changes.py 
b/repoman/lib/repoman/modules/vcs/git/changes.py
index 550028434..9819831b5 100644
--- a/repoman/lib/repoman/modules/vcs/git/changes.py
+++ b/repoman/lib/repoman/modules/vcs/git/changes.py
@@ -29,7 +29,7 @@ class Changes(ChangesBase):
'''
super(Changes, self).__init__(options, repo_settings)
 
-   def _scan(self, _reindex=True):
+   def _scan(self, _reindex=None):
'''
VCS type scan function, looks for all detectable changes
 
@@ -39,6 +39,11 @@ class Changes(ChangesBase):
any other reason)
@type _reindex: bool
'''
+   # Automatically reindex for commit mode, but not for other modes
+   # were the user might not want changes to be staged in the 
index.
+   if _reindex is None and self.options.mode == 'commit':
+   _reindex = True
+
with repoman_popen(
"git diff-index --name-only "
"--relative --diff-filter=M HEAD") as f:



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2020-03-23 Thread Zac Medico
commit: 1bdff51e2b217a0b69a9195430487bc75a7fbe63
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Mar 23 21:58:43 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Mar 23 22:01:32 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=1bdff51e

repoman: fetch_metadata_xsd: use fetch function

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/metadata.py | 51 -
 1 file changed, 10 insertions(+), 41 deletions(-)

diff --git a/repoman/lib/repoman/metadata.py b/repoman/lib/repoman/metadata.py
index 11ec1aaf8..4537d2ce2 100644
--- a/repoman/lib/repoman/metadata.py
+++ b/repoman/lib/repoman/metadata.py
@@ -5,21 +5,14 @@ from __future__ import print_function, unicode_literals
 import errno
 import logging
 import sys
-import tempfile
 import time
 
-try:
-   from urllib.parse import urlparse
-except ImportError:
-   from urlparse import urlparse
-
-
 # import our initialized portage instance
 from repoman._portage import portage
 
 from portage import os
-from portage import shutil
 from portage.output import green
+from portage.package.ebuild.fetch import fetch
 
 if sys.hexversion >= 0x300:
basestring = str
@@ -64,41 +57,17 @@ def fetch_metadata_xsd(metadata_xsd, repoman_settings):
"%s the local copy of metadata.xsd "
"needs to be refetched, doing that now" % green("***"))
print()
-   parsed_url = urlparse(metadata_xsd_uri)
-   setting = 'FETCHCOMMAND_' + parsed_url.scheme.upper()
-   fcmd = repoman_settings.get(setting)
-   if not fcmd:
-   fcmd = repoman_settings.get('FETCHCOMMAND')
-   if not fcmd:
-   logging.error("FETCHCOMMAND is unset")
-   return False
-
-   destdir = repoman_settings["DISTDIR"]
-   fd, metadata_xsd_tmp = tempfile.mkstemp(
-   prefix='metadata.xsd.', dir=destdir)
-   os.close(fd)
+
+   if not fetch([metadata_xsd_uri], repoman_settings, force=1, 
try_mirrors=0):
+   logging.error(
+   "failed to fetch metadata.xsd from '%s'" % 
metadata_xsd_uri)
+   return False
 
try:
-   if not portage.getbinpkg.file_get(
-   metadata_xsd_uri, destdir, fcmd=fcmd,
-   filename=os.path.basename(metadata_xsd_tmp)):
-   logging.error(
-   "failed to fetch metadata.xsd from 
'%s'" % metadata_xsd_uri)
-   return False
-
-   try:
-   portage.util.apply_secpass_permissions(
-   metadata_xsd_tmp,
-   gid=portage.data.portage_gid, 
mode=0o664, mask=0o2)
-   except portage.exception.PortageException:
-   pass
-
-   shutil.move(metadata_xsd_tmp, metadata_xsd)
-   finally:
-   try:
-   os.unlink(metadata_xsd_tmp)
-   except OSError:
-   pass
+   portage.util.apply_secpass_permissions(metadata_xsd,
+   gid=portage.data.portage_gid, mode=0o664, 
mask=0o2)
+   except portage.exception.PortageException:
+   pass
 
return True
 



[gentoo-commits] proj/portage:master commit in: repoman/

2020-03-14 Thread Zac Medico
commit: 8494160c57cbe38a2f2f7b3aa5b72eb4a122fdff
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Mar 15 01:58:43 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Mar 15 01:58:56 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=8494160c

repoman: Update for a repoman-2.3.21 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 6 ++
 repoman/setup.py  | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index 849cf6a42..486c4f46c 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,12 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.21
+==
+* Bug Fixes:
+- Bug 712106 prevent spurious copyright header updates
+
+
 repoman-2.3.20
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index d8cf68a99..c3059003f 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -450,7 +450,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.20',
+   version = '2.3.21',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/vcs/git/

2020-03-14 Thread Zac Medico
commit: c93dc19cb0f8d5769ee13b7f2ccaeaf661013f30
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Mar 15 01:44:27 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Mar 15 01:46:24 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=c93dc19c

repoman.modules.vcs.git.changes: reindex (bug 712106)

For files returned by git diff-index, call git update-index in order
to ensure that the index reflects the state on disk. This will prevent
incorrect assumptions in cases where the index is missing or stale for
some reason. Since repoman uses this information to decide when to
update copyright header dates, this can prevent spurious copyright
header updates.

Signed-off-by: Zac Medico  gentoo.org>
Bug: https://bugs.gentoo.org/712106

 repoman/lib/repoman/modules/vcs/git/changes.py | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/repoman/lib/repoman/modules/vcs/git/changes.py 
b/repoman/lib/repoman/modules/vcs/git/changes.py
index 7e9ac1eb5..550028434 100644
--- a/repoman/lib/repoman/modules/vcs/git/changes.py
+++ b/repoman/lib/repoman/modules/vcs/git/changes.py
@@ -29,8 +29,16 @@ class Changes(ChangesBase):
'''
super(Changes, self).__init__(options, repo_settings)
 
-   def _scan(self):
-   '''VCS type scan function, looks for all detectable changes'''
+   def _scan(self, _reindex=True):
+   '''
+   VCS type scan function, looks for all detectable changes
+
+   @param _reindex: ensure that the git index reflects the state on
+   disk for files returned by git diff-index (this 
parameter is
+   used in recursive calls and it's not intended to be 
used for
+   any other reason)
+   @type _reindex: bool
+   '''
with repoman_popen(
"git diff-index --name-only "
"--relative --diff-filter=M HEAD") as f:
@@ -51,6 +59,9 @@ class Changes(ChangesBase):
removed = f.readlines()
self.removed = ["./" + elem[:-1] for elem in removed]
del removed
+   if _reindex and (self.changed or self.new or self.removed):
+   self.update_index([], self.changed + self.new + 
self.removed)
+   self._scan(_reindex=False)
 
@property
def unadded(self):
@@ -91,7 +102,7 @@ class Changes(ChangesBase):
# of the working tree.
myfiles = mymanifests + myupdates
myfiles.sort()
-   update_index_cmd = ["git", "update-index"]
+   update_index_cmd = ["git", "update-index", "--add", "--remove"]
update_index_cmd.extend(f.lstrip("./") for f in myfiles)
if self.options.pretend:
print("(%s)" % (" ".join(update_index_cmd),))



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/workaround/, repoman/cnf/linechecks/, ...

2020-03-05 Thread Mike Gilbert
commit: 2d9836a0c8bb313fa66581e6cf27fb1a86ada170
Author: Mike Gilbert  gentoo  org>
AuthorDate: Thu Mar  5 20:26:29 2020 +
Commit: Mike Gilbert  gentoo  org>
CommitDate: Thu Mar  5 21:28:26 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=2d9836a0

repoman: remove check for addpredict

This function has not been deprecated, and developers generally have a
good reason for using it. A repoman warning for this is just noise.

No reason was given when this check was added in 2010, and it was requested
by a developer who has since retired.

Signed-off-by: Mike Gilbert  gentoo.org>
Reviewed-by: Zac Medico  gentoo.org>

 repoman/cnf/linechecks/linechecks.yaml   | 1 -
 repoman/cnf/repository/repository.yaml   | 1 -
 repoman/lib/repoman/modules/linechecks/workaround/__init__.py| 6 --
 repoman/lib/repoman/modules/linechecks/workaround/workarounds.py | 7 ---
 4 files changed, 15 deletions(-)

diff --git a/repoman/cnf/linechecks/linechecks.yaml 
b/repoman/cnf/linechecks/linechecks.yaml
index 410bcd9c5..2182b467a 100644
--- a/repoman/cnf/linechecks/linechecks.yaml
+++ b/repoman/cnf/linechecks/linechecks.yaml
@@ -28,7 +28,6 @@ errors:
 PRESERVE_OLD_LIB: 'Ebuild calls deprecated preserve_old_lib'
 BUILT_WITH_USE: 'built_with_use'
 NO_OFFSET_WITH_HELPERS: 'Helper function is used with D, ROOT, ED, EROOT 
or EPREFIX'
-SANDBOX_ADDPREDICT: 'Ebuild calls addpredict'
 USEQ_ERROR: 'Ebuild calls deprecated useq function'
 HASQ_ERROR: 'Ebuild calls deprecated hasq function'
 URI_HTTPS: 'Ebuild uses http:// but should use https://'

diff --git a/repoman/cnf/repository/repository.yaml 
b/repoman/cnf/repository/repository.yaml
index 935260424..ad00d18c1 100644
--- a/repoman/cnf/repository/repository.yaml
+++ b/repoman/cnf/repository/repository.yaml
@@ -71,6 +71,5 @@ linechecks_modules:
 uselessdodoc
 whitespace
 blankline
-addpredict
 noasneeded
 

diff --git a/repoman/lib/repoman/modules/linechecks/workaround/__init__.py 
b/repoman/lib/repoman/modules/linechecks/workaround/__init__.py
index 425085a5c..694695015 100644
--- a/repoman/lib/repoman/modules/linechecks/workaround/__init__.py
+++ b/repoman/lib/repoman/modules/linechecks/workaround/__init__.py
@@ -10,12 +10,6 @@ module_spec = {
'name': 'do',
'description': doc,
'provides':{
-   'addpredict-check': {
-   'name': "addpredict",
-   'sourcefile': "workarounds",
-   'class': "SandboxAddpredict",
-   'description': doc,
-   },
'noasneeded-check': {
'name': "noasneeded",
'sourcefile': "workarounds",

diff --git a/repoman/lib/repoman/modules/linechecks/workaround/workarounds.py 
b/repoman/lib/repoman/modules/linechecks/workaround/workarounds.py
index 37cb54314..768a47e8e 100644
--- a/repoman/lib/repoman/modules/linechecks/workaround/workarounds.py
+++ b/repoman/lib/repoman/modules/linechecks/workaround/workarounds.py
@@ -9,10 +9,3 @@ class NoAsNeeded(LineCheck):
repoman_check_name = 'upstream.workaround'
re = re.compile(r'.*\$\(no-as-needed\)')
error = 'NO_AS_NEEDED'
-
-
-class SandboxAddpredict(LineCheck):
-   """Check for calls to the addpredict function."""
-   repoman_check_name = 'upstream.workaround'
-   re = re.compile(r'(^|\s)addpredict\b')
-   error = 'SANDBOX_ADDPREDICT'



[gentoo-commits] proj/portage:master commit in: repoman/, /

2020-03-01 Thread Zac Medico
commit: d4d1c3110a5bcea44e3c62e8c86d7a999325a61e
Author: Manuel Rüger  rueg  eu>
AuthorDate: Sun Mar  1 12:44:56 2020 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Mar  1 18:41:46 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=d4d1c311

Add python3.9 support

Closes: https://github.com/gentoo/portage/pull/515
Signed-off-by: Zac Medico  gentoo.org>

 .travis.yml  | 3 ++-
 repoman/runtests | 8 
 runtests | 8 
 tox.ini  | 4 ++--
 4 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 5123141ac..9269d4034 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,7 +3,8 @@ python:
 - 2.7
 - 3.6
 - 3.7
-- 3.8-dev
+- 3.8
+- 3.9-dev
 - pypy3
 
 # command to install dependencies

diff --git a/repoman/runtests b/repoman/runtests
index 1ef52f482..bbda4526f 100755
--- a/repoman/runtests
+++ b/repoman/runtests
@@ -24,14 +24,14 @@ import tempfile
 # These are the versions we fully support and require to pass tests.
 PYTHON_SUPPORTED_VERSIONS = [
'2.7',
-   '3.5',
'3.6',
-   '3.7'
+   '3.7',
+   '3.8'
 ]
 # The rest are just "nice to have".
 PYTHON_NICE_VERSIONS = [
-   'pypy',
-   '3.8'
+   'pypy3',
+   '3.9'
 ]
 
 EPREFIX = os.environ.get('PORTAGE_OVERRIDE_EPREFIX', '/')

diff --git a/runtests b/runtests
index 50d7b8251..11c317dff 100755
--- a/runtests
+++ b/runtests
@@ -24,14 +24,14 @@ import tempfile
 # These are the versions we fully support and require to pass tests.
 PYTHON_SUPPORTED_VERSIONS = [
'2.7',
-   '3.5',
'3.6',
-   '3.7'
+   '3.7',
+   '3.8'
 ]
 # The rest are just "nice to have".
 PYTHON_NICE_VERSIONS = [
-   'pypy',
-   '3.8'
+   'pypy3',
+   '3.9'
 ]
 
 EPREFIX = os.environ.get('PORTAGE_OVERRIDE_EPREFIX', '/')

diff --git a/tox.ini b/tox.ini
index 5ba192d2e..79b5b45cb 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,12 +1,12 @@
 [tox]
-envlist = py27,py36,py37,py38,pypy3
+envlist = py27,py36,py37,py38,py39,pypy3
 skipsdist = True
 
 [testenv]
 deps =
pygost
pyyaml
-   py27,py36,py37,py38,pypy3: lxml!=4.2.0
+   py27,py36,py37,py38,py39,pypy3: lxml!=4.2.0
py27: pyblake2
py27: pysha3
 setenv =



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/deprecated/

2020-02-26 Thread Michał Górny
commit: 467b285a0ba24866da97ada12c8b6af56fcba90e
Author: Michał Górny  gentoo  org>
AuthorDate: Wed Feb 26 14:33:51 2020 +
Commit: Michał Górny  gentoo  org>
CommitDate: Wed Feb 26 18:08:07 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=467b285a

repoman: Restore eclass deprecations lost in rewrite

Reviewed-by: Zac Medico  gentoo.org>
Signed-off-by: Michał Górny  gentoo.org>

 repoman/lib/repoman/modules/linechecks/deprecated/inherit.py | 5 +
 1 file changed, 5 insertions(+)

diff --git a/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py 
b/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
index 9cef086da..f307d46fd 100644
--- a/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
+++ b/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
@@ -11,6 +11,8 @@ class InheritDeprecated(LineCheck):
 
# deprecated eclass : new eclass (False if no new eclass)
deprecated_eclasses = {
+   "autotools-multilib": "multilib-minimal",
+   "autotools-utils": False,
"base": False,
"bash-completion": "bash-completion-r1",
"boost-utils": False,
@@ -18,8 +20,10 @@ class InheritDeprecated(LineCheck):
"confutils": False,
"distutils": "distutils-r1",
"epatch": "(eapply since EAPI 6)",
+   "fdo-mime": "xdg-utils",
"games": False,
"gems": "ruby-fakegem",
+   "git-2": "git-r3",
"gpe": False,
"gst-plugins-bad": "gstreamer",
"gst-plugins-base": "gstreamer",
@@ -33,6 +37,7 @@ class InheritDeprecated(LineCheck):
"user": "GLEP 81",
"versionator": "eapi7-ver (built-in since EAPI 7)",
"x-modular": "xorg-2",
+   "xfconf": False,
}
 
_inherit_re = re.compile(r'^\s*inherit\s(.*)$')



[gentoo-commits] proj/portage:master commit in: repoman/man/, repoman/lib/repoman/, repoman/lib/repoman/modules/scan/depend/, ...

2019-12-05 Thread Zac Medico
commit: 1b1e0fcf0adf4aab07083edcd3bc82a988732137
Author: Zac Medico  gentoo  org>
AuthorDate: Thu Dec  5 22:23:28 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Dec  6 07:20:29 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=1b1e0fcf

repoman: support profiles/package.deprecated (bug 702100)

Bug: https://bugs.gentoo.org/702100
Signed-off-by: Zac Medico  gentoo.org>

 repoman/cnf/qa_data/qa_data.yaml  |  1 +
 repoman/cnf/repository/qa_data.yaml   |  1 +
 repoman/lib/repoman/modules/scan/depend/_depend_checks.py | 14 ++
 repoman/lib/repoman/scanner.py|  4 
 repoman/man/repoman.1 |  3 +++
 5 files changed, 23 insertions(+)

diff --git a/repoman/cnf/qa_data/qa_data.yaml b/repoman/cnf/qa_data/qa_data.yaml
index 6aad56b8c..9a807aaf3 100644
--- a/repoman/cnf/qa_data/qa_data.yaml
+++ b/repoman/cnf/qa_data/qa_data.yaml
@@ -26,6 +26,7 @@ qahelp:
 badinexp: "User-visible ebuilds with unsatisfied dependencies (matched 
against *visible* ebuilds) in experimental arch"
 badmaskedinexp: "Masked ebuilds with unsatisfied dependencies (matched 
against *all* ebuilds) in experimental arch"
 badtilde: "Uses the ~ dep operator with a non-zero revision part, 
which is useless (the revision is ignored)"
+deprecated: "Ebuild has a dependency that refers to a deprecated 
package"
 equalsversion: "Suspicious =-dependency with a specific version and no 
rev. Please either use ~ if any revision is acceptable, or append -r0 to 
silence the warning."
 missingslot: "RDEPEND matches more than one SLOT but does not specify 
a slot and/or use the := or :* slot operator"
 perlcore: "This ebuild directly depends on a package in perl-core; it 
should use the corresponding virtual instead."

diff --git a/repoman/cnf/repository/qa_data.yaml 
b/repoman/cnf/repository/qa_data.yaml
index c96ce46a9..464482056 100644
--- a/repoman/cnf/repository/qa_data.yaml
+++ b/repoman/cnf/repository/qa_data.yaml
@@ -44,6 +44,7 @@ qawarnings:
 - dependency.badindev
 - dependency.badmaskedindev
 - dependency.badtilde
+- dependency.deprecated
 - dependency.equalsversion
 - dependency.missingslot
 - dependency.perlcore

diff --git a/repoman/lib/repoman/modules/scan/depend/_depend_checks.py 
b/repoman/lib/repoman/modules/scan/depend/_depend_checks.py
index 690b95aa0..e01024da2 100644
--- a/repoman/lib/repoman/modules/scan/depend/_depend_checks.py
+++ b/repoman/lib/repoman/modules/scan/depend/_depend_checks.py
@@ -108,6 +108,20 @@ def _depend_checks(ebuild, pkg, portdb, qatracker, 
repo_metadata, qadata):
not atom.cp.startswith("virtual/"):
unknown_pkgs.add((mytype, 
atom.unevaluated_atom))
 
+   if not atom.blocker:
+   all_deprecated = False
+   for pkg_match in 
portdb.xmatch("match-all", atom):
+   if 
any(repo_metadata['package.deprecated'].iterAtomsForPackage(pkg_match)):
+   all_deprecated = True
+   else:
+   all_deprecated = False
+   break
+
+   if all_deprecated:
+   qatracker.add_error(
+   'dependency.deprecated',
+   ebuild.relative_path + 
": '%s'" % atom)
+
if pkg.category != "virtual":
if not is_blocker and \
atom.cp in 
qadata.suspect_virtual:

diff --git a/repoman/lib/repoman/scanner.py b/repoman/lib/repoman/scanner.py
index 06234b0ad..5db54bb97 100644
--- a/repoman/lib/repoman/scanner.py
+++ b/repoman/lib/repoman/scanner.py
@@ -8,6 +8,7 @@ from itertools import chain
 import portage
 from portage import normalize_path
 from portage import os
+from portage._sets.base import InternalPackageSet
 from portage.output import green
 from portage.util.futures.extendedfutures import ExtendedFuture
 from repoman.metadata import get_metadata_xsd
@@ -93,6 +94,9 @@ class Scanner(object):
'profile_list': profile_list,
'pmaskdict': global_pmaskdict,
'lic_deprecated': liclist_deprecated,
+   'package.deprecated': 
InternalPackageSet(initial_atoms=portage.util.stack_lists(
+   
[portage.util.grabfile_package(os.path.join(path, 'profiles', 
'package.deprecated'), 

[gentoo-commits] proj/portage:master commit in: repoman/

2019-12-05 Thread Zac Medico
commit: a1bdfbffd155baa4b946d2ce52ffb2021f903b23
Author: Zac Medico  gentoo  org>
AuthorDate: Fri Dec  6 07:35:57 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Dec  6 07:36:04 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a1bdfbff

repoman-2.3.20

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 7 +++
 repoman/setup.py  | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index eaba6a1d7..849cf6a42 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,13 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.20
+==
+* Bug Fixes:
+- Bug 541076 repoman commit: ignore unadded hidden files
+- Bug 702100 repoman: support profiles/package.deprecated
+
+
 repoman-2.3.19
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index c265dbe75..d8cf68a99 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -450,7 +450,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.19',
+   version = '2.3.20',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2019-12-03 Thread Zac Medico
commit: 1c2e99fbf21675c8335ab8a3eee0ed58e89c4342
Author: Zac Medico  sony  com>
AuthorDate: Tue Dec  3 23:14:54 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Dec  3 23:18:02 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=1c2e99fb

repoman commit: ignore unadded hidden files except '.' itself

Fixes: a561ac910331 ("repoman commit: ignore unadded hidden files")
Bug: https://bugs.gentoo.org/541076
Copyright: Sony Interactive Entertainment Inc.
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/actions.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
index 2817fa58a..387ba7800 100644
--- a/repoman/lib/repoman/actions.py
+++ b/repoman/lib/repoman/actions.py
@@ -334,7 +334,7 @@ the whole commit message to abort.
if myunadded:
for x in range(len(myunadded) - 1, -1, -1):
xs = myunadded[x].split("/")
-   if (any(token.startswith('.') for token in xs) 
or
+   if (any(token.startswith('.') and token != '.' 
for token in xs) or

self.repo_settings.repo_config.find_invalid_path_char(myunadded[x]) != -1):
# The Manifest excludes this file,
# so it's safe to ignore.



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2019-12-03 Thread Zac Medico
commit: a561ac910331657ffb281ca2b16bb1c8d075770e
Author: Zac Medico  sony  com>
AuthorDate: Tue Dec  3 22:59:17 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Dec  3 23:07:26 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a561ac91

repoman commit: ignore unadded hidden files

Bug: https://bugs.gentoo.org/541076
Copyright: Sony Interactive Entertainment Inc.
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/actions.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
index 56a5255bf..2817fa58a 100644
--- a/repoman/lib/repoman/actions.py
+++ b/repoman/lib/repoman/actions.py
@@ -334,7 +334,8 @@ the whole commit message to abort.
if myunadded:
for x in range(len(myunadded) - 1, -1, -1):
xs = myunadded[x].split("/")
-   if 
self.repo_settings.repo_config.find_invalid_path_char(myunadded[x]) != -1:
+   if (any(token.startswith('.') for token in xs) 
or
+   
self.repo_settings.repo_config.find_invalid_path_char(myunadded[x]) != -1):
# The Manifest excludes this file,
# so it's safe to ignore.
del myunadded[x]



[gentoo-commits] proj/portage:master commit in: repoman/

2019-11-26 Thread Zac Medico
commit: 9ce78a6455cda58646694a61a287bf6f33704676
Author: Zac Medico  gentoo  org>
AuthorDate: Wed Nov 27 04:05:37 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Nov 27 04:05:51 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=9ce78a64

repoman: Update for a repoman-2.3.19 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 7 +++
 repoman/setup.py  | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index dd6b1c6ac..eaba6a1d7 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,13 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.19
+==
+* Bug Fixes:
+- Bug 667432 Rename DCO_SIGNED_OFF_BY config variable to SIGNED_OFF_BY.
+- Bug 700456 Add --include-profiles=PROFILES
+
+
 repoman-2.3.18
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index fef1e9450..c265dbe75 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -450,7 +450,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.18',
+   version = '2.3.19',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/man/

2019-11-21 Thread Zac Medico
commit: 0d7aa0d4991f402c2ff7c386419e177a5244c9a0
Author: Zac Medico  gentoo  org>
AuthorDate: Thu Nov 21 20:16:08 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Thu Nov 21 20:17:25 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=0d7aa0d4

repoman/man/repoman.1: fix \fI typo

$ groff -man repoman/man/repoman.1 >/dev/null
repoman/man/repoman.1:105: warning: can't find font `L'

Reported-by: Ulrich Müller  gentoo.org>
Fixes: 2ecf4e2b0ebd ("repoman: add --experimental-repository-modules= 
option")
Signed-off-by: Zac Medico  gentoo.org>

 repoman/man/repoman.1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repoman/man/repoman.1 b/repoman/man/repoman.1
index f33fb6098..7bd440a4c 100644
--- a/repoman/man/repoman.1
+++ b/repoman/man/repoman.1
@@ -102,7 +102,7 @@ internal eclass database becomes outdated.
 .TP
 \fB\-\-experimental\-repository\-modules=\fR
 Enable experimental repository modules:
-\fLhttps://wiki.gentoo.org/wiki/Project:Portage/Repoman-Module-specs\fR
+\fIhttps://wiki.gentoo.org/wiki/Project:Portage/Repoman-Module-specs\fR
 .TP
 \fB\-\-if\-modified=\fR
 Only check packages that have uncommitted modifications



[gentoo-commits] proj/portage:master commit in: repoman/man/, repoman/lib/repoman/tests/simple/, repoman/lib/repoman/, ...

2019-11-20 Thread Zac Medico
commit: e9bb1e9681685f4e4d7174f51751356fd3f67d0c
Author: Sergei Trofimovich  gentoo  org>
AuthorDate: Tue Nov 19 00:21:13 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed Nov 20 10:29:14 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=e9bb1e96

repoman: add --include-profiles=PROFILES

repoman slows down ~linearly with amount of profiles being scanned.
In case of amd64 we have 28 stable profiles.

To speed up processing and fit into time budged of various CIs we can
split the work across different processes that handle different profiles.

Example benchmark on ::haskell overlay:
$ ./repoman full --include-arches=amd64
~65 minutes
$ ./repoman full --include-profiles=default/linux/amd64/17.0
~4 minutes
This allows for a crude sharding of work across processes and allows for
cheap tree-wide scans for early failures.

Bug: https://bugs.gentoo.org/700456
Signed-off-by: Sergei Trofimovich  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/actions.py  | 4 
 repoman/lib/repoman/argparser.py| 7 +++
 repoman/lib/repoman/modules/scan/depend/__init__.py | 3 ++-
 repoman/lib/repoman/modules/scan/depend/profile.py  | 9 +++--
 repoman/lib/repoman/scanner.py  | 5 +
 repoman/lib/repoman/tests/simple/test_simple.py | 1 +
 repoman/man/repoman.1   | 4 
 7 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
index 1c9989a72..92d4d4e94 100644
--- a/repoman/lib/repoman/actions.py
+++ b/repoman/lib/repoman/actions.py
@@ -412,6 +412,10 @@ the whole commit message to abort.
report_options.append(
"--include-arches=\"%s\"" %
" ".join(sorted(self.scanner.include_arches)))
+   if self.scanner.include_profiles is not None:
+   report_options.append(
+   "--include-profiles=\"%s\"" %
+   " ".join(sorted(self.scanner.include_profiles)))
 
if portage_version is None:
sys.stderr.write("Failed to insert portage version in 
message!\n")

diff --git a/repoman/lib/repoman/argparser.py b/repoman/lib/repoman/argparser.py
index fa0e6ff90..670a0e91d 100644
--- a/repoman/lib/repoman/argparser.py
+++ b/repoman/lib/repoman/argparser.py
@@ -164,6 +164,13 @@ def parse_args(argv, repoman_default_opts):
'A space separated list of arches used to '
'filter the selection of profiles for dependency 
checks'))
 
+   parser.add_argument(
+   '--include-profiles',
+   dest='include_profiles', metavar='PROFILES', action='append',
+   help=(
+   'A space separated list of profiles used to '
+   'define the selection of profiles for dependency 
checks'))
+
parser.add_argument(
'-d', '--include-dev', dest='include_dev', action='store_true',
default=False,

diff --git a/repoman/lib/repoman/modules/scan/depend/__init__.py 
b/repoman/lib/repoman/modules/scan/depend/__init__.py
index c3cc0ddeb..9068760bb 100644
--- a/repoman/lib/repoman/modules/scan/depend/__init__.py
+++ b/repoman/lib/repoman/modules/scan/depend/__init__.py
@@ -19,7 +19,8 @@ module_spec = {
'func_desc': {
},
'mod_kwargs': ['qatracker', 'portdb', 'profiles', 
'options',
-   'repo_metadata', 'repo_settings', 
'include_arches', 'caches',
+   'repo_metadata', 'repo_settings', 
'include_arches',
+   'include_profiles', 'caches',
'repoman_incrementals', 'env', 'have', 
'dev_keywords'
],
'func_kwargs': {

diff --git a/repoman/lib/repoman/modules/scan/depend/profile.py 
b/repoman/lib/repoman/modules/scan/depend/profile.py
index d980f4eca..39d8b550c 100644
--- a/repoman/lib/repoman/modules/scan/depend/profile.py
+++ b/repoman/lib/repoman/modules/scan/depend/profile.py
@@ -33,6 +33,7 @@ class ProfileDependsChecks(ScanBase):
@param options: cli options
@param repo_settings: repository settings instance
@param include_arches: set
+   @param include_profiles: set
@param caches: dictionary of our caches
@param repoman_incrementals: tuple
@param env: the environment
@@ -46,6 +47,7 @@ class ProfileDependsChecks(ScanBase):
self.options = kwargs.get('options')
self.repo_settings = kwargs.get('repo_settings')
self.include_arches = kwargs.get('include_arches')
+   

[gentoo-commits] proj/portage:master commit in: repoman/

2019-11-08 Thread Zac Medico
commit: a78584964cdab8c3c7eb437c83688dacc04a5a8f
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Nov  9 05:49:46 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Nov  9 05:50:52 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a7858496

repoman: Update for a repoman-2.3.18 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 8 
 repoman/setup.py  | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index e252d0124..dd6b1c6ac 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,14 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.18
+==
+* Bug Fixes:
+- Bug 690786 Support metadata/layout.conf restrict-allowed
+- Bug 699514 Detect dosym absolute paths starting with ${D}, ${ED} etc.
+- Bug 699508 Fix unsafe string interpolation.
+
+
 repoman-2.3.17
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index ebbf0a633..fef1e9450 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -450,7 +450,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.17',
+   version = '2.3.18',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/tests/commit/

2019-11-08 Thread Zac Medico
commit: 240060f32e3a21233a89f751e7f42b0bfa9a1712
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Nov  9 04:43:26 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Nov  9 04:43:48 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=240060f3

CommitMessageVerificationTest: fix DeprecationWarning for assertRegexpMatches

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/tests/commit/test_commitmsg.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repoman/lib/repoman/tests/commit/test_commitmsg.py 
b/repoman/lib/repoman/tests/commit/test_commitmsg.py
index a734c1065..83fa0f37c 100644
--- a/repoman/lib/repoman/tests/commit/test_commitmsg.py
+++ b/repoman/lib/repoman/tests/commit/test_commitmsg.py
@@ -29,7 +29,7 @@ Expected: /%s/''' % (commitmsg, reason_re))
 Expected: /%s/
 Errors:
 %s''' % (commitmsg, reason_re, expl))
-   self.assertRegexpMatches(expl, reason_re,
+   (self.assertRegex if hasattr(self, 'assertRegex') else 
self.assertRegexpMatches)(expl, reason_re,
'''Commit message verification did not return 
expected error, for:
 %s
 



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/do/

2019-11-08 Thread Zac Medico
commit: 219e9bed020b67e78e96c5cded6ece7f7f68fb06
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Nov  9 04:57:14 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Nov  9 04:59:15 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=219e9bed

repoman: ebuild.absdosym check: fix AttributeError for re.ASCII under python2.7

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/modules/linechecks/do/dosym.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repoman/lib/repoman/modules/linechecks/do/dosym.py 
b/repoman/lib/repoman/modules/linechecks/do/dosym.py
index d1aed74d7..37c0ac535 100644
--- a/repoman/lib/repoman/modules/linechecks/do/dosym.py
+++ b/repoman/lib/repoman/modules/linechecks/do/dosym.py
@@ -10,7 +10,7 @@ class EbuildNonRelativeDosym(LineCheck):
variables = ('D', 'ED', 'ROOT', 'EROOT', 'BROOT')
regex = re.compile(

r'^\s*dosym\s+(["\']?((\$(%s)\W|\${(%s)(%%/)?})|/(bin|etc|lib|opt|sbin|srv|usr|var))\S*)'
 %
-   ('|'.join(variables), '|'.join(variables)), re.ASCII)
+   ('|'.join(variables), '|'.join(variables)), getattr(re, 
'ASCII', 0))
 
def check(self, num, line):
match = self.regex.match(line)



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/do/, ...

2019-11-08 Thread Zac Medico
commit: bb6a2ca9ccc8d3d6f7feb7c9ac6b6c2b40ce9d28
Author: Arfrever Frehtes Taifersar Arahesis  Apache  Org>
AuthorDate: Sat Nov  9 03:39:53 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Nov  9 04:06:05 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=bb6a2ca9

repoman: Fix unsafe string interpolation.

"on line: %d" etc. is no longer included in messages returned from individual 
checks.
"line %d: " is now consistently added by controller directly after ebuild path
and precedes specific message.

Example:
   app-misc/test/test-0.ebuild: line 5: please migrate from 'games' (no 
replacement)
   app-misc/test/test-0.ebuild: line 5: please migrate from 'versionator' to 
'eapi7-ver (built-in since EAPI 7)'
   app-misc/test/test-0.ebuild: line 10: Useless blank line
   app-misc/test/test-0.ebuild: line 20: 'econf' call should be moved to 
src_configure

Bug: https://bugs.gentoo.org/699508
Signed-off-by: Arfrever Frehtes Taifersar Arahesis  Apache.Org>
Signed-off-by: Zac Medico  gentoo.org>

 repoman/cnf/linechecks/linechecks.yaml | 46 +++---
 repoman/lib/repoman/modules/linechecks/base.py |  5 +--
 .../lib/repoman/modules/linechecks/controller.py   | 12 --
 .../modules/linechecks/deprecated/inherit.py   | 18 +++--
 repoman/lib/repoman/modules/linechecks/do/dosym.py |  2 +-
 .../lib/repoman/modules/linechecks/eapi/checks.py  | 10 ++---
 .../lib/repoman/modules/linechecks/emake/emake.py  |  2 +-
 .../lib/repoman/modules/linechecks/phases/phase.py |  4 +-
 .../repoman/modules/linechecks/portage/internal.py |  7 +---
 .../repoman/modules/linechecks/quotes/quoteda.py   |  2 +-
 .../repoman/modules/linechecks/useless/dodoc.py|  2 +-
 .../repoman/modules/linechecks/whitespace/blank.py |  2 +-
 12 files changed, 53 insertions(+), 59 deletions(-)

diff --git a/repoman/cnf/linechecks/linechecks.yaml 
b/repoman/cnf/linechecks/linechecks.yaml
index c452af07d..410bcd9c5 100644
--- a/repoman/cnf/linechecks/linechecks.yaml
+++ b/repoman/cnf/linechecks/linechecks.yaml
@@ -9,27 +9,27 @@ repoman_version: 2.3.3
 # configuration file for the LineCheck plugins run via the multicheck
 # scan module
 errors:
-COPYRIGHT_ERROR: 'Invalid Copyright on line: %d'
-LICENSE_ERROR: 'Invalid Gentoo/GPL License on line: %d'
-ID_HEADER_ERROR: 'Stale CVS header on line: %d'
-NO_BLANK_LINE_ERROR: 'Non-blank line after header on line: %d'
-LEADING_SPACES_ERROR: 'Ebuild contains leading spaces on line: %d'
-TRAILING_WHITESPACE_ERROR: 'Trailing whitespace error on line: %d'
-READONLY_ASSIGNMENT_ERROR: 'Ebuild contains assignment to read-only 
variable on line: %d'
-MISSING_QUOTES_ERROR: 'Unquoted Variable on line: %d'
-NESTED_DIE_ERROR: 'Ebuild calls die in a subshell on line: %d'
-PATCHES_ERROR: 'PATCHES is not a bash array on line: %d'
-REDUNDANT_CD_S_ERROR: 'Ebuild has redundant cd ${S} statement on line: %d'
-EMAKE_PARALLEL_DISABLED: 'Upstream parallel compilation bug (ebuild calls 
emake -j1 on line: %d)'
-EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS: 'Upstream parallel compilation bug 
(MAKEOPTS=-j1 on line: %d)'
-DEPRECATED_BINDNOW_FLAGS: 'Deprecated bindnow-flags call on line: %d'
-EAPI_DEFINED_AFTER_INHERIT: 'EAPI defined after inherit on line: %d'
-NO_AS_NEEDED: 'Upstream asneeded linking bug (no-as-needed on line: %d)'
-PRESERVE_OLD_LIB: 'Ebuild calls deprecated preserve_old_lib on line: %d'
-BUILT_WITH_USE: 'built_with_use on line: %d'
-NO_OFFSET_WITH_HELPERS: 'Helper function is used with D, ROOT, ED, EROOT 
or EPREFIX on line: %d'
-SANDBOX_ADDPREDICT: 'Ebuild calls addpredict on line: %d'
-USEQ_ERROR: 'Ebuild calls deprecated useq function on line: %d'
-HASQ_ERROR: 'Ebuild calls deprecated hasq function on line: %d'
-URI_HTTPS: 'Ebuild uses http:// but should use https:// on line: %d'
+COPYRIGHT_ERROR: 'Invalid Copyright'
+LICENSE_ERROR: 'Invalid Gentoo/GPL License'
+ID_HEADER_ERROR: 'Stale CVS header'
+NO_BLANK_LINE_ERROR: 'Non-blank line after header'
+LEADING_SPACES_ERROR: 'Ebuild contains leading spaces'
+TRAILING_WHITESPACE_ERROR: 'Trailing whitespace error'
+READONLY_ASSIGNMENT_ERROR: 'Ebuild contains assignment to read-only 
variable'
+MISSING_QUOTES_ERROR: 'Unquoted Variable'
+NESTED_DIE_ERROR: 'Ebuild calls die in a subshell'
+PATCHES_ERROR: 'PATCHES is not a bash array'
+REDUNDANT_CD_S_ERROR: 'Ebuild has redundant cd ${S} statement'
+EMAKE_PARALLEL_DISABLED: 'Upstream parallel compilation bug (ebuild calls 
emake -j1)'
+EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS: 'Upstream parallel compilation bug 
(MAKEOPTS=-j1)'
+DEPRECATED_BINDNOW_FLAGS: 'Deprecated bindnow-flags call'
+EAPI_DEFINED_AFTER_INHERIT: 'EAPI defined after inherit'
+NO_AS_NEEDED: 'Upstream asneeded linking bug (no-as-needed)'
+PRESERVE_OLD_LIB: 'Ebuild calls deprecated preserve_old_lib'
+BUILT_WITH_USE: 

[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/

2019-11-07 Thread Zac Medico
commit: d8879e74458935919a4303f4fd1d2d24eb92e094
Author: Zac Medico  gentoo  org>
AuthorDate: Fri Nov  8 05:42:16 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Nov  8 05:43:26 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=d8879e74

Revert "repoman: fix unsafe string interpolation (bug 699508)"

This reverts commit d156784fd7557e8f5ce8a6de5cd3a6a38a78e436.
The 'on line: %d' string fails to match some messages.

Reported-by: Arfrever Frehtes Taifersar Arahesis  Apache.Org>
Bug: https://bugs.gentoo.org/699508
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/modules/linechecks/controller.py | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/repoman/lib/repoman/modules/linechecks/controller.py 
b/repoman/lib/repoman/modules/linechecks/controller.py
index b468e348d..7082a5d02 100644
--- a/repoman/lib/repoman/modules/linechecks/controller.py
+++ b/repoman/lib/repoman/modules/linechecks/controller.py
@@ -1,6 +1,4 @@
 
-from __future__ import unicode_literals
-
 import logging
 import operator
 import os
@@ -138,8 +136,7 @@ class LineCheckController(object):
if not ignore or not 
ignore.match(line):
e = lc.check(num, line)
if e:
-   # String 
interpolation on the variable e is unsafe because it can contain % characters.
-   yield 
lc.repoman_check_name, e.replace('on line: %d', 'on line: %d' % strnum + 1)
+   yield 
lc.repoman_check_name, e % (num + 1)
 
for lc in checks:
i = lc.end()



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/

2019-11-07 Thread Zac Medico
commit: d156784fd7557e8f5ce8a6de5cd3a6a38a78e436
Author: Zac Medico  gentoo  org>
AuthorDate: Fri Nov  8 04:52:42 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Nov  8 04:54:37 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=d156784f

repoman: fix unsafe string interpolation (bug 699508)

Reported-by: Arfrever Frehtes Taifersar Arahesis  Apache.Org>
Bug: https://bugs.gentoo.org/699508
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/modules/linechecks/controller.py | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/repoman/lib/repoman/modules/linechecks/controller.py 
b/repoman/lib/repoman/modules/linechecks/controller.py
index 7082a5d02..b468e348d 100644
--- a/repoman/lib/repoman/modules/linechecks/controller.py
+++ b/repoman/lib/repoman/modules/linechecks/controller.py
@@ -1,4 +1,6 @@
 
+from __future__ import unicode_literals
+
 import logging
 import operator
 import os
@@ -136,7 +138,8 @@ class LineCheckController(object):
if not ignore or not 
ignore.match(line):
e = lc.check(num, line)
if e:
-   yield 
lc.repoman_check_name, e % (num + 1)
+   # String 
interpolation on the variable e is unsafe because it can contain % characters.
+   yield 
lc.repoman_check_name, e.replace('on line: %d', 'on line: %d' % strnum + 1)
 
for lc in checks:
i = lc.end()



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/do/

2019-11-07 Thread Zac Medico
commit: 424f333b044a89f3a7a782ceef43480795696f3b
Author: Arfrever Frehtes Taifersar Arahesis  Apache  Org>
AuthorDate: Thu Nov  7 06:38:30 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Nov  8 04:31:42 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=424f333b

repoman: ebuild.absdosym check: Detect absolute paths starting with ${D}, ${ED} 
etc.

Bug: https://bugs.gentoo.org/699514
Signed-off-by: Arfrever Frehtes Taifersar Arahesis  Apache.Org>
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/modules/linechecks/do/dosym.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/repoman/lib/repoman/modules/linechecks/do/dosym.py 
b/repoman/lib/repoman/modules/linechecks/do/dosym.py
index bab4dad03..c342d3595 100644
--- a/repoman/lib/repoman/modules/linechecks/do/dosym.py
+++ b/repoman/lib/repoman/modules/linechecks/do/dosym.py
@@ -7,8 +7,10 @@ from repoman.modules.linechecks.base import LineCheck
 class EbuildNonRelativeDosym(LineCheck):
"""Check ebuild for dosym using absolute paths instead of relative."""
repoman_check_name = 'ebuild.absdosym'
+   variables = ('D', 'ED', 'ROOT', 'EROOT', 'BROOT')
regex = re.compile(
-   r'^\s*dosym\s+["\']?(/(bin|etc|lib|opt|sbin|srv|usr|var)\S*)')
+   
r'^\s*dosym\s+(["\']?((\$(%s)\W|\${(%s)(%%/)?})|/(bin|etc|lib|opt|sbin|srv|usr|var))\S*)'
 %
+   ('|'.join(variables), '|'.join(variables)), re.ASCII)
 
def check(self, num, line):
match = self.regex.match(line)



[gentoo-commits] proj/portage:master commit in: /, repoman/

2019-10-15 Thread Manuel Rüger
commit: a934cafcf928b9e8cf2aaf749dca68fa6fa689d7
Author: Manuel Rüger  gentoo  org>
AuthorDate: Mon Oct 14 23:22:57 2019 +
Commit: Manuel Rüger  gentoo  org>
CommitDate: Tue Oct 15 15:02:36 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a934cafc

Add python-3.8, drop python-3.4 from testing

Signed-off-by: Manuel Rüger  gentoo.org>

 .travis.yml  | 15 +--
 repoman/runtests |  6 +++---
 runtests |  6 +++---
 tox.ini  |  9 -
 4 files changed, 15 insertions(+), 21 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index ab0b8d304..b1b4bf26b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,18 +1,12 @@
 language: python
 python:
 - 2.7
-- 3.4
 - 3.5
 - 3.6
+- 3.7
+- 3.8-dev
 - pypy
 
-# See https://github.com/travis-ci/travis-ci/issues/9815
-matrix:
-  include:
-- python: 3.7
-  dist: xenial
-  sudo: required
-
 # command to install dependencies
 install:
 - pip install tox
@@ -21,8 +15,9 @@ script:
 - printf "[build_ext]\nportage-ext-modules=true" >> setup.cfg
 - ./setup.py test
 - ./setup.py install --root=/tmp/install-root
-- if [[ ${TRAVIS_PYTHON_VERSION} == ?.? ]]; then
-tox -e py${TRAVIS_PYTHON_VERSION/./};
+- if [[ ${TRAVIS_PYTHON_VERSION/-dev/} == ?.? ]]; then
+TOX_PYTHON_VERSION=${TRAVIS_PYTHON_VERSION/-dev/};
+tox -e py${TOX_PYTHON_VERSION/./};
   else
 tox -e ${TRAVIS_PYTHON_VERSION};
   fi

diff --git a/repoman/runtests b/repoman/runtests
index e208ab61d..1ef52f482 100755
--- a/repoman/runtests
+++ b/repoman/runtests
@@ -24,14 +24,14 @@ import tempfile
 # These are the versions we fully support and require to pass tests.
 PYTHON_SUPPORTED_VERSIONS = [
'2.7',
-   '3.4',
'3.5',
-   '3.6'
+   '3.6',
+   '3.7'
 ]
 # The rest are just "nice to have".
 PYTHON_NICE_VERSIONS = [
'pypy',
-   '3.7'
+   '3.8'
 ]
 
 EPREFIX = os.environ.get('PORTAGE_OVERRIDE_EPREFIX', '/')

diff --git a/runtests b/runtests
index 7c3ebb1ca..50d7b8251 100755
--- a/runtests
+++ b/runtests
@@ -24,14 +24,14 @@ import tempfile
 # These are the versions we fully support and require to pass tests.
 PYTHON_SUPPORTED_VERSIONS = [
'2.7',
-   '3.4',
'3.5',
-   '3.6'
+   '3.6',
+   '3.7'
 ]
 # The rest are just "nice to have".
 PYTHON_NICE_VERSIONS = [
'pypy',
-   '3.7'
+   '3.8'
 ]
 
 EPREFIX = os.environ.get('PORTAGE_OVERRIDE_EPREFIX', '/')

diff --git a/tox.ini b/tox.ini
index f49bd413f..378ff01e3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,15 +1,14 @@
 [tox]
-envlist = py27,py34,py35,py36,py37,pypy,pypy3
+envlist = py27,py35,py36,py37,py38,pypy,pypy3
 skipsdist = True
 
 [testenv]
 deps =
pygost
pyyaml
-   py34: lxml!=4.2.0,<4.4.0
-   py27,py35,py36,py37,pypy,pypy3: lxml!=4.2.0
-   py27,py34,py35,pypy: pyblake2
-   py27,py34,py35,pypy: pysha3
+   py27,py35,py36,py37,py38,pypy,pypy3: lxml!=4.2.0
+   py27,py35,pypy: pyblake2
+   py27,py35,pypy: pysha3
 setenv =
PYTHONPATH={toxinidir}/lib
 commands =



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/scan/metadata/, lib/portage/repository/

2019-08-18 Thread Zac Medico
commit: be21bd79e63282e48d9202d18b89bfd132aa4b2f
Author: Zac Medico  gentoo  org>
AuthorDate: Tue Aug  6 03:38:10 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Aug 19 01:48:48 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=be21bd79

repoman: support metadata/layout.conf restrict-allowed

Bug: https://bugs.gentoo.org/690786
Signed-off-by: Zac Medico  gentoo.org>

 lib/portage/repository/config.py  | 8 +++-
 repoman/lib/repoman/modules/scan/metadata/restrict.py | 6 +-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index 2b2b1e151..46bb6b65a 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -103,6 +103,7 @@ class RepoConfig(object):
'portage1_profiles_compat',
'priority',
'profile_formats',
+   'restrict_allowed',
'sign_commit',
'sign_manifest',
'strict_misc_digests',
@@ -339,7 +340,7 @@ class RepoConfig(object):
for value in ('allow-missing-manifest',
'cache-formats',
'create-manifest', 'disable-manifest', 
'manifest-hashes',
-   'manifest-required-hashes', 'profile-formats',
+   'manifest-required-hashes', 'profile-formats', 
'restrict-allowed',
'sign-commit', 'sign-manifest', 
'thin-manifest', 'update-changelog'):
setattr(self, value.lower().replace("-", "_"), 
layout_data[value])
 
@@ -1142,6 +1143,11 @@ def parse_layout_conf(repo_location, repo_name=None):
data['eapis-banned'] = tuple(layout_data.get('eapis-banned', 
'').split())
data['eapis-deprecated'] = tuple(layout_data.get('eapis-deprecated', 
'').split())
 
+   restrict_allowed = layout_data.get('restrict-allowed')
+   if restrict_allowed is not None:
+   restrict_allowed = tuple(restrict_allowed.split())
+   data['restrict-allowed'] = restrict_allowed
+
data['sign-commit'] = layout_data.get('sign-commits', 'false').lower() \
== 'true'
 

diff --git a/repoman/lib/repoman/modules/scan/metadata/restrict.py 
b/repoman/lib/repoman/modules/scan/metadata/restrict.py
index 99784f231..f39128b24 100644
--- a/repoman/lib/repoman/modules/scan/metadata/restrict.py
+++ b/repoman/lib/repoman/modules/scan/metadata/restrict.py
@@ -18,6 +18,10 @@ class RestrictChecks(ScanBase):
'''
self.qatracker = kwargs.get('qatracker')
self.repo_settings = kwargs.get('repo_settings')
+   if self.repo_settings.repo_config.restrict_allowed is None:
+   self._restrict_allowed = 
self.repo_settings.qadata.valid_restrict
+   else:
+   self._restrict_allowed = 
self.repo_settings.repo_config.restrict_allowed
 
def check(self, **kwargs):
xpkg = kwargs.get('xpkg')
@@ -35,7 +39,7 @@ class RestrictChecks(ScanBase):
 
if myrestrict:
myrestrict = set(myrestrict)
-   mybadrestrict = 
myrestrict.difference(self.repo_settings.qadata.valid_restrict)
+   mybadrestrict = 
myrestrict.difference(self._restrict_allowed)
 
if mybadrestrict:
for mybad in mybadrestrict:



[gentoo-commits] proj/portage:master commit in: repoman/

2019-08-05 Thread Zac Medico
commit: c11c239789bf7d9166cd1ecc55b0996b72c058f7
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Aug  5 06:01:39 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Aug  5 06:01:39 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=c11c2397

repoman: Update for a repoman-2.3.17 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 6 ++
 repoman/setup.py  | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index 6f6341748..e252d0124 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,12 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.17
+==
+* Bug Fixes:
+- Bug 233589 Support PROPERTIES="live"
+
+
 repoman-2.3.16
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index c7bc29740..ebbf0a633 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -450,7 +450,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.16',
+   version = '2.3.17',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/scan/ebuild/, lib/portage/_sets/, cnf/sets/, ...

2019-07-27 Thread Ulrich Müller
commit: e75e46958b6b032890ed27d10239e07eced63087
Author: Ulrich Müller  gentoo  org>
AuthorDate: Fri Jul 26 08:51:08 2019 +
Commit: Ulrich Müller  gentoo  org>
CommitDate: Fri Jul 26 23:00:22 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=e75e4695

Support PROPERTIES="live".

Bug: https://bugs.gentoo.org/233589
Signed-off-by: Ulrich Müller  gentoo.org>

 cnf/sets/portage.conf |  8 +++-
 lib/_emerge/EbuildExecuter.py |  4 ++--
 lib/portage/_sets/__init__.py | 12 +---
 repoman/lib/repoman/modules/scan/ebuild/ebuild.py |  3 +--
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf
index ac282d911..ed4c6d9a7 100644
--- a/cnf/sets/portage.conf
+++ b/cnf/sets/portage.conf
@@ -55,9 +55,15 @@ world-candidate = True
 [preserved-rebuild]
 class = portage.sets.libs.PreservedLibraryConsumerSet
 
-# Installed ebuilds that inherit from known live eclasses.
+# Installed ebuilds with "live" property.
 [live-rebuild]
 class = portage.sets.dbapi.VariableSet
+variable = PROPERTIES
+includes = live
+
+# Installed ebuilds that inherit from known live eclasses.
+[deprecated-live-rebuild]
+class = portage.sets.dbapi.VariableSet
 variable = INHERITED
 includes = bzr cvs darcs git git-2 git-r3 golang-vcs mercurial subversion tla
 

diff --git a/lib/_emerge/EbuildExecuter.py b/lib/_emerge/EbuildExecuter.py
index d387b42be..ca9859437 100644
--- a/lib/_emerge/EbuildExecuter.py
+++ b/lib/_emerge/EbuildExecuter.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.EbuildPhase import EbuildPhase
@@ -49,7 +49,7 @@ class EbuildExecuter(CompositeTask):
phase="unpack", scheduler=self.scheduler,
settings=self.settings)
 
-   if self._live_eclasses.intersection(self.pkg.inherited):
+   if "live" in self.settings.get("PROPERTIES", "").split():
# Serialize $DISTDIR access for live ebuilds since
# otherwise they can interfere with eachother.
 

diff --git a/lib/portage/_sets/__init__.py b/lib/portage/_sets/__init__.py
index 2c9bf9715..7b81c55e2 100644
--- a/lib/portage/_sets/__init__.py
+++ b/lib/portage/_sets/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2007-2014 Gentoo Foundation
+# Copyright 2007-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -121,8 +121,14 @@ class SetConfig(object):
parser.remove_section("live-rebuild")
parser.add_section("live-rebuild")
parser.set("live-rebuild", "class", 
"portage.sets.dbapi.VariableSet")
-   parser.set("live-rebuild", "variable", "INHERITED")
-   parser.set("live-rebuild", "includes", " 
".join(sorted(portage.const.LIVE_ECLASSES)))
+   parser.set("live-rebuild", "variable", "PROPERTIES")
+   parser.set("live-rebuild", "includes", "live")
+
+   parser.remove_section("deprecated-live-rebuild")
+   parser.add_section("deprecated-live-rebuild")
+   parser.set("deprecated-live-rebuild", "class", 
"portage.sets.dbapi.VariableSet")
+   parser.set("deprecated-live-rebuild", "variable", "INHERITED")
+   parser.set("deprecated-live-rebuild", "includes", " 
".join(sorted(portage.const.LIVE_ECLASSES)))
 
parser.remove_section("module-rebuild")
parser.add_section("module-rebuild")

diff --git a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py 
b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py
index d2715bc6e..70011e387 100644
--- a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py
+++ b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py
@@ -12,7 +12,6 @@ from repoman.modules.scan.scanbase import ScanBase
 # import our initialized portage instance
 from repoman._portage import portage
 from portage import os
-from portage.const import LIVE_ECLASSES
 from portage.exception import InvalidPackageName
 
 pv_toolong_re = re.compile(r'[0-9]{19,}')
@@ -110,7 +109,7 @@ class Ebuild(ScanBase):
self.metadata = self.pkg._metadata
self.eapi = self.metadata["EAPI"]
self.inherited = self.pkg.inherited
-   self.live_ebuild = LIVE_ECLASSES.intersection(self.inherited)
+   self.live_ebuild = "live" in self.metadata["PROPERTIES"].split()
self.keywords = self.metadata["KEYWORDS"].split()
self.archs = set(kw.lstrip("~") for kw in self.keywords if not 
kw.startswith("-"))
return False



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/deprecated/

2019-07-23 Thread Michał Górny
commit: 3e3aae4a5871f897e610ef573f8744496ff8e62e
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Jul 23 15:00:20 2019 +
Commit: Michał Górny  gentoo  org>
CommitDate: Wed Jul 24 02:22:35 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=3e3aae4a

repoman: add 'user.eclass' to deprecated eclasses

Make repoman report user.eclass as deprecated by GLEP 81.

Reviewed-by: Zac Medico  gentoo.org>
Signed-off-by: Michał Górny  gentoo.org>

 repoman/lib/repoman/modules/linechecks/deprecated/inherit.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py 
b/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
index 77ad4f625..361da09b9 100644
--- a/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
+++ b/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py
@@ -30,6 +30,7 @@ class InheritDeprecated(LineCheck):
"mono": "mono-env",
"python": "python-r1 / python-single-r1 / python-any-r1",
"ruby": "ruby-ng",
+   "user": "GLEP 81",
"versionator": "eapi7-ver (built-in since EAPI 7)",
"x-modular": "xorg-2",
}



[gentoo-commits] proj/portage:master commit in: repoman/

2019-06-23 Thread Zac Medico
commit: 5f8fc0259c4e88b12aad0eec2737df653d2a694b
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Jun 23 17:39:23 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Jun 23 17:39:39 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=5f8fc025

repoman: Update for a repoman-2.3.16 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 6 ++
 repoman/setup.py  | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index d6fc9ca3c..6f6341748 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,12 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.16
+==
+* Bug Fixes:
+- Bug 687420 Allow empty LICENSE in acct-* packages for GLEP 81
+
+
 repoman-2.3.15
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index b0fa7fe20..c7bc29740 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -450,7 +450,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.15',
+   version = '2.3.16',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/scan/metadata/

2019-06-20 Thread Zac Medico
commit: 73232537c3f7d8cb4121c0a2dee5b450de584e38
Author: Michał Górny  gentoo  org>
AuthorDate: Thu Jun 20 12:33:01 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Thu Jun 20 19:50:41 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=73232537

Allow empty LICENSE in acct-* packages

Since acct-* packages do not create any files (except for keepfile
for the home directory), it is perfectly normal for the LICENSE
to be empty.

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/modules/scan/metadata/ebuild_metadata.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/repoman/lib/repoman/modules/scan/metadata/ebuild_metadata.py 
b/repoman/lib/repoman/modules/scan/metadata/ebuild_metadata.py
index 4c35bbc12..2edf8f7f2 100644
--- a/repoman/lib/repoman/modules/scan/metadata/ebuild_metadata.py
+++ b/repoman/lib/repoman/modules/scan/metadata/ebuild_metadata.py
@@ -39,8 +39,8 @@ class EbuildMetadata(ScanBase):
ebuild = kwargs.get('ebuild').get()
for pos, missing_var in 
enumerate(self.repo_settings.qadata.missingvars):
if not ebuild.metadata.get(missing_var):
-   if kwargs.get('catdir') == "virtual" and \
-   missing_var in ("HOMEPAGE", "LICENSE"):
+   if (kwargs.get('catdir') in ("acct-group", 
"acct-user", "virtual")
+   and missing_var in ("HOMEPAGE", 
"LICENSE")):
continue
if ebuild.live_ebuild and missing_var == 
"KEYWORDS":
continue



[gentoo-commits] proj/portage:master commit in: repoman/

2019-06-19 Thread Zac Medico
commit: fee6a8ba08a20f40047a7582fee51689ac79cb21
Author: Zac Medico  gentoo  org>
AuthorDate: Thu Jun 20 00:54:29 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Thu Jun 20 00:54:49 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=fee6a8ba

repoman: Update for a repoman-2.3.15 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 6 ++
 repoman/setup.py  | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index 39ab424d1..d6fc9ca3c 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,12 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.15
+==
+* Bug Fixes:
+- Bug 688278 Accept 'Gentoo Foundation' copyright for old ebuilds
+
+
 repoman-2.3.14
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index 255961e4b..b0fa7fe20 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -450,7 +450,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.14',
+   version = '2.3.15',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/gentoo_header/

2019-06-18 Thread Zac Medico
commit: 31465138ddc319a98eae71f95b9fb3a07b866f62
Author: Ulrich Müller  gentoo  org>
AuthorDate: Tue Jun 18 11:48:33 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Tue Jun 18 18:41:31 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=31465138

repoman: Allow legacy "Gentoo Foundation" copyright before 2019.

Bug: https://bugs.gentoo.org/688278
Signed-off-by: Ulrich Müller  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/modules/linechecks/gentoo_header/header.py | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py 
b/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py
index f94a8a50b..1f035a97e 100644
--- a/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py
+++ b/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py
@@ -17,7 +17,8 @@ class EbuildHeader(LineCheck):
 
repoman_check_name = 'ebuild.badheader'
 
-   gentoo_copyright = r'^# Copyright ((1999|2\d\d\d)-)?%s Gentoo Authors$'
+   gentoo_copyright = (
+   r'^# Copyright ((1999|2\d\d\d)-)?(?P%s) (?P.*)$')
gentoo_license = (
'# Distributed under the terms'
' of the GNU General Public License v2')
@@ -37,7 +38,12 @@ class EbuildHeader(LineCheck):
if num > 2:
return
elif num == 0:
-   if not self.gentoo_copyright_re.match(line):
+   match = self.gentoo_copyright_re.match(line)
+   if match is None:
+   return self.errors['COPYRIGHT_ERROR']
+   if not (match.group('author') == 'Gentoo Authors' or
+   (int(match.group('year2')) < 2019 and
+   match.group('author') == 
'Gentoo Foundation')):
return self.errors['COPYRIGHT_ERROR']
elif num == 1 and line.rstrip('\n') != self.gentoo_license:
return self.errors['LICENSE_ERROR']



[gentoo-commits] proj/portage:master commit in: repoman/

2019-06-03 Thread Zac Medico
commit: 45bbad8ec3e57bba71656d530e78e62565d05119
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Jun  3 22:10:51 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Jun  3 22:10:56 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=45bbad8e

repoman: Update for a repoman-2.3.14 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 6 ++
 repoman/setup.py  | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index 235bb06fb..39ab424d1 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,12 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.14
+==
+* Bug Fixes:
+- Bug 666330 Update for new copyright policy
+
+
 repoman-2.3.13
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index a8a7702d3..255961e4b 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -450,7 +450,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.13',
+   version = '2.3.14',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/modules/linechecks/gentoo_header/, repoman/cnf/linechecks/

2019-06-03 Thread Zac Medico
commit: 1f2d1e63a605d5ad4a9257e0102b9803bc59aeb6
Author: Ulrich Müller  kph  uni-mainz  de>
AuthorDate: Mon Jun  3 15:02:02 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Jun  3 18:38:42 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=1f2d1e63

repoman: Update header check for Gentoo repo policy.

By decision of the Gentoo Council in its 2019-01-13 meeting, ebuilds
in the Gentoo repository MUST use the simplified form of the copyright
attribution according to GLEP 76, i.e.: "Copyright YEARS Gentoo Authors".

Update the header check accordingly, mostly by reverting to the
simpler single line check that was in place before commit c4096aff48.

Bug: https://bugs.gentoo.org/666330
Signed-off-by: Ulrich Müller  kph.uni-mainz.de>
Signed-off-by: Zac Medico  gentoo.org>

 repoman/cnf/linechecks/linechecks.yaml |  1 -
 .../modules/linechecks/gentoo_header/header.py | 45 --
 2 files changed, 15 insertions(+), 31 deletions(-)

diff --git a/repoman/cnf/linechecks/linechecks.yaml 
b/repoman/cnf/linechecks/linechecks.yaml
index 32b1bf82f..c452af07d 100644
--- a/repoman/cnf/linechecks/linechecks.yaml
+++ b/repoman/cnf/linechecks/linechecks.yaml
@@ -10,7 +10,6 @@ repoman_version: 2.3.3
 # scan module
 errors:
 COPYRIGHT_ERROR: 'Invalid Copyright on line: %d'
-COPYRIGHT_DATE_ERROR: 'No copyright for last modification date before line 
%d'
 LICENSE_ERROR: 'Invalid Gentoo/GPL License on line: %d'
 ID_HEADER_ERROR: 'Stale CVS header on line: %d'
 NO_BLANK_LINE_ERROR: 'Non-blank line after header on line: %d'

diff --git a/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py 
b/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py
index c64674319..f94a8a50b 100644
--- a/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py
+++ b/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py
@@ -17,46 +17,31 @@ class EbuildHeader(LineCheck):
 
repoman_check_name = 'ebuild.badheader'
 
-   copyright_re = re.compile(r'^# Copyright 
((1999|2\d\d\d)-)?(?P2\d\d\d) \w')
+   gentoo_copyright = r'^# Copyright ((1999|2\d\d\d)-)?%s Gentoo Authors$'
gentoo_license = (
'# Distributed under the terms'
' of the GNU General Public License v2')
id_header_re = re.compile(r'.*\$(Id|Header)(:.*)?\$.*')
+   blank_line_re = re.compile(r'^$')
ignore_comment = False
 
def new(self, pkg):
if pkg.mtime is None:
-   self.modification_year = None
+   self.modification_year = r'2\d\d\d'
else:
-   self.modification_year = time.gmtime(pkg.mtime)[0]
-   self.last_copyright_line = -1
-   self.last_copyright_year = -1
+   self.modification_year = str(time.gmtime(pkg.mtime)[0])
+   self.gentoo_copyright_re = re.compile(
+   self.gentoo_copyright % self.modification_year)
 
def check(self, num, line):
-   if num > self.last_copyright_line + 2:
+   if num > 2:
return
-   elif num == self.last_copyright_line + 1:
-   # copyright can extend for a few initial lines
-   copy_match = self.copyright_re.match(line)
-   if copy_match is not None:
-   self.last_copyright_line = num
-   self.last_copyright_year = 
max(self.last_copyright_year,
-   int(copy_match.group('year')))
-   # no copyright lines found?
-   elif self.last_copyright_line == -1:
+   elif num == 0:
+   if not self.gentoo_copyright_re.match(line):
return self.errors['COPYRIGHT_ERROR']
-   else:
-   # verify that the newest copyright line found
-   # matches the year of last modification
-   if (self.modification_year is not None
-   and self.last_copyright_year != 
self.modification_year):
-   return 
self.errors['COPYRIGHT_DATE_ERROR']
-
-   # copyright is immediately followed by license
-   if line.rstrip('\n') != self.gentoo_license:
-   return self.errors['LICENSE_ERROR']
-   elif num == self.last_copyright_line + 2:
-   if self.id_header_re.match(line):
-   return self.errors['ID_HEADER_ERROR']
-   elif line.rstrip('\n') != '':
-   return self.errors['NO_BLANK_LINE_ERROR']
+   elif num == 1 and 

[gentoo-commits] proj/portage:master commit in: repoman/

2019-05-26 Thread Zac Medico
commit: a8850a872fc1fb63b57aa9daea89b34a21e9bfbc
Author: Zac Medico  gentoo  org>
AuthorDate: Sun May 26 07:31:27 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun May 26 07:31:43 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a8850a87

repoman: Update for a repoman-2.3.13 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 5 +
 repoman/setup.py  | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index fa2c8b093..235bb06fb 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,11 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.13
+==
+* Bug Fixes:
+- Bug 686074 report error for unknown arguments
+
 
 repoman-2.3.12
 ==

diff --git a/repoman/setup.py b/repoman/setup.py
index 642e86a71..a8a7702d3 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -450,7 +450,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.12',
+   version = '2.3.13',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2019-05-25 Thread Zac Medico
commit: 26edaf8f93326085928dbd3c0606b80062b1ce6a
Author: Zac Medico  gentoo  org>
AuthorDate: Sat May 25 22:35:45 2019 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat May 25 22:43:01 2019 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=26edaf8f

repoman: report error for unknown arguments (bug 686074)

Bug: https://bugs.gentoo.org/686074
Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/argparser.py | 33 +
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/repoman/lib/repoman/argparser.py b/repoman/lib/repoman/argparser.py
index b87df95cd..fa0e6ff90 100644
--- a/repoman/lib/repoman/argparser.py
+++ b/repoman/lib/repoman/argparser.py
@@ -1,5 +1,5 @@
 # repoman: Argument parser
-# Copyright 2007-2017 Gentoo Foundation
+# Copyright 2007-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 """This module contains functions used in Repoman to parse CLI arguments."""
@@ -196,23 +196,32 @@ def parse_args(argv, repoman_default_opts):
'--mode', dest='mode', choices=mode_keys,
help='specify which mode repoman will run in (default=full)')
 
-   opts, args = parser.parse_known_args(argv[1:])
+   # Modes help is included earlier, in the parser description.
+   parser.add_argument(
+   'mode_positional', nargs='?', metavar='mode', choices=mode_keys,
+   help=argparse.SUPPRESS)
+
+   opts = parser.parse_args(argv[1:])
 
if not opts.ignore_default_opts:
default_opts = util.shlex_split(repoman_default_opts)
if default_opts:
-   opts, args = parser.parse_known_args(default_opts + 
sys.argv[1:])
+   opts = parser.parse_args(default_opts + sys.argv[1:])
+
+   args = []
+   if opts.mode is not None:
+   args.append(opts.mode)
+   if opts.mode_positional is not None:
+   args.append(opts.mode_positional)
+
+   if len(set(args)) > 1:
+   parser.error("multiple modes specified: %s" % " ".join(args))
+
+   opts.mode = args[0] if args else None
 
if opts.mode == 'help':
-   parser.print_help(short=False)
-
-   for arg in args:
-   if arg in modes:
-   if not opts.mode:
-   opts.mode = arg
-   break
-   else:
-   parser.error("invalid mode: %s" % arg)
+   parser.print_help()
+   parser.exit()
 
if not opts.mode:
opts.mode = 'full'



[gentoo-commits] proj/portage:master commit in: repoman/, /

2018-11-25 Thread Zac Medico
commit: a81621eaa238489fc85d39f594707813496afceb
Author: Manuel Rüger  gentoo  org>
AuthorDate: Sun Nov 25 12:25:34 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Nov 25 22:29:00 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a81621ea

Enable python3.7 testing

Reflect recent python versions in test scripts

Closes: https://github.com/gentoo/portage/pull/383
Signed-off-by: Manuel Rüger  gentoo.org>
Signed-off-by: Zac Medico  gentoo.org>

 .travis.yml  | 7 +++
 repoman/runtests | 6 +++---
 runtests | 6 +++---
 tox.ini  | 2 +-
 4 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 846308e08..ab0b8d304 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,6 +6,13 @@ python:
 - 3.6
 - pypy
 
+# See https://github.com/travis-ci/travis-ci/issues/9815
+matrix:
+  include:
+- python: 3.7
+  dist: xenial
+  sudo: required
+
 # command to install dependencies
 install:
 - pip install tox

diff --git a/repoman/runtests b/repoman/runtests
index 2b8cb4c5e..e208ab61d 100755
--- a/repoman/runtests
+++ b/repoman/runtests
@@ -24,14 +24,14 @@ import tempfile
 # These are the versions we fully support and require to pass tests.
 PYTHON_SUPPORTED_VERSIONS = [
'2.7',
-   '3.3',
'3.4',
+   '3.5',
+   '3.6'
 ]
 # The rest are just "nice to have".
 PYTHON_NICE_VERSIONS = [
'pypy',
-   '3.5',
-   '3.6',
+   '3.7'
 ]
 
 EPREFIX = os.environ.get('PORTAGE_OVERRIDE_EPREFIX', '/')

diff --git a/runtests b/runtests
index 597ccaede..7c3ebb1ca 100755
--- a/runtests
+++ b/runtests
@@ -24,14 +24,14 @@ import tempfile
 # These are the versions we fully support and require to pass tests.
 PYTHON_SUPPORTED_VERSIONS = [
'2.7',
-   '3.3',
'3.4',
+   '3.5',
+   '3.6'
 ]
 # The rest are just "nice to have".
 PYTHON_NICE_VERSIONS = [
'pypy',
-   '3.5',
-   '3.6',
+   '3.7'
 ]
 
 EPREFIX = os.environ.get('PORTAGE_OVERRIDE_EPREFIX', '/')

diff --git a/tox.ini b/tox.ini
index cafdb0045..2d1501971 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = py27,py34,py35,py36,pypy,pypy3
+envlist = py27,py34,py35,py36,py37,pypy,pypy3
 skipsdist = True
 
 [testenv]



[gentoo-commits] proj/portage:master commit in: repoman/

2018-11-03 Thread Zac Medico
commit: 173bab752e823b37876c053d8dcb5202fe02ac39
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Nov  4 03:10:56 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun Nov  4 03:40:41 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=173bab75

repoman: Update for a repoman-2.3.12 release

Signed-off-by: Zac Medico  gentoo.org>

 repoman/RELEASE-NOTES | 7 +++
 repoman/setup.py  | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index 920174ecf..fa2c8b093 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,13 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+
+repoman-2.3.12
+==
+* Bug Fixes:
+- Bug 588752 fix exit code for manifest mode
+
+
 repoman-2.3.11
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index a18d6d0e3..642e86a71 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -450,7 +450,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.11',
+   version = '2.3.12',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2018-10-27 Thread Zac Medico
commit: 1e31e93f99f1e6bc42517d0967e3e61f20edbc91
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Oct 27 23:32:51 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Oct 27 23:35:54 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=1e31e93f

repoman.actions.Action._manifest_get: return True on success

Return True on success, like it says in the docstring.
The return value is currently not checked by the caller
of this method, so that code can remain as-is for now.

Signed-off-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/actions.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
index 4980f11eb..1c9989a72 100644
--- a/repoman/lib/repoman/actions.py
+++ b/repoman/lib/repoman/actions.py
@@ -265,9 +265,9 @@ the whole commit message to abort.
@return: True if successful, False otherwise
"""
self.repoman_settings["O"] = 
os.path.join(self.repo_settings.repodir, cp)
-   return not digestgen(
+   return bool(digestgen(
mysettings=self.repoman_settings,
-   myportdb=self.repo_settings.portdb)
+   myportdb=self.repo_settings.portdb))
 
def _suggest(self):
print()



[gentoo-commits] proj/portage:master commit in: repoman/bin/, repoman/lib/repoman/modules/commit/, repoman/lib/repoman/

2018-10-27 Thread Zac Medico
commit: 91a9c2da33802f1f71e669bffc7ce940b9f6d450
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Oct 27 20:42:16 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Oct 27 21:27:44 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=91a9c2da

repoman: fix exit code for manifest mode (bug 588752)

When manifest generation fails, report "manifest.bad" violations.

Reported-by: Lars Wendler  gentoo.org>
Bug: https://bugs.gentoo.org/588752
Signed-off-by: Zac Medico  gentoo.org>

 repoman/bin/repoman|  2 +-
 repoman/lib/repoman/main.py|  9 +
 repoman/lib/repoman/modules/commit/manifest.py | 11 ---
 repoman/lib/repoman/scanner.py |  3 ++-
 4 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/repoman/bin/repoman b/repoman/bin/repoman
index 873987f33..7f6187f12 100755
--- a/repoman/bin/repoman
+++ b/repoman/bin/repoman
@@ -42,7 +42,7 @@ from portage.util._eventloop.global_event_loop import 
global_event_loop
 from repoman.main import repoman_main
 
 try:
-   repoman_main(sys.argv[1:])
+   sys.exit(repoman_main(sys.argv[1:]))
 except IOError as e:
if e.errno == errno.EACCES:
print("\nRepoman: Need user access")

diff --git a/repoman/lib/repoman/main.py b/repoman/lib/repoman/main.py
index 81e2ff61e..731e8eae2 100755
--- a/repoman/lib/repoman/main.py
+++ b/repoman/lib/repoman/main.py
@@ -133,10 +133,6 @@ def repoman_main(argv):
'full': options.mode != 'full',
}
 
-   # early out for manifest generation
-   if options.mode == "manifest":
-   sys.exit(result['fail'])
-
for x in qadata.qacats:
if x not in vcs_settings.qatracker.fails:
continue
@@ -182,6 +178,11 @@ def repoman_main(argv):
 
style_file.flush()
del console_writer, f, style_file
+
+   # early out for manifest generation
+   if options.mode == "manifest":
+   return 1 if result['fail'] else 0
+
qa_output = qa_output.getvalue()
qa_output = qa_output.splitlines(True)
 

diff --git a/repoman/lib/repoman/modules/commit/manifest.py 
b/repoman/lib/repoman/modules/commit/manifest.py
index b338a5b40..573710a62 100644
--- a/repoman/lib/repoman/modules/commit/manifest.py
+++ b/repoman/lib/repoman/modules/commit/manifest.py
@@ -30,7 +30,8 @@ class Manifest(object):
'''Perform a manifest generation for the pkg
 
@param checkdir: the current package directory
-   @returns: dictionary
+   @rtype: bool
+   @return: True if successful, False otherwise
'''
self.generated_manifest = False
failed = False
@@ -51,7 +52,7 @@ class Manifest(object):
 
if not self.generated_manifest:
writemsg_level(
-   "Unable to generate manifest.",
+   "!!! Unable to generate manifest for '%s'.\n" % 
(checkdir,),
level=logging.ERROR, noiselevel=-1)
failed = True
 
@@ -75,11 +76,7 @@ class Manifest(object):
if distfile in 
self.auto_assumed:
portage.writemsg_stdout(
"   %s::%s\n" % 
(pf, distfile))
-   # continue, skip remaining main loop code
-   return True
-   elif failed:
-   sys.exit(1)
-   return False
+   return not failed
 
def _discard_dist_digests(self, checkdir, fetchlist_dict):
'''Discard DIST digests for files that exist in DISTDIR

diff --git a/repoman/lib/repoman/scanner.py b/repoman/lib/repoman/scanner.py
index c456bbde9..1b3242a51 100644
--- a/repoman/lib/repoman/scanner.py
+++ b/repoman/lib/repoman/scanner.py
@@ -290,7 +290,8 @@ class Scanner(object):
self.vcs_settings.status.check(checkdir, 
checkdir_relative, xpkg)
 
if self.generate_manifest:
-   
manifest.Manifest(**self.kwargs).update_manifest(checkdir)
+   if not 
manifest.Manifest(**self.kwargs).update_manifest(checkdir):
+   
self.qatracker.add_error("manifest.bad", os.path.join(xpkg, 'Manifest'))
if self.options.mode == 'manifest':
continue
checkdirlist = os.listdir(checkdir)



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2018-09-30 Thread Mike Gilbert
commit: 13731576aa6e5b118ff8d1e64214982e66b9c5ad
Author: Mike Gilbert  gentoo  org>
AuthorDate: Sun Sep 30 16:14:59 2018 +
Commit: Mike Gilbert  gentoo  org>
CommitDate: Sun Sep 30 20:37:59 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=13731576

repoman: move Signed-off-by to the end of the footer

This makes for a cleaner looking message when multiple people add their
SOB during a review process.

Signed-off-by: Mike Gilbert  gentoo.org>

 repoman/lib/repoman/actions.py | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
index 3cf6f7081..4980f11eb 100644
--- a/repoman/lib/repoman/actions.py
+++ b/repoman/lib/repoman/actions.py
@@ -441,9 +441,6 @@ the whole commit message to abort.
bug = urlunsplit(('https',) + purl[1:])
commit_footer += "\n%s: %s" % (tag, bug)
 
-   if dco_sob:
-   commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
-
# Use new footer only for git (see bug #438364).
if self.vcs_settings.vcs in ["git"]:
commit_footer += "\nPackage-Manager: Portage-%s, 
Repoman-%s" % (
@@ -468,6 +465,10 @@ the whole commit message to abort.
else:
commit_footer += ", unsigned Manifest commit"
commit_footer += ")"
+
+   if dco_sob:
+   commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
+
return commit_footer
 
 



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2018-09-30 Thread Mike Gilbert
commit: 4220ac560490c485a00fe05e5adc020cc713d3d9
Author: Mike Gilbert  gentoo  org>
AuthorDate: Sun Sep 30 16:11:44 2018 +
Commit: Mike Gilbert  gentoo  org>
CommitDate: Sun Sep 30 20:37:59 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=4220ac56

repoman: normalize newline handling in get_commit_footer

Start with an empty string, and add a newline character at the start
of each sucessive line. This simplifies the logic needed to add a new
line to the footer.

Signed-off-by: Mike Gilbert  gentoo.org>

 repoman/lib/repoman/actions.py | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
index 9fe5f722e..3cf6f7081 100644
--- a/repoman/lib/repoman/actions.py
+++ b/repoman/lib/repoman/actions.py
@@ -419,7 +419,7 @@ the whole commit message to abort.
portage_version = "Unknown"
 
# Common part of commit footer
-   commit_footer = "\n"
+   commit_footer = ""
for tag, bug in chain(
(('Bug', x) for x in self.options.bug),
(('Closes', x) for x in self.options.closes)):
@@ -439,14 +439,14 @@ the whole commit message to abort.
elif (purl.scheme == 'http' and
purl.netloc in 
self.https_bugtrackers):
bug = urlunsplit(('https',) + purl[1:])
-   commit_footer += "%s: %s\n" % (tag, bug)
+   commit_footer += "\n%s: %s" % (tag, bug)
 
if dco_sob:
-   commit_footer += "Signed-off-by: %s\n" % (dco_sob, )
+   commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
 
# Use new footer only for git (see bug #438364).
if self.vcs_settings.vcs in ["git"]:
-   commit_footer += "Package-Manager: Portage-%s, 
Repoman-%s" % (
+   commit_footer += "\nPackage-Manager: Portage-%s, 
Repoman-%s" % (
portage.VERSION, 
VERSION)
if report_options:
commit_footer += "\nRepoMan-Options: " + " 
".join(report_options)
@@ -458,7 +458,7 @@ the whole commit message to abort.
unameout += platform.processor()
else:
unameout += platform.machine()
-   commit_footer += "(Portage version: %s/%s/%s" % \
+   commit_footer += "\n(Portage version: %s/%s/%s" % \
(portage_version, self.vcs_settings.vcs, 
unameout)
if report_options:
commit_footer += ", RepoMan options: " + " 
".join(report_options)



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2018-09-22 Thread Zac Medico
commit: 4ff4e4200b984a88109b10de9e82b20451751aee
Author: Zac Medico  gentoo  org>
AuthorDate: Thu Sep 20 20:35:42 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Sep 22 08:23:14 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=4ff4e420

repoman: regen thick manifest after copyright update (bug 656698)

Bug: https://bugs.gentoo.org/656698

 repoman/lib/repoman/actions.py| 40 ++-
 repoman/lib/repoman/copyrights.py | 10 ++
 2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
index 8e23322c8..9fe5f722e 100644
--- a/repoman/lib/repoman/actions.py
+++ b/repoman/lib/repoman/actions.py
@@ -151,10 +151,17 @@ the whole commit message to abort.
 
# Update copyright for new and changed files
year = time.strftime('%Y', time.gmtime())
+   updated_copyright = []
for fn in chain(mynew, mychanged):
if fn.endswith('.diff') or fn.endswith('.patch'):
continue
-   update_copyright(fn, year, pretend=self.options.pretend)
+   if update_copyright(fn, year, 
pretend=self.options.pretend):
+   updated_copyright.append(fn)
+
+   if updated_copyright and not (
+   self.options.pretend or 
self.repo_settings.repo_config.thin_manifest):
+   for cp in 
sorted(self._vcs_files_to_cps(iter(updated_copyright))):
+   self._manifest_gen(cp)
 
myupdates, broken_changelog_manifests = self.changelogs(
myupdates, mymanifests, myremoved, 
mychanged, myautoadd,
@@ -230,6 +237,37 @@ the whole commit message to abort.
"\"If everyone were like you, I'd be out of 
business!\"\n")
return
 
+   def _vcs_files_to_cps(self, vcs_file_iter):
+   """
+   Iterate over the given modified file paths returned from the 
vcs,
+   and return a frozenset containing category/pn strings for each
+   modified package.
+
+   @param vcs_file_iter: file paths from vcs module
+   @type iter
+   @rtype: frozenset
+   @return: category/pn strings for each package.
+   """
+   return vcs_files_to_cps(
+   vcs_file_iter,
+   self.repo_settings.repodir,
+   self.scanner.repolevel,
+   self.scanner.reposplit,
+   self.scanner.categories)
+
+   def _manifest_gen(self, cp):
+   """
+   Generate manifest for a cp.
+
+   @param cp: category/pn string
+   @type str
+   @rtype: bool
+   @return: True if successful, False otherwise
+   """
+   self.repoman_settings["O"] = 
os.path.join(self.repo_settings.repodir, cp)
+   return not digestgen(
+   mysettings=self.repoman_settings,
+   myportdb=self.repo_settings.portdb)
 
def _suggest(self):
print()

diff --git a/repoman/lib/repoman/copyrights.py 
b/repoman/lib/repoman/copyrights.py
index 1eaaab660..275dcbc3f 100644
--- a/repoman/lib/repoman/copyrights.py
+++ b/repoman/lib/repoman/copyrights.py
@@ -67,6 +67,15 @@ def update_copyright(fn_path, year, pretend=False):
Files are read and written in binary mode, so that this function
will work correctly with files encoded in any character set, as
long as the copyright statements consist of plain ASCII.
+
+   @param fn_path: file path
+   @type str
+   @param year: current year
+   @type str
+   @param pretend: pretend mode
+   @type bool
+   @rtype: bool
+   @return: True if copyright update was needed, False otherwise
"""
 
try:
@@ -120,3 +129,4 @@ def update_copyright(fn_path, year, pretend=False):
else:
util.apply_stat_permissions(fn_path, fn_stat)
fn_hdl.close()
+   return difflines > 3



[gentoo-commits] proj/portage:master commit in: repoman/

2018-09-22 Thread Zac Medico
commit: b84246ed16c7a2fe96075f456f64839d0536ae8f
Author: Zac Medico  gentoo  org>
AuthorDate: Sat Sep 22 09:08:19 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sat Sep 22 09:08:19 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=b84246ed

repoman: Update for a repoman-2.3.11 release

 repoman/RELEASE-NOTES | 11 +++
 repoman/setup.py  |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index 47efd34bb..920174ecf 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,17 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.11
+==
+* Bug Fixes:
+- Bug 666330 support new 'Gentoo Authors' copyright policy and
+  automatically apply the new policy when updating copyright headers.
+  Earlier versions of repoman will report an ebuild.badheader warning
+  for the new copyright headers. Users of earlier versions of repoman
+  should be advised to simply ignore the ebuild.badheader warning, or
+  else upgrade to the latest version of repoman.
+
+
 repoman-2.3.10
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index 23b106807..a18d6d0e3 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -450,7 +450,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.10',
+   version = '2.3.11',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/tests/simple/, repoman/lib/repoman/tests/changelog/, ...

2018-09-19 Thread Michał Górny
commit: 9f089d270503d18ee8800fe97f26c6644f20cac9
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Sep 18 09:07:55 2018 +
Commit: Michał Górny  gentoo  org>
CommitDate: Wed Sep 19 17:18:45 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=9f089d27

repoman: Automatically convert copyright to 'Gentoo Authors'

Automatically convert 'Gentoo Foundation' copyright to 'Gentoo Authors'
when updating the copyright date.

Signed-off-by: Michał Górny  gentoo.org>
Reviewed-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/copyrights.py  | 4 ++--
 repoman/lib/repoman/tests/changelog/test_echangelog.py | 2 +-
 repoman/lib/repoman/tests/simple/test_simple.py| 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/repoman/lib/repoman/copyrights.py 
b/repoman/lib/repoman/copyrights.py
index 25627b3fc..1eaaab660 100644
--- a/repoman/lib/repoman/copyrights.py
+++ b/repoman/lib/repoman/copyrights.py
@@ -31,7 +31,7 @@ class _copyright_repl(object):
return matchobj.group(0)
else:
return matchobj.group(1) + matchobj.group(2) + \
-   b'-' + self.year + matchobj.group(3)
+   b'-' + self.year + b' Gentoo Authors'
 
 
 def update_copyright_year(year, line):
@@ -51,7 +51,7 @@ def update_copyright_year(year, line):
year = _unicode_encode(year)
line = _unicode_encode(line)
 
-   line = _copyright_re1.sub(br'\1-' + year + br'\2', line)
+   line = _copyright_re1.sub(br'\1-' + year + b' Gentoo Authors', line)
line = _copyright_re2.sub(_copyright_repl(year), line)
if not is_bytes:
line = _unicode_decode(line)

diff --git a/repoman/lib/repoman/tests/changelog/test_echangelog.py 
b/repoman/lib/repoman/tests/changelog/test_echangelog.py
index 1640be268..e5e34f16c 100644
--- a/repoman/lib/repoman/tests/changelog/test_echangelog.py
+++ b/repoman/lib/repoman/tests/changelog/test_echangelog.py
@@ -30,7 +30,7 @@ class RepomanEchangelogTestCase(TestCase):
os.makedirs(self.pkgdir)
 
self.header_pkg = '# ChangeLog for %s/%s\n' % (self.cat, 
self.pkg)
-   self.header_copyright = '# Copyright 1999-%s Gentoo Foundation; 
Distributed under the GPL v2\n' % \
+   self.header_copyright = '# Copyright 1999-%s Gentoo Authors; 
Distributed under the GPL v2\n' % \
time.strftime('%Y', time.gmtime())
self.header_cvs = '# $Header: $\n'
 

diff --git a/repoman/lib/repoman/tests/simple/test_simple.py 
b/repoman/lib/repoman/tests/simple/test_simple.py
index 351dde2c7..b0cc43297 100644
--- a/repoman/lib/repoman/tests/simple/test_simple.py
+++ b/repoman/lib/repoman/tests/simple/test_simple.py
@@ -23,12 +23,12 @@ class SimpleRepomanTestCase(TestCase):
(
'2011',
'# Copyright 1999-2008 Gentoo Foundation; 
Distributed under the GPL v2',
-   '# Copyright 1999-2011 Gentoo Foundation; 
Distributed under the GPL v2',
+   '# Copyright 1999-2011 Gentoo Authors; 
Distributed under the GPL v2',
),
(
'2011',
'# Copyright 1999 Gentoo Foundation; 
Distributed under the GPL v2',
-   '# Copyright 1999-2011 Gentoo Foundation; 
Distributed under the GPL v2',
+   '# Copyright 1999-2011 Gentoo Authors; 
Distributed under the GPL v2',
),
(
'1999',



[gentoo-commits] proj/portage:master commit in: repoman/cnf/linechecks/, repoman/lib/repoman/modules/linechecks/gentoo_header/

2018-09-19 Thread Michał Górny
commit: c4096aff486da02fb2ddd410f934fe9e418741ba
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Sep 18 08:49:55 2018 +
Commit: Michał Górny  gentoo  org>
CommitDate: Wed Sep 19 17:18:22 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=c4096aff

repoman: Update header checks for the new copyright policy

Update the header checks to account for the new copyright policy:
- there can be multiple copyright lines,
- copyright owner can be anyone,
- at least one copyright line should match last modification date.

This requires updating the check to appropriately allow the license
line to move down.  Additionally, the copyright date error is separated
from invalid copyright line error.

Signed-off-by: Michał Górny  gentoo.org>
Reviewed-by: Zac Medico  gentoo.org>

 repoman/cnf/linechecks/linechecks.yaml |  3 +-
 .../modules/linechecks/gentoo_header/header.py | 47 ++
 2 files changed, 32 insertions(+), 18 deletions(-)

diff --git a/repoman/cnf/linechecks/linechecks.yaml 
b/repoman/cnf/linechecks/linechecks.yaml
index 634381e80..32b1bf82f 100644
--- a/repoman/cnf/linechecks/linechecks.yaml
+++ b/repoman/cnf/linechecks/linechecks.yaml
@@ -9,7 +9,8 @@ repoman_version: 2.3.3
 # configuration file for the LineCheck plugins run via the multicheck
 # scan module
 errors:
-COPYRIGHT_ERROR: 'Invalid Gentoo Copyright on line: %d'
+COPYRIGHT_ERROR: 'Invalid Copyright on line: %d'
+COPYRIGHT_DATE_ERROR: 'No copyright for last modification date before line 
%d'
 LICENSE_ERROR: 'Invalid Gentoo/GPL License on line: %d'
 ID_HEADER_ERROR: 'Stale CVS header on line: %d'
 NO_BLANK_LINE_ERROR: 'Non-blank line after header on line: %d'

diff --git a/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py 
b/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py
index 4b75fc4b5..c64674319 100644
--- a/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py
+++ b/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py
@@ -17,33 +17,46 @@ class EbuildHeader(LineCheck):
 
repoman_check_name = 'ebuild.badheader'
 
-   gentoo_copyright = r'^# Copyright ((1999|2\d\d\d)-)?%s Gentoo 
Foundation$'
+   copyright_re = re.compile(r'^# Copyright 
((1999|2\d\d\d)-)?(?P2\d\d\d) \w')
gentoo_license = (
'# Distributed under the terms'
' of the GNU General Public License v2')
id_header_re = re.compile(r'.*\$(Id|Header)(:.*)?\$.*')
-   blank_line_re = re.compile(r'^$')
ignore_comment = False
 
def new(self, pkg):
if pkg.mtime is None:
-   self.modification_year = r'2\d\d\d'
+   self.modification_year = None
else:
-   self.modification_year = str(time.gmtime(pkg.mtime)[0])
-   self.gentoo_copyright_re = re.compile(
-   self.gentoo_copyright % self.modification_year)
+   self.modification_year = time.gmtime(pkg.mtime)[0]
+   self.last_copyright_line = -1
+   self.last_copyright_year = -1
 
def check(self, num, line):
-   if num > 2:
+   if num > self.last_copyright_line + 2:
return
-   elif num == 0:
-   if not self.gentoo_copyright_re.match(line):
+   elif num == self.last_copyright_line + 1:
+   # copyright can extend for a few initial lines
+   copy_match = self.copyright_re.match(line)
+   if copy_match is not None:
+   self.last_copyright_line = num
+   self.last_copyright_year = 
max(self.last_copyright_year,
+   int(copy_match.group('year')))
+   # no copyright lines found?
+   elif self.last_copyright_line == -1:
return self.errors['COPYRIGHT_ERROR']
-   elif num == 1 and line.rstrip('\n') != self.gentoo_license:
-   return self.errors['LICENSE_ERROR']
-   elif num == 2 and self.id_header_re.match(line):
-   return self.errors['ID_HEADER_ERROR']
-   elif num == 2 and not self.blank_line_re.match(line):
-   return self.errors['NO_BLANK_LINE_ERROR']
-
-
+   else:
+   # verify that the newest copyright line found
+   # matches the year of last modification
+   if (self.modification_year is not None
+   and self.last_copyright_year != 
self.modification_year):
+   return 
self.errors['COPYRIGHT_DATE_ERROR']
+
+   # copyright is immediately 

[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/tests/simple/, repoman/lib/repoman/

2018-09-19 Thread Michał Górny
commit: 2e6b40509dfffe8dd028dcc5d725a0ac9188d8b7
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Sep 18 08:57:08 2018 +
Commit: Michał Górny  gentoo  org>
CommitDate: Wed Sep 19 17:18:41 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=2e6b4050

repoman: Allow copyright updates for 'Gentoo Authors'

Signed-off-by: Michał Górny  gentoo.org>
Reviewed-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/copyrights.py   |  4 ++--
 repoman/lib/repoman/tests/simple/test_simple.py | 10 ++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/repoman/lib/repoman/copyrights.py 
b/repoman/lib/repoman/copyrights.py
index 94257c942..25627b3fc 100644
--- a/repoman/lib/repoman/copyrights.py
+++ b/repoman/lib/repoman/copyrights.py
@@ -15,9 +15,9 @@ from portage import util
 
 
 _copyright_re1 = \
-   re.compile(br'^(# Copyright \d\d\d\d)-\d\d\d\d( Gentoo Foundation)\b')
+   re.compile(br'^(# Copyright \d\d\d\d)-\d\d\d\d( Gentoo 
(Foundation|Authors))\b')
 _copyright_re2 = \
-   re.compile(br'^(# Copyright )(\d\d\d\d)( Gentoo Foundation)\b')
+   re.compile(br'^(# Copyright )(\d\d\d\d)( Gentoo 
(Foundation|Authors))\b')
 
 
 class _copyright_repl(object):

diff --git a/repoman/lib/repoman/tests/simple/test_simple.py 
b/repoman/lib/repoman/tests/simple/test_simple.py
index 3d7a70ad0..351dde2c7 100644
--- a/repoman/lib/repoman/tests/simple/test_simple.py
+++ b/repoman/lib/repoman/tests/simple/test_simple.py
@@ -35,6 +35,16 @@ class SimpleRepomanTestCase(TestCase):
'# Copyright 1999 Gentoo Foundation; 
Distributed under the GPL v2',
'# Copyright 1999 Gentoo Foundation; 
Distributed under the GPL v2',
),
+   (
+   '2018',
+   '# Copyright 1999-2008 Gentoo Authors; 
Distributed under the GPL v2',
+   '# Copyright 1999-2018 Gentoo Authors; 
Distributed under the GPL v2',
+   ),
+   (
+   '2018',
+   '# Copyright 2017 Gentoo Authors; Distributed 
under the GPL v2',
+   '# Copyright 2017-2018 Gentoo Authors; 
Distributed under the GPL v2',
+   ),
)
 
for year, before, after in test_cases:



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/

2018-08-16 Thread Michał Górny
commit: a0d10b164038c4ef172039f5d281240c48d3611f
Author: Michał Górny  gentoo  org>
AuthorDate: Thu Aug 16 17:06:12 2018 +
Commit: Michał Górny  gentoo  org>
CommitDate: Thu Aug 16 20:05:10 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=a0d10b16

repoman.config: Make yaml loader optional

Make the yaml loader optional, delaying the failure until the user
attempts to actually load a yaml file.  Given that pyyaml is an external
dependency, there is no real reason to fail as soon as repoman.config is
loaded if YAML may not be used at all.

Reviewed-by: Zac Medico  gentoo.org>

 repoman/lib/repoman/config.py | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/repoman/lib/repoman/config.py b/repoman/lib/repoman/config.py
index 578bbccde..decf9b90a 100644
--- a/repoman/lib/repoman/config.py
+++ b/repoman/lib/repoman/config.py
@@ -6,7 +6,10 @@ import json
 import os
 import stat
 
-import yaml
+try:
+   import yaml
+except ImportError:
+   yaml = None
 
 try:
FileNotFoundError
@@ -73,6 +76,9 @@ def _yaml_load(filename):
Load filename as YAML and return a dict. Raise ConfigError if
it fails to load.
"""
+   if yaml is None:
+   raise ImportError('Please install pyyaml in order to read yaml 
files')
+
with open(filename, 'rt') as f:
try:
return yaml.safe_load(f)



[gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/checks/herds/

2018-08-06 Thread Zac Medico
commit: 78c52aa79707756d3b816fdbfa9004f7b9dcac41
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Aug  6 18:42:29 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Aug  6 18:43:37 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=78c52aa7

repoman: remove obsolete herds checks

 repoman/lib/repoman/checks/herds/__init__.py |   0
 repoman/lib/repoman/checks/herds/herdbase.py | 135 ---
 repoman/lib/repoman/checks/herds/metadata.py |  26 --
 3 files changed, 161 deletions(-)

diff --git a/repoman/lib/repoman/checks/herds/__init__.py 
b/repoman/lib/repoman/checks/herds/__init__.py
deleted file mode 100644
index e69de29bb..0

diff --git a/repoman/lib/repoman/checks/herds/herdbase.py 
b/repoman/lib/repoman/checks/herds/herdbase.py
deleted file mode 100644
index ebe6a19b4..0
--- a/repoman/lib/repoman/checks/herds/herdbase.py
+++ /dev/null
@@ -1,135 +0,0 @@
-# -*- coding: utf-8 -*-
-# repoman: Herd database analysis
-# Copyright 2010-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2 or later
-
-from __future__ import print_function, unicode_literals
-
-import errno
-import xml.etree.ElementTree
-try:
-   from xml.parsers.expat import ExpatError
-except (SystemExit, KeyboardInterrupt):
-   raise
-except (ImportError, SystemError, RuntimeError, Exception):
-   # broken or missing xml support
-   # https://bugs.python.org/issue14988
-   # This means that python is built without xml support.
-   # We tolerate global scope import failures for optional
-   # modules, so that ImportModulesTestCase can succeed (or
-   # possibly alert us about unexpected import failures).
-   pass
-
-from portage import _encodings, _unicode_encode
-from portage.exception import FileNotFound, ParseError, PermissionDenied
-from portage import os
-
-from repoman.errors import err
-
-__all__ = [
-   "make_herd_base", "get_herd_base"
-]
-
-
-def _make_email(nick_name):
-   if not nick_name.endswith('@gentoo.org'):
-   nick_name = nick_name + '@gentoo.org'
-   return nick_name
-
-
-class HerdBase(object):
-   def __init__(self, herd_to_emails, all_emails):
-   self.herd_to_emails = herd_to_emails
-   self.all_emails = all_emails
-
-   def known_herd(self, herd_name):
-   return herd_name in self.herd_to_emails
-
-   def known_maintainer(self, nick_name):
-   return _make_email(nick_name) in self.all_emails
-
-   def maintainer_in_herd(self, nick_name, herd_name):
-   return _make_email(nick_name) in self.herd_to_emails[herd_name]
-
-
-class _HerdsTreeBuilder(xml.etree.ElementTree.TreeBuilder):
-   """
-   Implements doctype() as required to avoid deprecation warnings with
-   >=python-2.7.
-   """
-   def doctype(self, name, pubid, system):
-   pass
-
-
-def make_herd_base(filename):
-   herd_to_emails = dict()
-   all_emails = set()
-
-   try:
-   xml_tree = xml.etree.ElementTree.parse(
-   _unicode_encode(
-   filename, encoding=_encodings['fs'], 
errors='strict'),
-   parser=xml.etree.ElementTree.XMLParser(
-   target=_HerdsTreeBuilder()))
-   except ExpatError as e:
-   raise ParseError("metadata.xml: %s" % (e,))
-   except EnvironmentError as e:
-   func_call = "open('%s')" % filename
-   if e.errno == errno.EACCES:
-   raise PermissionDenied(func_call)
-   elif e.errno == errno.ENOENT:
-   raise FileNotFound(filename)
-   raise
-
-   herds = xml_tree.findall('herd')
-   for h in herds:
-   _herd_name = h.find('name')
-   if _herd_name is None:
-   continue
-   herd_name = _herd_name.text.strip()
-   del _herd_name
-
-   maintainers = h.findall('maintainer')
-   herd_emails = set()
-   for m in maintainers:
-   _m_email = m.find('email')
-   if _m_email is None:
-   continue
-   m_email = _m_email.text.strip()
-
-   herd_emails.add(m_email)
-   all_emails.add(m_email)
-
-   herd_to_emails[herd_name] = herd_emails
-
-   return HerdBase(herd_to_emails, all_emails)
-
-
-def get_herd_base(repoman_settings):
-   try:
-   herd_base = make_herd_base(
-   os.path.join(repoman_settings["PORTDIR"], 
"metadata/herds.xml"))
-   except (EnvironmentError, ParseError, PermissionDenied) as e:
-   err(str(e))
-   except FileNotFound:
-   # TODO: Download as we do for metadata.dtd, but add a way to
-   # 

[gentoo-commits] proj/portage:master commit in: repoman/

2018-07-16 Thread Zac Medico
commit: aca3e6d8720ecb94398c6ba4a3e0d5b3a304c9a7
Author: Zac Medico  gentoo  org>
AuthorDate: Mon Jul 16 06:45:50 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Jul 16 06:45:50 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=aca3e6d8

repoman: Update for a repoman-2.3.10 release

 repoman/RELEASE-NOTES | 7 +++
 repoman/setup.py  | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index 12ddefc20..47efd34bb 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,13 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.10
+==
+* Bug Fixes:
+- Bug 649482 warn about = deps without revision
+- Bug 660982 populate implicit IUSE for empty profile
+
+
 repoman-2.3.8
 ==
 * The --experimental-repository-modules= option enables a new

diff --git a/repoman/setup.py b/repoman/setup.py
index 16ee0bc63..23abff9b9 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -466,7 +466,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.9',
+   version = '2.3.10',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/scan/depend/, pym/portage/dbapi/

2018-07-16 Thread Zac Medico
commit: ef604f402a93234a4b6e3ef433678c8fa04c746b
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Jul 15 22:51:48 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Mon Jul 16 06:13:02 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=ef604f40

repoman: populate implicit IUSE for empty profile (bug 660982)

For the empty profile that's used to check dependencies of
ebuilds that have empty KEYWORDS, populate implicit IUSE
from all of the make.defaults files found in the relevant
repositories (this should take less than 1 second on most
hardware). Since the IUSE.missing check cannot be performed
without implicit IUSE settings, this makes the IUSE.missing
check work for ebuilds with empty KEYWORDS.

Bug: https://bugs.gentoo.org/660982

 pym/portage/dbapi/__init__.py  | 10 ++
 repoman/pym/repoman/modules/scan/depend/profile.py | 36 ++
 2 files changed, 39 insertions(+), 7 deletions(-)

diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py
index 61d301839..6fca6090c 100644
--- a/pym/portage/dbapi/__init__.py
+++ b/pym/portage/dbapi/__init__.py
@@ -219,17 +219,13 @@ class dbapi(object):
def _repoman_iuse_implicit_cnstr(self, pkg, metadata):
"""
In repoman's version of _iuse_implicit_cnstr, account for 
modifications
-   of the self.settings reference between calls, and treat all 
flags as
-   valid for the empty profile because it does not have any 
implicit IUSE
-   settings. See bug 660982.
+   of the self.settings reference between calls.
"""
eapi_attrs = _get_eapi_attrs(metadata["EAPI"])
if eapi_attrs.iuse_effective:
-   iuse_implicit_match = lambda flag: (True if not 
self.settings.profile_path
-   else self.settings._iuse_effective_match(flag))
+   iuse_implicit_match = lambda flag: 
self.settings._iuse_effective_match(flag)
else:
-   iuse_implicit_match = lambda flag: (True if not 
self.settings.profile_path
-   else self.settings._iuse_implicit_match(flag))
+   iuse_implicit_match = lambda flag: 
self.settings._iuse_implicit_match(flag)
return iuse_implicit_match
 
def _iuse_implicit_cnstr(self, pkg, metadata):

diff --git a/repoman/pym/repoman/modules/scan/depend/profile.py 
b/repoman/pym/repoman/modules/scan/depend/profile.py
index 8e0a22f9c..d980f4eca 100644
--- a/repoman/pym/repoman/modules/scan/depend/profile.py
+++ b/repoman/pym/repoman/modules/scan/depend/profile.py
@@ -2,6 +2,7 @@
 
 
 import copy
+import os
 from pprint import pformat
 
 from _emerge.Package import Package
@@ -12,6 +13,8 @@ from repoman.modules.scan.scanbase import ScanBase
 from repoman.modules.scan.depend._depend_checks import _depend_checks
 from repoman.modules.scan.depend._gen_arches import _gen_arches
 from portage.dep import Atom
+from portage.package.ebuild.profile_iuse import iter_iuse_vars
+from portage.util import getconfig
 
 
 def sort_key(item):
@@ -102,6 +105,11 @@ class ProfileDependsChecks(ScanBase):
local_config=False,

_unmatched_removal=self.options.unmatched_removal,
env=self.env, 
repositories=self.repo_settings.repoman_settings.repositories)
+
+   if not prof.abs_path:
+   
self._populate_implicit_iuse(dep_settings,
+   
self.repo_settings.repo_config.eclass_db.porttrees)
+
dep_settings.categories = 
self.repo_settings.repoman_settings.categories
if self.options.without_mask:
dep_settings._mask_manager_obj = \
@@ -257,3 +265,31 @@ class ProfileDependsChecks(ScanBase):
def runInEbuilds(self):
'''Ebuild level scans'''
return (True, [self.check])
+
+   @staticmethod
+   def _populate_implicit_iuse(config, repo_locations):
+   """
+   Populate implicit IUSE for the empty profile, see bug 660982.
+
+   @param config: config instance for the empty profile
+   @type config: portage.config
+   @param repo_locations: locations of repositories containing 
relevant
+   implicit IUSE settings
+   @type repo_locations: list
+   """
+   dest = config.configdict['defaults']
+   for location in repo_locations:
+   for parent_dir, dirs, files in 
os.walk(os.path.join(location, 'profiles')):
+   src = getconfig(os.path.join(parent_dir, 
'make.defaults'))
+  

[gentoo-commits] proj/portage:master commit in: repoman/cnf/repository/, repoman/man/, repoman/cnf/qa_data/, ...

2018-07-14 Thread Brian Dolbec
commit: f4faf6d7950150a3068f92a3f3615b884db897d6
Author: Louis Sautier  gmail  com>
AuthorDate: Wed Jun 20 13:44:51 2018 +
Commit: Brian Dolbec  gentoo  org>
CommitDate: Sat Jul 14 15:44:08 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=f4faf6d7

repoman: add a check for unsorted KEYWORDS

 repoman/cnf/qa_data/qa_data.yaml|  1 +
 repoman/cnf/repository/qa_data.yaml |  1 +
 repoman/man/repoman.1   |  3 +++
 .../pym/repoman/modules/scan/keywords/keywords.py   | 21 +
 4 files changed, 26 insertions(+)

diff --git a/repoman/cnf/qa_data/qa_data.yaml b/repoman/cnf/qa_data/qa_data.yaml
index 49ffdaf74..6aad56b8c 100644
--- a/repoman/cnf/qa_data/qa_data.yaml
+++ b/repoman/cnf/qa_data/qa_data.yaml
@@ -83,6 +83,7 @@ qahelp:
 missing: "Ebuilds that have a missing or empty KEYWORDS variable"
 stable: "Ebuilds that have been added directly with stable KEYWORDS"
 stupid: "Ebuilds that use KEYWORDS=-* instead of package.mask"
+unsorted: "Ebuilds that contain KEYWORDS which are not sorted 
alphabetically."
 LICENSE:
 deprecated: "This ebuild is listing a deprecated license."
 invalid: "This ebuild is listing a license that doesnt exist in 
portages license/ dir."

diff --git a/repoman/cnf/repository/qa_data.yaml 
b/repoman/cnf/repository/qa_data.yaml
index 2e9e16b1d..c96ce46a9 100644
--- a/repoman/cnf/repository/qa_data.yaml
+++ b/repoman/cnf/repository/qa_data.yaml
@@ -67,6 +67,7 @@ qawarnings:
 - KEYWORDS.dropped
 - KEYWORDS.stupid
 - KEYWORDS.missing
+- KEYWORDS.unsorted
 - LICENSE.deprecated
 - LICENSE.virtual
 - metadata.warning

diff --git a/repoman/man/repoman.1 b/repoman/man/repoman.1
index 01f37dd99..dea17c3b4 100644
--- a/repoman/man/repoman.1
+++ b/repoman/man/repoman.1
@@ -228,6 +228,9 @@ Ebuilds that have been added directly with stable KEYWORDS
 .B KEYWORDS.stupid
 Ebuilds that use KEYWORDS=-* instead of package.mask
 .TP
+.B KEYWORDS.unsorted
+Ebuilds that contain KEYWORDS which are not sorted alphabetically.
+.TP
 .B LICENSE.deprecated
 This ebuild is listing a deprecated license.
 .TP

diff --git a/repoman/pym/repoman/modules/scan/keywords/keywords.py 
b/repoman/pym/repoman/modules/scan/keywords/keywords.py
index 1e9623906..556f352ad 100644
--- a/repoman/pym/repoman/modules/scan/keywords/keywords.py
+++ b/repoman/pym/repoman/modules/scan/keywords/keywords.py
@@ -55,6 +55,8 @@ class KeywordChecks(ScanBase):
 
self._checkForMaskLikeKeywords(xpkg, y_ebuild, ebuild.keywords)
 
+   self._checkForUnsortedKeywords(ebuild, xpkg, y_ebuild)
+
self.slot_keywords[pkg.slot].update(ebuild.archs)
return False
 
@@ -133,6 +135,25 @@ class KeywordChecks(ScanBase):
self.qatracker.add_error("KEYWORDS.stupid",
"%s/%s.ebuild" % (xpkg, y_ebuild))
 
+   def _checkForUnsortedKeywords(self, ebuild, xpkg, y_ebuild):
+   '''Ebuilds that contain KEYWORDS
+   which are not sorted alphabetically.'''
+   def sort_keywords(kw):
+   # Split keywords containing hyphens. The part after
+   # the hyphen should be treated as the primary key.
+   # This is consistent with ekeyword.
+   parts = list(reversed(kw.lstrip("~-").split("-", 1)))
+   # Hack to make sure that keywords
+   # without hyphens are sorted first
+   if len(parts) == 1:
+   parts.insert(0, "")
+   return parts
+   sorted_keywords = sorted(ebuild.keywords, key=sort_keywords)
+   if sorted_keywords != ebuild.keywords:
+   self.qatracker.add_error("KEYWORDS.unsorted",
+   "%s/%s.ebuild contains unsorted keywords" %
+   (xpkg, y_ebuild))
+
@property
def runInPkgs(self):
'''Package level scans'''



[gentoo-commits] proj/portage:master commit in: repoman/cnf/repository/, repoman/cnf/qa_data/, ...

2018-07-14 Thread Michał Górny
commit: 1bc4cd48c85b1a367f3f5adf07428e1e638d5e60
Author: Michał Górny  gentoo  org>
AuthorDate: Sat Mar  3 21:29:11 2018 +
Commit: Michał Górny  gentoo  org>
CommitDate: Sat Jul 14 08:43:13 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=1bc4cd48

repoman: Warn on = dependencies without * or revision

Warn if the '=' package dependency operator is used along with pure
version with no revision specified. This means to catch a common mistake
of developers copying '=' from upstream dependency specification while
'~' operator would be more appropriate. This causes unintended depgraph
breakage when the dependencies are revbumped e.g. due to dependency
changes, or prevents people from upgrading.

The developers are given two suggestions: either to use '~' if any
revision is acceptable, or to explicitly specify '-r0' when they really
do accept -r0 only.

Bug: https://bugs.gentoo.org/649482
Reviewed-by: Zac Medico  gentoo.org>

 repoman/cnf/qa_data/qa_data.yaml  | 1 +
 repoman/cnf/repository/qa_data.yaml   | 1 +
 repoman/pym/repoman/modules/scan/depend/_depend_checks.py | 9 +
 3 files changed, 11 insertions(+)

diff --git a/repoman/cnf/qa_data/qa_data.yaml b/repoman/cnf/qa_data/qa_data.yaml
index 32994e013..49ffdaf74 100644
--- a/repoman/cnf/qa_data/qa_data.yaml
+++ b/repoman/cnf/qa_data/qa_data.yaml
@@ -26,6 +26,7 @@ qahelp:
 badinexp: "User-visible ebuilds with unsatisfied dependencies (matched 
against *visible* ebuilds) in experimental arch"
 badmaskedinexp: "Masked ebuilds with unsatisfied dependencies (matched 
against *all* ebuilds) in experimental arch"
 badtilde: "Uses the ~ dep operator with a non-zero revision part, 
which is useless (the revision is ignored)"
+equalsversion: "Suspicious =-dependency with a specific version and no 
rev. Please either use ~ if any revision is acceptable, or append -r0 to 
silence the warning."
 missingslot: "RDEPEND matches more than one SLOT but does not specify 
a slot and/or use the := or :* slot operator"
 perlcore: "This ebuild directly depends on a package in perl-core; it 
should use the corresponding virtual instead."
 syntax: "Syntax error in dependency string (usually an extra/missing 
space/parenthesis)"

diff --git a/repoman/cnf/repository/qa_data.yaml 
b/repoman/cnf/repository/qa_data.yaml
index 4aa961633..2e9e16b1d 100644
--- a/repoman/cnf/repository/qa_data.yaml
+++ b/repoman/cnf/repository/qa_data.yaml
@@ -44,6 +44,7 @@ qawarnings:
 - dependency.badindev
 - dependency.badmaskedindev
 - dependency.badtilde
+- dependency.equalsversion
 - dependency.missingslot
 - dependency.perlcore
 - DESCRIPTION.toolong

diff --git a/repoman/pym/repoman/modules/scan/depend/_depend_checks.py 
b/repoman/pym/repoman/modules/scan/depend/_depend_checks.py
index 79fd0a0c2..690b95aa0 100644
--- a/repoman/pym/repoman/modules/scan/depend/_depend_checks.py
+++ b/repoman/pym/repoman/modules/scan/depend/_depend_checks.py
@@ -152,6 +152,15 @@ def _depend_checks(ebuild, pkg, portdb, qatracker, 
repo_metadata, qadata):
qacat, "%s: %s uses the ~ 
operator"
" with a non-zero revision: 
'%s'" %
(ebuild.relative_path, mytype, 
atom))
+   # plain =foo-1.2.3 without revision or *
+   if atom.operator == "=" and '-r' not in 
atom.version:
+   qacat = 'dependency.equalsversion'
+   qatracker.add_error(
+   qacat, "%s: %s uses the = 
operator with"
+   " no revision: '%s'; if any 
revision is"
+   " acceptable, use '~' instead; 
if only -r0"
+   " then please append '-r0' to 
the dep" %
+   (ebuild.relative_path, mytype, 
atom))
 
check_missingslot(atom, mytype, ebuild.eapi, 
portdb, qatracker,
ebuild.relative_path, ebuild.metadata)



[gentoo-commits] proj/portage:master commit in: repoman/bin/, repoman/pym/repoman/tests/

2018-05-16 Thread Zac Medico
commit: b414df90b50aaf73dda3708680c6951e7dc8bad9
Author: Zac Medico  gentoo  org>
AuthorDate: Wed May 16 23:28:13 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed May 16 23:28:13 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=b414df90

repoman: explicitly close event loops (bug 654390)

The default asyncio event loop triggers a resource warning if it
is not explicitly closed, therefore close it when appropriate.

Bug: https://bugs.gentoo.org/654390

 repoman/bin/repoman   | 3 +++
 repoman/pym/repoman/tests/runTests.py | 6 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/repoman/bin/repoman b/repoman/bin/repoman
index 7084ff918..ab04d56ca 100755
--- a/repoman/bin/repoman
+++ b/repoman/bin/repoman
@@ -38,6 +38,7 @@ if osp.isfile(osp.join(osp.dirname(osp.dirname(here)), 
".repoman_not_installed")
 
 import portage
 portage._internal_caller = True
+from portage.util._eventloop.global_event_loop import global_event_loop
 from repoman.main import repoman_main
 
 try:
@@ -48,3 +49,5 @@ except IOError as e:
sys.exit(1)
else:
raise
+finally:
+   global_event_loop().close()

diff --git a/repoman/pym/repoman/tests/runTests.py 
b/repoman/pym/repoman/tests/runTests.py
index b0e715ec6..ed73592a1 100644
--- a/repoman/pym/repoman/tests/runTests.py
+++ b/repoman/pym/repoman/tests/runTests.py
@@ -45,6 +45,7 @@ portage._internal_caller = True
 # Ensure that we don't instantiate portage.settings, so that tests should
 # work the same regardless of global configuration file state/existence.
 portage._disable_legacy_globals()
+from portage.util._eventloop.global_event_loop import global_event_loop
 
 if os.environ.get('NOCOLOR') in ('yes', 'true'):
portage.output.nocolor()
@@ -66,4 +67,7 @@ if insert_bin_path:
os.environ["PATH"] = ":".join(path)
 
 if __name__ == "__main__":
-   sys.exit(tests.main())
+   try:
+   sys.exit(tests.main())
+   finally:
+   global_event_loop().close()



[gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/linechecks/deprecated/

2018-05-14 Thread Michał Górny
commit: 6daa3fcacaebd9ed91bcf0316387971f304f87f8
Author: Michał Górny  gentoo  org>
AuthorDate: Mon May 14 07:00:11 2018 +
Commit: Michał Górny  gentoo  org>
CommitDate: Tue May 15 05:31:02 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=6daa3fca

repoman: Add EAPI 7 eclass deprecation

Explicitly indicate that epatch, ltprune and versionator eclasses
are deprecated.  Do not deprecate eapi7-ver yet since it is still
required in EAPI 6.

Reviewed-by: Zac Medico  gentoo.org>

 repoman/pym/repoman/modules/linechecks/deprecated/inherit.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py 
b/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py
index 8a20f22a4..77ad4f625 100644
--- a/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py
+++ b/repoman/pym/repoman/modules/linechecks/deprecated/inherit.py
@@ -17,6 +17,7 @@ class InheritDeprecated(LineCheck):
"clutter": "gnome2",
"confutils": False,
"distutils": "distutils-r1",
+   "epatch": "(eapply since EAPI 6)",
"games": False,
"gems": "ruby-fakegem",
"gpe": False,
@@ -25,9 +26,11 @@ class InheritDeprecated(LineCheck):
"gst-plugins-good": "gstreamer",
"gst-plugins-ugly": "gstreamer",
"gst-plugins10": "gstreamer",
+   "ltprune": False,
"mono": "mono-env",
"python": "python-r1 / python-single-r1 / python-any-r1",
"ruby": "ruby-ng",
+   "versionator": "eapi7-ver (built-in since EAPI 7)",
"x-modular": "xorg-2",
}
 



[gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/scan/fetch/

2018-05-13 Thread Zac Medico
commit: b9b459034b1b7039844a06a6e5af39ef5aeb4b3b
Author: Zac Medico  gentoo  org>
AuthorDate: Sun May 13 15:23:43 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Sun May 13 15:23:43 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=b9b45903

repoman: fix file.size.fatal qacat (bug 655576)

This qacat was renamed from file.size.fatal to file.size-fatal when the
qacats moved from python to yaml.

Fixes: 10badb74f85e62a89258f950a07b9ced82dc562a
Fixes: 910071fea7a131974b39693eef5d39b72ac4842f
Bug: https://bugs.gentoo.org/655576

 repoman/pym/repoman/modules/scan/fetch/fetches.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repoman/pym/repoman/modules/scan/fetch/fetches.py 
b/repoman/pym/repoman/modules/scan/fetch/fetches.py
index 241cfaa7b..5a958a461 100644
--- a/repoman/pym/repoman/modules/scan/fetch/fetches.py
+++ b/repoman/pym/repoman/modules/scan/fetch/fetches.py
@@ -124,7 +124,7 @@ class FetchChecks(ScanBase):
# while file size over 60 KiB causes an error.
elif mystat.st_size > 61440:
self.qatracker.add_error(
-   "file.size.fatal", "(%d KiB) 
%s/files/%s" % (
+   "file.size-fatal", "(%d KiB) 
%s/files/%s" % (
mystat.st_size // 1024, 
xpkg, y))
elif mystat.st_size > 20480:
self.qatracker.add_error(



[gentoo-commits] proj/portage:master commit in: repoman/, /

2018-05-01 Thread Zac Medico
commit: 5914efcecc6821c09aa1e6a62d0da8ee3fe8b56f
Author: Zac Medico  gentoo  org>
AuthorDate: Wed May  2 02:27:12 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Wed May  2 02:29:13 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=5914efce

setup.py: fix sdist bztar format default for python3.6

Since python3.6 defaults to gztar format unconditionally,
override it.

 repoman/setup.py | 3 +--
 setup.py | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/repoman/setup.py b/repoman/setup.py
index 3bb76ab8a..16ee0bc63 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -347,8 +347,7 @@ class x_sdist(sdist):
""" sdist defaulting to .tar.bz2 format, and archive files owned by 
root """
 
def finalize_options(self):
-   if self.formats is None:
-   self.formats = ['bztar']
+   self.formats = ['bztar']
if self.owner is None:
self.owner = 'root'
if self.group is None:

diff --git a/setup.py b/setup.py
index 6111a5582..86fd62470 100755
--- a/setup.py
+++ b/setup.py
@@ -535,8 +535,7 @@ class x_sdist(sdist):
""" sdist defaulting to .tar.bz2 format, and archive files owned by 
root """
 
def finalize_options(self):
-   if self.formats is None:
-   self.formats = ['bztar']
+   self.formats = ['bztar']
if self.owner is None:
self.owner = 'root'
if self.group is None:



[gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/scan/

2018-04-05 Thread Zac Medico
commit: 51eed5033771a58cb3e6c7952440c1a3e35416c7
Author: Zac Medico  gentoo  org>
AuthorDate: Thu Apr  5 19:39:48 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Thu Apr  5 19:43:26 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=51eed503

repoman.modules.scan.module.ModuleConfig: pass stream to safe_load

The yaml.safe_load() documentation says that the argument should
be a stream rather than a string.

Reported-by: Michał Górny  gentoo.org>

 repoman/pym/repoman/modules/scan/module.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repoman/pym/repoman/modules/scan/module.py 
b/repoman/pym/repoman/modules/scan/module.py
index 8a7a53638..baed68989 100644
--- a/repoman/pym/repoman/modules/scan/module.py
+++ b/repoman/pym/repoman/modules/scan/module.py
@@ -69,7 +69,7 @@ class ModuleConfig(object):
if os.path.exists(path):
try:
with open(path, 'r') as inputfile:
-   
configs.append(yaml.safe_load(inputfile.read()))
+   
configs.append(yaml.safe_load(inputfile))
except IOError as error:
logging,error("Failed to load file: 
%s", inputfile)
logging.exception(error)



[gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/

2018-03-30 Thread Zac Medico
commit: 1b2256106e368504b69e12514004d0e8a8e73b9b
Author: Manuel Rüger  gentoo  org>
AuthorDate: Fri Mar 30 13:43:44 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Mar 30 17:22:35 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=1b225610

FileNotFoundError is not defined in python2.7

Closes: https://github.com/gentoo/portage/pull/288
Fixes: 36fd0a505fe0 ("repoman: Add a new config.py file with config loading 
utilities")

 repoman/pym/repoman/config.py | 5 +
 1 file changed, 5 insertions(+)

diff --git a/repoman/pym/repoman/config.py b/repoman/pym/repoman/config.py
index 0f2358cd9..578bbccde 100644
--- a/repoman/pym/repoman/config.py
+++ b/repoman/pym/repoman/config.py
@@ -8,6 +8,11 @@ import stat
 
 import yaml
 
+try:
+   FileNotFoundError
+except NameError:
+   FileNotFoundError = EnvironmentError
+
 
 class ConfigError(Exception):
"""Raised when a config file fails to load"""



[gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/, repoman/cnf/repository/, repoman/man/, ...

2018-03-30 Thread Zac Medico
commit: 2ecf4e2b0ebdf727f2210f3b7db600e781cff1c4
Author: Zac Medico  gentoo  org>
AuthorDate: Fri Mar 30 05:42:54 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Mar 30 06:39:22 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=2ecf4e2b

repoman: add --experimental-repository-modules= option

This disables the new repository modules feature by default,
and it can be enabled in REPOMAN_DEFAULT_OPTS if desired.

 repoman/cnf/repository/linechecks.yaml | 252 +
 repoman/cnf/repository/qa_data.yaml| 160 ++
 repoman/cnf/repository/repository.yaml |  76 +
 repoman/man/repoman.1  |   4 +
 repoman/pym/repoman/argparser.py   |   5 +
 repoman/pym/repoman/modules/scan/module.py |  14 +-
 repoman/pym/repoman/qa_data.py |  11 +-
 repoman/pym/repoman/scanner.py |   3 +-
 repoman/setup.py   |   4 +
 9 files changed, 525 insertions(+), 4 deletions(-)

diff --git a/repoman/cnf/repository/linechecks.yaml 
b/repoman/cnf/repository/linechecks.yaml
new file mode 100644
index 0..bad7df93d
--- /dev/null
+++ b/repoman/cnf/repository/linechecks.yaml
@@ -0,0 +1,252 @@
+---
+# linecheck.yaml
+
+# configuration file for the LineCheck plugins run via the multicheck
+# scan module
+# no random drive-by commits please
+# Please obtain authorization from the portage team
+#
+# Overlay maintainers override/add/negate checks at your discression
+# but support for third party module will be limited to the plugin API
+#
+
+# Repoman API version (do not edit)
+version: 1
+# minimum
+repoman_version: 2.3.3
+
+eclass_export_functions:
+- ant-tasks
+- apache-2
+- apache-module
+- aspell-dict
+- autotools-utils
+- base
+- bsdmk
+- cannadic
+- clutter
+- cmake-utils
+- db
+- distutils
+- elisp
+- embassy
+- emboss
+- emul-linux-x86
+- enlightenment
+- font-ebdftopcf
+- font
+- fox
+- freebsd
+- freedict
+- games
+- games-ggz
+- games-mods
+- gdesklets
+- gems
+- gkrellm-plugin
+- gnatbuild
+- gnat
+- gnome2
+- gnome-python-common
+- gnustep-base
+- go-mono
+- gpe
+- gst-plugins-bad
+- gst-plugins-base
+- gst-plugins-good
+- gst-plugins-ugly
+- gtk-sharp-module
+- haskell-cabal
+- horde
+- java-ant-2
+- java-pkg-2
+- java-pkg-simple
+- java-virtuals-2
+- kde4-base
+- kde4-meta
+- kernel-2
+- latex-package
+- linux-mod
+- mozlinguas
+- myspell
+- myspell-r2
+- mysql
+- mysql-v2
+- mythtv-plugins
+- oasis
+- obs-service
+- office-ext
+- perl-app
+- perl-module
+- php-ext-base-r1
+- php-ext-pecl-r2
+- php-ext-source-r2
+- php-lib-r1
+- php-pear-lib-r1
+- php-pear-r1
+- python-distutils-ng
+- python
+- qt4-build
+- qt4-r2
+- rox-0install
+- rox
+- ruby
+- ruby-ng
+- scsh
+- selinux-policy-2
+- sgml-catalog
+- stardict
+- sword-module
+- tetex-3
+- tetex
+- texlive-module
+- toolchain-binutils
+- toolchain
+- twisted
+- vdr-plugin-2
+- vdr-plugin
+- vim
+- vim-plugin
+- vim-spell
+- virtuoso
+- vmware
+- vmware-mod
+- waf-utils
+- webapp
+- xemacs-elisp
+- xemacs-packages
+- xfconf
+- x-modular
+- xorg-2
+- zproduct
+
+eclass_info_experimental_inherit:
+autotools:
+funcs:
+- eaclocal
+- eautoconf
+- eautoheader
+- eautomake
+- eautoreconf
+- _elibtoolize
+- eautopoint
+comprehensive: true
+# Exempt eclasses:
+# git - An EGIT_BOOTSTRAP variable may be used to call one of
+#   the autotools functions.
+# subversion - An ESVN_BOOTSTRAP variable may be used to call one of
+#   the autotools functions.
+exempt_eclasses:
+- git
+- git-2
+- subversion
+- autotools-utils
+eutils:
+funcs:
+- estack_push
+- estack_pop
+- eshopts_push
+- eshopts_pop
+- eumask_push
+- eumask_pop
+- epatch
+- epatch_user
+- emktemp
+- edos2unix
+- in_iuse
+- use_if_iuse
+- usex
+comprehensive: false
+flag-o-matic:
+funcs:
+- 'filter-(ld)?flags'
+- 'strip-flags'
+- 'strip-unsupported-flags'
+- 'append-((ld|c(pp|xx)?))?flags'
+- 'append-libs'
+comprehensive: false
+libtool:
+funcs:
+- elibtoolize
+comprehensive: true
+exempt_eclasses:
+- autotools
+multilib:
+

[gentoo-commits] proj/portage:master commit in: repoman/

2018-03-30 Thread Zac Medico
commit: 25aad450a95bec2fb921a93b070ca68a1b8c1cf4
Author: Zac Medico  gentoo  org>
AuthorDate: Fri Mar 30 06:27:01 2018 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Mar 30 06:39:22 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=25aad450

repoman: Update for a repoman-2.3.9 release

 repoman/RELEASE-NOTES | 7 +++
 repoman/setup.py  | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/repoman/RELEASE-NOTES b/repoman/RELEASE-NOTES
index 42e66969e..12ddefc20 100644
--- a/repoman/RELEASE-NOTES
+++ b/repoman/RELEASE-NOTES
@@ -1,6 +1,13 @@
 Release Notes; upgrade information mainly.
 Features/major bugfixes are listed in NEWS
 
+repoman-2.3.8
+==
+* The --experimental-repository-modules= option enables a new
+  plugin modules system:
+  https://wiki.gentoo.org/wiki/Project:Portage/Repoman-Module-specs
+
+
 repoman-2.3.7
 ==
 * Bug Fixes:

diff --git a/repoman/setup.py b/repoman/setup.py
index 5c58a9a51..3bb76ab8a 100755
--- a/repoman/setup.py
+++ b/repoman/setup.py
@@ -467,7 +467,7 @@ def get_manpages():
 
 setup(
name = 'repoman',
-   version = '2.3.8',
+   version = '2.3.9',
url = 'https://wiki.gentoo.org/wiki/Project:Portage',
author = 'Gentoo Portage Development Team',
author_email = 'dev-port...@gentoo.org',



[gentoo-commits] proj/portage:master commit in: repoman/cnf/linechecks/, repoman/pym/repoman/modules/linechecks/

2018-03-29 Thread Zac Medico
commit: 4d8602ba2f21b3b0a1ad9385fc3c8b8d05276ba7
Author: Brian Dolbec  gentoo  org>
AuthorDate: Tue Dec  5 18:17:15 2017 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Mar 30 03:51:21 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=4d8602ba

repoman linechecks/config.py: Move the errors loading to a new 
/usr/share/repoman/linechecks directory

This new directory can be installed to by third party add on modules that 
extend the checks.
We can also in future use these file to get loaclized translations.

 repoman/cnf/linechecks/linechecks.yaml   | 35 
 repoman/pym/repoman/modules/linechecks/config.py | 19 +++--
 2 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/repoman/cnf/linechecks/linechecks.yaml 
b/repoman/cnf/linechecks/linechecks.yaml
new file mode 100644
index 0..634381e80
--- /dev/null
+++ b/repoman/cnf/linechecks/linechecks.yaml
@@ -0,0 +1,35 @@
+---
+# linecheck_help.yaml
+
+# Repoman API version (do not edit)
+version: 1
+# minimum
+repoman_version: 2.3.3
+
+# configuration file for the LineCheck plugins run via the multicheck
+# scan module
+errors:
+COPYRIGHT_ERROR: 'Invalid Gentoo Copyright on line: %d'
+LICENSE_ERROR: 'Invalid Gentoo/GPL License on line: %d'
+ID_HEADER_ERROR: 'Stale CVS header on line: %d'
+NO_BLANK_LINE_ERROR: 'Non-blank line after header on line: %d'
+LEADING_SPACES_ERROR: 'Ebuild contains leading spaces on line: %d'
+TRAILING_WHITESPACE_ERROR: 'Trailing whitespace error on line: %d'
+READONLY_ASSIGNMENT_ERROR: 'Ebuild contains assignment to read-only 
variable on line: %d'
+MISSING_QUOTES_ERROR: 'Unquoted Variable on line: %d'
+NESTED_DIE_ERROR: 'Ebuild calls die in a subshell on line: %d'
+PATCHES_ERROR: 'PATCHES is not a bash array on line: %d'
+REDUNDANT_CD_S_ERROR: 'Ebuild has redundant cd ${S} statement on line: %d'
+EMAKE_PARALLEL_DISABLED: 'Upstream parallel compilation bug (ebuild calls 
emake -j1 on line: %d)'
+EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS: 'Upstream parallel compilation bug 
(MAKEOPTS=-j1 on line: %d)'
+DEPRECATED_BINDNOW_FLAGS: 'Deprecated bindnow-flags call on line: %d'
+EAPI_DEFINED_AFTER_INHERIT: 'EAPI defined after inherit on line: %d'
+NO_AS_NEEDED: 'Upstream asneeded linking bug (no-as-needed on line: %d)'
+PRESERVE_OLD_LIB: 'Ebuild calls deprecated preserve_old_lib on line: %d'
+BUILT_WITH_USE: 'built_with_use on line: %d'
+NO_OFFSET_WITH_HELPERS: 'Helper function is used with D, ROOT, ED, EROOT 
or EPREFIX on line: %d'
+SANDBOX_ADDPREDICT: 'Ebuild calls addpredict on line: %d'
+USEQ_ERROR: 'Ebuild calls deprecated useq function on line: %d'
+HASQ_ERROR: 'Ebuild calls deprecated hasq function on line: %d'
+URI_HTTPS: 'Ebuild uses http:// but should use https:// on line: %d'
+

diff --git a/repoman/pym/repoman/modules/linechecks/config.py 
b/repoman/pym/repoman/modules/linechecks/config.py
index bde2e587f..6e4c5314e 100644
--- a/repoman/pym/repoman/modules/linechecks/config.py
+++ b/repoman/pym/repoman/modules/linechecks/config.py
@@ -15,6 +15,7 @@ from copy import deepcopy
 
 from repoman._portage import portage
 from repoman.config import load_config
+from repoman import _not_installed
 
 # Avoid a circular import issue in py2.7
 portage.proxy.lazyimport.lazyimport(globals(),
@@ -46,8 +47,7 @@ class LineChecksConfig(object):
@param configpaths: ordered list of filepaths to load
'''
self.repo_settings = repo_settings
-   self.infopaths = [os.path.join(path, 'linechecks.yaml') for 
path in self.repo_settings.masters_list]
-   logging.debug("LineChecksConfig; configpaths: %s", 
self.infopaths)
+   self.infopaths = None
self.info_config = None
self._config = None
self.usex_supported_eapis = None
@@ -58,8 +58,22 @@ class LineChecksConfig(object):
self.eclass_info = {}
self.eclass_info_experimental_inherit = {}
self.errors = {}
+   self.set_infopaths()
self.load_checks_info()
 
+   def set_infopaths(self):
+   if _not_installed:
+   cnfdir = os.path.realpath(os.path.join(os.path.dirname(
+   os.path.dirname(os.path.dirname(os.path.dirname(
+   os.path.dirname(__file__), 
'cnf/linechecks'))
+   else:
+   cnfdir = os.path.join(portage.const.EPREFIX or '/', 
'usr/share/repoman/linechecks')
+   repomanpaths = [os.path.join(cnfdir, _file_) for _file_ in 
os.listdir(cnfdir)]
+   logging.debug("LineChecksConfig; repomanpaths: %s", 
repomanpaths)
+   repopaths = [os.path.join(path, 'linechecks.yaml') for path in 
self.repo_settings.masters_list]
+   self.infopaths = repomanpaths + 

[gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/linechecks/whitespace/

2018-03-29 Thread Zac Medico
commit: 717f46dff518503282f9440f1ed39fbe7698dcee
Author: Brian Dolbec  gentoo  org>
AuthorDate: Sat Jul 15 01:07:13 2017 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Mar 30 03:51:19 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=717f46df

repoman: New linechecks module, whitespace

 .../modules/linechecks/whitespace/__init__.py  | 27 ++
 .../repoman/modules/linechecks/whitespace/blank.py | 25 
 .../modules/linechecks/whitespace/whitespace.py| 21 +
 3 files changed, 73 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/__init__.py 
b/repoman/pym/repoman/modules/linechecks/whitespace/__init__.py
new file mode 100644
index 0..ded690ed7
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/__init__.py
@@ -0,0 +1,27 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Whitespace plug-in module for repoman LineChecks.
+Performs checks for useless whitespace in ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+   'name': 'do',
+   'description': doc,
+   'provides':{
+   'whitespace-check': {
+   'name': "whitespace",
+   'sourcefile': "whitespace",
+   'class': "EbuildWhitespace",
+   'description': doc,
+   },
+   'blankline-check': {
+   'name': "blankline",
+   'sourcefile': "blank",
+   'class': "EbuildBlankLine",
+   'description': doc,
+   },
+   }
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/blank.py 
b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
new file mode 100644
index 0..2ab4097a3
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/blank.py
@@ -0,0 +1,25 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildBlankLine(LineCheck):
+   repoman_check_name = 'ebuild.minorsyn'
+   ignore_comment = False
+   blank_line = re.compile(r'^$')
+
+   def new(self, pkg):
+   self.line_is_blank = False
+
+   def check(self, num, line):
+   if self.line_is_blank and self.blank_line.match(line):
+   return 'Useless blank line on line: %d'
+   if self.blank_line.match(line):
+   self.line_is_blank = True
+   else:
+   self.line_is_blank = False
+
+   def end(self):
+   if self.line_is_blank:
+   yield 'Useless blank line on last line'

diff --git a/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py 
b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
new file mode 100644
index 0..556b2ab81
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/whitespace/whitespace.py
@@ -0,0 +1,21 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildWhitespace(LineCheck):
+   """Ensure ebuilds have proper whitespacing"""
+
+   repoman_check_name = 'ebuild.minorsyn'
+
+   ignore_line = re.compile(r'(^$)|(^(\t)*#)')
+   ignore_comment = False
+   leading_spaces = re.compile(r'^[\S\t]')
+   trailing_whitespace = re.compile(r'.*([\S]$)')
+
+   def check(self, num, line):
+   if self.leading_spaces.match(line) is None:
+   return self.errors['LEADING_SPACES_ERROR']
+   if self.trailing_whitespace.match(line) is None:
+   return self.errors['TRAILING_WHITESPACE_ERROR']



[gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/scan/ebuild/

2018-03-29 Thread Zac Medico
commit: ac86784b164c8705c45f79d3418d783e59d99a9a
Author: Brian Dolbec  gentoo  org>
AuthorDate: Sat Jul 15 01:10:13 2017 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Mar 30 03:51:20 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=ac86784b

repoman: Remove the no longer used modules/scan/ebuild/checks.py

 repoman/pym/repoman/modules/scan/ebuild/checks.py | 1044 -
 1 file changed, 1044 deletions(-)

diff --git a/repoman/pym/repoman/modules/scan/ebuild/checks.py 
b/repoman/pym/repoman/modules/scan/ebuild/checks.py
deleted file mode 100644
index de03bedd2..0
--- a/repoman/pym/repoman/modules/scan/ebuild/checks.py
+++ /dev/null
@@ -1,1044 +0,0 @@
-# -*- coding:utf-8 -*-
-# repoman: Checks
-# Copyright 2007-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-"""This module contains functions used in Repoman to ascertain the quality
-and correctness of an ebuild."""
-
-from __future__ import unicode_literals
-
-from itertools import chain
-import operator
-import re
-import time
-
-# import our initialized portage instance
-from repoman._portage import portage
-
-from portage.eapi import (
-   eapi_supports_prefix, eapi_has_implicit_rdepend,
-   eapi_has_src_prepare_and_src_configure, eapi_has_dosed_dohard,
-   eapi_exports_AA, eapi_has_pkg_pretend)
-
-from . import errors
-
-
-class LineCheck(object):
-   """Run a check on a line of an ebuild."""
-   """A regular expression to determine whether to ignore the line"""
-   ignore_line = False
-   """True if lines containing nothing more than comments with optional
-   leading whitespace should be ignored"""
-   ignore_comment = True
-
-   def new(self, pkg):
-   pass
-
-   def check_eapi(self, eapi):
-   """Returns if check should be run in the given EAPI (default: 
True)"""
-   return True
-
-   def check(self, num, line):
-   """Run the check on line and return error if there is one"""
-   if self.re.match(line):
-   return self.error
-
-   def end(self):
-   pass
-
-
-class PhaseCheck(LineCheck):
-   """ basic class for function detection """
-
-   func_end_re = re.compile(r'^\}$')
-   phases_re = re.compile('(%s)' % '|'.join((
-   'pkg_pretend', 'pkg_setup', 'src_unpack', 'src_prepare',
-   'src_configure', 'src_compile', 'src_test', 'src_install',
-   'pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm',
-   'pkg_config')))
-   in_phase = ''
-
-   def check(self, num, line):
-   m = self.phases_re.match(line)
-   if m is not None:
-   self.in_phase = m.group(1)
-   if self.in_phase != '' and self.func_end_re.match(line) is not 
None:
-   self.in_phase = ''
-
-   return self.phase_check(num, line)
-
-   def phase_check(self, num, line):
-   """ override this function for your checks """
-   pass
-
-
-class EbuildHeader(LineCheck):
-   """Ensure ebuilds have proper headers
-   Copyright header errors
-   CVS header errors
-   License header errors
-
-   Args:
-   modification_year - Year the ebuild was last modified
-   """
-
-   repoman_check_name = 'ebuild.badheader'
-
-   gentoo_copyright = r'^# Copyright ((1999|2\d\d\d)-)?%s Gentoo 
Foundation$'
-   gentoo_license = (
-   '# Distributed under the terms'
-   ' of the GNU General Public License v2')
-   id_header_re = re.compile(r'.*\$(Id|Header)(:.*)?\$.*')
-   blank_line_re = re.compile(r'^$')
-   ignore_comment = False
-
-   def new(self, pkg):
-   if pkg.mtime is None:
-   self.modification_year = r'2\d\d\d'
-   else:
-   self.modification_year = str(time.gmtime(pkg.mtime)[0])
-   self.gentoo_copyright_re = re.compile(
-   self.gentoo_copyright % self.modification_year)
-
-   def check(self, num, line):
-   if num > 2:
-   return
-   elif num == 0:
-   if not self.gentoo_copyright_re.match(line):
-   return errors.COPYRIGHT_ERROR
-   elif num == 1 and line.rstrip('\n') != self.gentoo_license:
-   return errors.LICENSE_ERROR
-   elif num == 2 and self.id_header_re.match(line):
-   return errors.ID_HEADER_ERROR
-   elif num == 2 and not self.blank_line_re.match(line):
-   return errors.NO_BLANK_LINE_ERROR
-
-
-class EbuildWhitespace(LineCheck):
-   """Ensure ebuilds have proper whitespacing"""
-
-   repoman_check_name = 'ebuild.minorsyn'
-
-   ignore_line = 

[gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/linechecks/nested/

2018-03-29 Thread Zac Medico
commit: 4a63297643accd75971622000f15613200501081
Author: Brian Dolbec  gentoo  org>
AuthorDate: Sat Jul 15 01:02:24 2017 +
Commit: Zac Medico  gentoo  org>
CommitDate: Fri Mar 30 03:51:18 2018 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=4a632976

repoman: New linechecks module, nested

 .../repoman/modules/linechecks/nested/__init__.py   | 21 +
 .../pym/repoman/modules/linechecks/nested/nested.py | 15 +++
 .../repoman/modules/linechecks/nested/nesteddie.py  | 11 +++
 3 files changed, 47 insertions(+)

diff --git a/repoman/pym/repoman/modules/linechecks/nested/__init__.py 
b/repoman/pym/repoman/modules/linechecks/nested/__init__.py
new file mode 100644
index 0..8eeeccbac
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/nested/__init__.py
@@ -0,0 +1,21 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Nested plug-in module for repoman LineChecks.
+Performs nested subshell checks on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+   'name': 'do',
+   'description': doc,
+   'provides':{
+   'nesteddie-check': {
+   'name': "nesteddie",
+   'sourcefile': "nested",
+   'class': "EbuildNestedDie",
+   'description': doc,
+   },
+   }
+}
+

diff --git a/repoman/pym/repoman/modules/linechecks/nested/nested.py 
b/repoman/pym/repoman/modules/linechecks/nested/nested.py
new file mode 100644
index 0..06b272772
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/nested/nested.py
@@ -0,0 +1,15 @@
+
+import re
+
+from repoman.modules.linechecks.base import LineCheck
+
+
+class EbuildNestedDie(LineCheck):
+   """Check ebuild for nested die statements (die statements in 
subshells)"""
+
+   repoman_check_name = 'ebuild.nesteddie'
+   nesteddie_re = re.compile(r'^[^#]*\s\(\s[^)]*\bdie\b')
+
+   def check(self, num, line):
+   if self.nesteddie_re.match(line):
+   return self.errors['NESTED_DIE_ERROR']

diff --git a/repoman/pym/repoman/modules/linechecks/nested/nesteddie.py 
b/repoman/pym/repoman/modules/linechecks/nested/nesteddie.py
new file mode 100644
index 0..6c1e4be9f
--- /dev/null
+++ b/repoman/pym/repoman/modules/linechecks/nested/nesteddie.py
@@ -0,0 +1,11 @@
+
+
+class EbuildNestedDie(LineCheck):
+   """Check ebuild for nested die statements (die statements in 
subshells)"""
+
+   repoman_check_name = 'ebuild.nesteddie'
+   nesteddie_re = re.compile(r'^[^#]*\s\(\s[^)]*\bdie\b')
+
+   def check(self, num, line):
+   if self.nesteddie_re.match(line):
+   return errors.NESTED_DIE_ERROR



  1   2   >