* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2018-08-16 20:05 Michał Górny
0 siblings, 0 replies; 15+ messages in thread
From: Michał Górny @ 2018-08-16 20:05 UTC (permalink / raw
To: gentoo-commits
commit: a0d10b164038c4ef172039f5d281240c48d3611f
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 16 17:06:12 2018 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Aug 16 20:05:10 2018 +0000
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 <zmedico <AT> 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)
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2018-09-22 9:44 Zac Medico
0 siblings, 0 replies; 15+ messages in thread
From: Zac Medico @ 2018-09-22 9:44 UTC (permalink / raw
To: gentoo-commits
commit: 4ff4e4200b984a88109b10de9e82b20451751aee
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 20 20:35:42 2018 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 22 08:23:14 2018 +0000
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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2018-09-30 20:38 Mike Gilbert
0 siblings, 0 replies; 15+ messages in thread
From: Mike Gilbert @ 2018-09-30 20:38 UTC (permalink / raw
To: gentoo-commits
commit: 4220ac560490c485a00fe05e5adc020cc713d3d9
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 30 16:11:44 2018 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Sep 30 20:37:59 2018 +0000
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 <floppym <AT> 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)
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2018-09-30 20:38 Mike Gilbert
0 siblings, 0 replies; 15+ messages in thread
From: Mike Gilbert @ 2018-09-30 20:38 UTC (permalink / raw
To: gentoo-commits
commit: 13731576aa6e5b118ff8d1e64214982e66b9c5ad
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 30 16:14:59 2018 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Sep 30 20:37:59 2018 +0000
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 <floppym <AT> 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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2018-10-27 23:39 Zac Medico
0 siblings, 0 replies; 15+ messages in thread
From: Zac Medico @ 2018-10-27 23:39 UTC (permalink / raw
To: gentoo-commits
commit: 1e31e93f99f1e6bc42517d0967e3e61f20edbc91
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 27 23:32:51 2018 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 27 23:35:54 2018 +0000
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 <zmedico <AT> 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()
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2019-05-26 4:29 Zac Medico
0 siblings, 0 replies; 15+ messages in thread
From: Zac Medico @ 2019-05-26 4:29 UTC (permalink / raw
To: gentoo-commits
commit: 26edaf8f93326085928dbd3c0606b80062b1ce6a
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May 25 22:35:45 2019 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May 25 22:43:01 2019 +0000
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 <zmedico <AT> 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'
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2019-12-03 23:07 Zac Medico
0 siblings, 0 replies; 15+ messages in thread
From: Zac Medico @ 2019-12-03 23:07 UTC (permalink / raw
To: gentoo-commits
commit: a561ac910331657ffb281ca2b16bb1c8d075770e
Author: Zac Medico <zachary.medico <AT> sony <DOT> com>
AuthorDate: Tue Dec 3 22:59:17 2019 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec 3 23:07:26 2019 +0000
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 <zmedico <AT> 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]
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2019-12-03 23:18 Zac Medico
0 siblings, 0 replies; 15+ messages in thread
From: Zac Medico @ 2019-12-03 23:18 UTC (permalink / raw
To: gentoo-commits
commit: 1c2e99fbf21675c8335ab8a3eee0ed58e89c4342
Author: Zac Medico <zachary.medico <AT> sony <DOT> com>
AuthorDate: Tue Dec 3 23:14:54 2019 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec 3 23:18:02 2019 +0000
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 <zmedico <AT> 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.
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2020-03-23 22:02 Zac Medico
0 siblings, 0 replies; 15+ messages in thread
From: Zac Medico @ 2020-03-23 22:02 UTC (permalink / raw
To: gentoo-commits
commit: 1bdff51e2b217a0b69a9195430487bc75a7fbe63
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 23 21:58:43 2020 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 23 22:01:32 2020 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1bdff51e
repoman: fetch_metadata_xsd: use fetch function
Signed-off-by: Zac Medico <zmedico <AT> 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 >= 0x3000000:
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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2020-08-15 23:56 Zac Medico
0 siblings, 0 replies; 15+ messages in thread
From: Zac Medico @ 2020-08-15 23:56 UTC (permalink / raw
To: gentoo-commits
commit: a6f90ba17202518ab0c976a32cb216a8e719f8fa
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 15 23:55:50 2020 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Aug 15 23:56:01 2020 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a6f90ba1
repoman/lib/repoman/scanner.py: Fix useless-return
Signed-off-by: Zac Medico <zmedico <AT> 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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2020-08-16 0:43 Zac Medico
0 siblings, 0 replies; 15+ messages in thread
From: Zac Medico @ 2020-08-16 0:43 UTC (permalink / raw
To: gentoo-commits
commit: 164efc2db431e8052597c40cd17e3c38e24a7f8f
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 16 00:37:17 2020 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Aug 16 00:42:15 2020 +0000
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 <zmedico <AT> 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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2021-03-28 18:48 Zac Medico
0 siblings, 0 replies; 15+ messages in thread
From: Zac Medico @ 2021-03-28 18:48 UTC (permalink / raw
To: gentoo-commits
commit: 3d7ed631ecc2f4f75beab3d6d17b75d6fc0ecd3c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 28 15:43:54 2021 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 28 18:42:07 2021 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3d7ed631
repoman: split up repoman_main
Signed-off-by: Zac Medico <zmedico <AT> 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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2021-03-28 22:59 Zac Medico
0 siblings, 0 replies; 15+ messages in thread
From: Zac Medico @ 2021-03-28 22:59 UTC (permalink / raw
To: gentoo-commits
commit: 050592ba4be9eac4af714a8c34f9f89984962b28
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 28 22:54:48 2021 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 28 22:58:18 2021 +0000
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 <zmedico <AT> 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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2021-03-31 6:28 Zac Medico
0 siblings, 0 replies; 15+ messages in thread
From: Zac Medico @ 2021-03-31 6:28 UTC (permalink / raw
To: gentoo-commits
commit: 3964690033e37c097b7ba2e207c0962144761757
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 31 06:25:04 2021 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 31 06:26:56 2021 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=39646900
repoman: correct parse_args local sys.argv reference
Signed-off-by: Zac Medico <zmedico <AT> 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:
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/
@ 2021-03-31 6:34 Zac Medico
0 siblings, 0 replies; 15+ messages in thread
From: Zac Medico @ 2021-03-31 6:34 UTC (permalink / raw
To: gentoo-commits
commit: 1b0cbed41a380e9603b12b1f1dec1e6dd42a8aeb
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 31 06:33:04 2021 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 31 06:33:32 2021 +0000
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 <zmedico <AT> 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
^ permalink raw reply related [flat|nested] 15+ messages in thread
end of thread, other threads:[~2021-03-31 6:34 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-15 23:56 [gentoo-commits] proj/portage:master commit in: repoman/lib/repoman/ Zac Medico
-- strict thread matches above, loose matches on Subject: below --
2021-03-31 6:34 Zac Medico
2021-03-31 6:28 Zac Medico
2021-03-28 22:59 Zac Medico
2021-03-28 18:48 Zac Medico
2020-08-16 0:43 Zac Medico
2020-03-23 22:02 Zac Medico
2019-12-03 23:18 Zac Medico
2019-12-03 23:07 Zac Medico
2019-05-26 4:29 Zac Medico
2018-10-27 23:39 Zac Medico
2018-09-30 20:38 Mike Gilbert
2018-09-30 20:38 Mike Gilbert
2018-09-22 9:44 Zac Medico
2018-08-16 20:05 Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox