* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2016-03-10 22:39 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2016-03-10 22:39 UTC (permalink / raw
To: gentoo-commits
commit: 50375654bfd565e9ea143d379f711e3a6c2eb167
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 10 16:11:51 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Mar 10 20:58:15 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=50375654
repoman: Make the output quiet when options.quiet=True (bug 576958)
In some cases do not output anything.
In some cases, output a simplified error message
X-Gentoo-bug: 576958
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=576958
pym/repoman/actions.py | 29 ++++++++++++++++++++---------
pym/repoman/scanner.py | 2 +-
2 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index f461703..4f3f195 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -57,7 +57,8 @@ class Actions(object):
def inform(self, can_force, result):
'''Inform the user of all the problems found'''
- if self.suggest['ignore_masked'] or self.suggest['include_dev']:
+ if ((self.suggest['ignore_masked'] or self.suggest['include_dev'])
+ and not self.options.quiet):
self._suggest()
if self.options.mode != 'commit':
self._non_commit(result)
@@ -199,6 +200,8 @@ class Actions(object):
self.add_manifest(mymanifests, myheaders, myupdates, myremoved, commitmessage)
+ if self.options.quiet:
+ return
print()
if self.vcs_settings.vcs:
print("Commit complete.")
@@ -230,17 +233,25 @@ class Actions(object):
if result['full']:
print(bold("Note: type \"repoman full\" for a complete listing."))
if result['warn'] and not result['fail']:
- utilities.repoman_sez(
- "\"You're only giving me a partial QA payment?\n"
- " I'll take it this time, but I'm not happy.\"")
+ if self.options.quiet:
+ print(bold("Non-Fatal QA errors found"))
+ else:
+ utilities.repoman_sez(
+ "\"You're only giving me a partial QA payment?\n"
+ " I'll take it this time, but I'm not happy.\""
+ )
elif not result['fail']:
- utilities.repoman_sez(
- "\"If everyone were like you, I'd be out of business!\"")
+ if self.options.quiet:
+ print("No QA issues found")
+ else:
+ utilities.repoman_sez(
+ "\"If everyone were like you, I'd be out of business!\"")
elif result['fail']:
print(bad("Please fix these important QA issues first."))
- utilities.repoman_sez(
- "\"Make your QA payment on time"
- " and you'll never see the likes of me.\"\n")
+ if not self.options.quiet:
+ utilities.repoman_sez(
+ "\"Make your QA payment on time"
+ " and you'll never see the likes of me.\"\n")
sys.exit(1)
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 84dbdf2..36248cb 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -163,7 +163,7 @@ class Scanner(object):
self.vcs_settings.vcs_is_cvs_or_svn = self.vcs_settings.vcs in ('cvs', 'svn')
self.check['changelog'] = not is_echangelog_enabled and self.vcs_settings.vcs_is_cvs_or_svn
- if self.options.mode == "manifest":
+ if self.options.mode == "manifest" or self.options.quiet:
pass
elif self.options.pretend:
print(green("\nRepoMan does a once-over of the neighborhood..."))
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2016-04-29 17:24 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2016-04-29 17:24 UTC (permalink / raw
To: gentoo-commits
commit: 5cb92a836ed539b7dd5952b7404b5c7f473b844a
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 27 03:22:37 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Apr 28 14:50:41 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=5cb92a83
repoman/scanner.py: Clean up some debug prints
pym/repoman/scanner.py | 3 ---
1 file changed, 3 deletions(-)
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index f1a0231..e5e5717 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -260,17 +260,14 @@ class Scanner(object):
@param dynamic_data: dictionary
@param key: tuple of (dictionary-key, default-value)
'''
- #print("***", key, data)
if data[0] in ['Future', 'ExtendedFuture']:
if data[1] in ['UNSET']:
- #print("adding unset default")
dynamic_data[key] = ExtendedFuture()
else:
if data[1] in DATA_TYPES:
default = DATA_TYPES[data[1]]()
else:
default = data[1]
- #print("adding default:", default)
dynamic_data[key] = ExtendedFuture(default)
def scan_pkgs(self, can_force):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2016-04-29 17:24 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2016-04-29 17:24 UTC (permalink / raw
To: gentoo-commits
commit: dc684ee6e4b1f0b8bef7babdf13a1143046c87c5
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 27 03:20:45 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Apr 28 14:50:41 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=dc684ee6
repoman/scanner.py: Mark self.ext_futures private
pym/repoman/scanner.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index a5c54b1..f1a0231 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -200,7 +200,7 @@ class Scanner(object):
}
# initialize the plugin checks here
self.modules = {}
- self.ext_futures = {}
+ self._ext_futures = {}
self.pkg_level_futures = None
def set_kwargs(self, mod):
@@ -232,10 +232,10 @@ class Scanner(object):
logging.debug("set_func_kwargs(); adding: %s, %s",
key, func_kwargs[key])
if func_kwargs[key][0] in ['Future', 'ExtendedFuture']:
- if key not in self.ext_futures:
+ if key not in self._ext_futures:
logging.debug(
"Adding a new key: %s to the ExtendedFuture dict", key)
- self.ext_futures[key] = func_kwargs[key]
+ self._ext_futures[key] = func_kwargs[key]
self._set_future(dynamic_data, key, func_kwargs[key])
else: # builtin python data type
dynamic_data[key] = DATA_TYPES[func_kwargs[key][0]]()
@@ -249,9 +249,9 @@ class Scanner(object):
@param dynamic_data: dictionary
'''
- for key in list(self.ext_futures):
+ for key in list(self._ext_futures):
if key not in self.pkg_level_futures:
- self._set_future(dynamic_data, key, self.ext_futures[key])
+ self._set_future(dynamic_data, key, self._ext_futures[key])
@staticmethod
def _set_future(dynamic_data, key, data):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2016-04-29 17:24 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2016-04-29 17:24 UTC (permalink / raw
To: gentoo-commits
commit: 67b7d60d949002ecf72a13dcda81e34362df8c2c
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 26 14:09:39 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Apr 26 14:09:39 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=67b7d60d
repoman, scanner.py: Remove a rebase error duplicate line.
pym/repoman/scanner.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 23d666d..6ded7ee 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -233,8 +233,6 @@ class Scanner(object):
for key in new:
logging.debug("set_func_kwargs(); adding: %s, %s",
key, func_kwargs[key])
- logging.debug("set_func_kwargs(); adding: %s, %s",
- key, func_kwargs[key])
if func_kwargs[key][0] in ['Future', 'ExtendedFuture']:
if key not in self.ext_futures:
logging.debug(
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2016-04-29 17:24 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2016-04-29 17:24 UTC (permalink / raw
To: gentoo-commits
commit: 8443e66ae5ffce5fb0daa73a3eeb0b18077ee942
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 26 18:07:48 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Apr 26 18:07:48 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=8443e66a
Scanner: remove self.pkgs attribute
pym/repoman/scanner.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 6ded7ee..d966513 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -179,8 +179,6 @@ class Scanner(object):
chain(self.changed.changed, self.changed.new, self.changed.removed),
self.repolevel, self.reposplit, self.categories))
- self.pkgs = None
-
# Create our kwargs dict here to initialize the plugins with
self.kwargs = {
"repo_settings": self.repo_settings,
@@ -348,8 +346,8 @@ class Scanner(object):
continue
# Sort ebuilds in ascending order for the KEYWORDS.dropped check.
- self.pkgs = dynamic_data['pkgs'].get()
- ebuildlist = sorted(self.pkgs.values())
+ pkgs = dynamic_data['pkgs'].get()
+ ebuildlist = sorted(pkgs.values())
ebuildlist = [pkg.pf for pkg in ebuildlist]
if self.checks['changelog'] and "ChangeLog" not in checkdirlist:
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
@ 2016-04-28 15:05 Brian Dolbec
2016-04-29 17:24 ` [gentoo-commits] proj/portage:master " Brian Dolbec
0 siblings, 1 reply; 123+ messages in thread
From: Brian Dolbec @ 2016-04-28 15:05 UTC (permalink / raw
To: gentoo-commits
commit: e5d298ccb05b630f17035f31a79c2fe55b90bf07
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 27 03:12:53 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Apr 28 14:48:47 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e5d298cc
repoman/scanner.py: Make some variables local instead of classwide
Some were not needed outside of __init__.
Some are included self.kwargs.
Several classwide variables repolevel, reposplit, categories are accessed
outside of the scanner class. So therefore can not be made local.
pym/repoman/scanner.py | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index d966513..a5c54b1 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -107,13 +107,13 @@ class Scanner(object):
self.repo_settings.repoman_settings['PORTAGE_ARCHLIST'] = ' '.join(sorted(kwlist))
self.repo_settings.repoman_settings.backup_changes('PORTAGE_ARCHLIST')
- self.profiles = setup_profile(profile_list)
+ profiles = setup_profile(profile_list)
- check_profiles(self.profiles, self.repo_settings.repoman_settings.archlist())
+ check_profiles(profiles, self.repo_settings.repoman_settings.archlist())
scanlist = scan(self.repolevel, self.reposplit, startdir, self.categories, self.repo_settings)
- self.dev_keywords = dev_profile_keywords(self.profiles)
+ self.dev_keywords = dev_profile_keywords(profiles)
self.qatracker = self.vcs_settings.qatracker
@@ -123,7 +123,7 @@ class Scanner(object):
if self.vcs_settings.vcs is None:
self.options.echangelog = 'n'
- self.checks = {}
+ checks = {}
# The --echangelog option causes automatic ChangeLog generation,
# which invalidates changelog.ebuildadded and changelog.missing
# checks.
@@ -135,7 +135,7 @@ class Scanner(object):
# TODO: shouldn't this just be switched on the repo, iso the VCS?
is_echangelog_enabled = self.options.echangelog in ('y', 'force')
self.vcs_settings.vcs_is_cvs_or_svn = self.vcs_settings.vcs in ('cvs', 'svn')
- self.checks['changelog'] = not is_echangelog_enabled and self.vcs_settings.vcs_is_cvs_or_svn
+ checks['changelog'] = not is_echangelog_enabled and self.vcs_settings.vcs_is_cvs_or_svn
if self.options.mode == "manifest" or self.options.quiet:
pass
@@ -170,7 +170,7 @@ class Scanner(object):
# Disable the "self.modules['Ebuild'].notadded" check when not in commit mode and
# running `svn status` in every package dir will be too expensive.
- self.checks['ebuild_notadded'] = not \
+ checks['ebuild_notadded'] = not \
(self.vcs_settings.vcs == "svn" and self.repolevel < 3 and self.options.mode != "commit")
self.effective_scanlist = scanlist
@@ -188,9 +188,9 @@ class Scanner(object):
"options": self.options,
"metadata_xsd": metadata_xsd,
"uselist": uselist,
- "checks": self.checks,
+ "checks": checks,
"repo_metadata": self.repo_metadata,
- "profiles": self.profiles,
+ "profiles": profiles,
"include_arches": self.include_arches,
"caches": self.caches,
"repoman_incrementals": self.repoman_incrementals,
@@ -291,7 +291,7 @@ class Scanner(object):
checkdirlist = os.listdir(checkdir)
# Run the status check
- if self.checks['ebuild_notadded']:
+ if self.kwargs['checks']['ebuild_notadded']:
self.vcs_settings.status.check(checkdir, checkdir_relative, xpkg)
dynamic_data = {
@@ -350,7 +350,7 @@ class Scanner(object):
ebuildlist = sorted(pkgs.values())
ebuildlist = [pkg.pf for pkg in ebuildlist]
- if self.checks['changelog'] and "ChangeLog" not in checkdirlist:
+ if self.kwargs['checks']['changelog'] and "ChangeLog" not in checkdirlist:
self.qatracker.add_error("changelog.missing", xpkg + "/ChangeLog")
changelog_path = os.path.join(checkdir_relative, "ChangeLog")
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
2016-04-28 15:05 [gentoo-commits] proj/portage:repoman " Brian Dolbec
@ 2016-04-29 17:24 ` Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2016-04-29 17:24 UTC (permalink / raw
To: gentoo-commits
commit: e5d298ccb05b630f17035f31a79c2fe55b90bf07
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 27 03:12:53 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Apr 28 14:48:47 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e5d298cc
repoman/scanner.py: Make some variables local instead of classwide
Some were not needed outside of __init__.
Some are included self.kwargs.
Several classwide variables repolevel, reposplit, categories are accessed
outside of the scanner class. So therefore can not be made local.
pym/repoman/scanner.py | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index d966513..a5c54b1 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -107,13 +107,13 @@ class Scanner(object):
self.repo_settings.repoman_settings['PORTAGE_ARCHLIST'] = ' '.join(sorted(kwlist))
self.repo_settings.repoman_settings.backup_changes('PORTAGE_ARCHLIST')
- self.profiles = setup_profile(profile_list)
+ profiles = setup_profile(profile_list)
- check_profiles(self.profiles, self.repo_settings.repoman_settings.archlist())
+ check_profiles(profiles, self.repo_settings.repoman_settings.archlist())
scanlist = scan(self.repolevel, self.reposplit, startdir, self.categories, self.repo_settings)
- self.dev_keywords = dev_profile_keywords(self.profiles)
+ self.dev_keywords = dev_profile_keywords(profiles)
self.qatracker = self.vcs_settings.qatracker
@@ -123,7 +123,7 @@ class Scanner(object):
if self.vcs_settings.vcs is None:
self.options.echangelog = 'n'
- self.checks = {}
+ checks = {}
# The --echangelog option causes automatic ChangeLog generation,
# which invalidates changelog.ebuildadded and changelog.missing
# checks.
@@ -135,7 +135,7 @@ class Scanner(object):
# TODO: shouldn't this just be switched on the repo, iso the VCS?
is_echangelog_enabled = self.options.echangelog in ('y', 'force')
self.vcs_settings.vcs_is_cvs_or_svn = self.vcs_settings.vcs in ('cvs', 'svn')
- self.checks['changelog'] = not is_echangelog_enabled and self.vcs_settings.vcs_is_cvs_or_svn
+ checks['changelog'] = not is_echangelog_enabled and self.vcs_settings.vcs_is_cvs_or_svn
if self.options.mode == "manifest" or self.options.quiet:
pass
@@ -170,7 +170,7 @@ class Scanner(object):
# Disable the "self.modules['Ebuild'].notadded" check when not in commit mode and
# running `svn status` in every package dir will be too expensive.
- self.checks['ebuild_notadded'] = not \
+ checks['ebuild_notadded'] = not \
(self.vcs_settings.vcs == "svn" and self.repolevel < 3 and self.options.mode != "commit")
self.effective_scanlist = scanlist
@@ -188,9 +188,9 @@ class Scanner(object):
"options": self.options,
"metadata_xsd": metadata_xsd,
"uselist": uselist,
- "checks": self.checks,
+ "checks": checks,
"repo_metadata": self.repo_metadata,
- "profiles": self.profiles,
+ "profiles": profiles,
"include_arches": self.include_arches,
"caches": self.caches,
"repoman_incrementals": self.repoman_incrementals,
@@ -291,7 +291,7 @@ class Scanner(object):
checkdirlist = os.listdir(checkdir)
# Run the status check
- if self.checks['ebuild_notadded']:
+ if self.kwargs['checks']['ebuild_notadded']:
self.vcs_settings.status.check(checkdir, checkdir_relative, xpkg)
dynamic_data = {
@@ -350,7 +350,7 @@ class Scanner(object):
ebuildlist = sorted(pkgs.values())
ebuildlist = [pkg.pf for pkg in ebuildlist]
- if self.checks['changelog'] and "ChangeLog" not in checkdirlist:
+ if self.kwargs['checks']['changelog'] and "ChangeLog" not in checkdirlist:
self.qatracker.add_error("changelog.missing", xpkg + "/ChangeLog")
changelog_path = os.path.join(checkdir_relative, "ChangeLog")
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2016-01-30 16:44 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2016-01-30 16:44 UTC (permalink / raw
To: gentoo-commits
commit: 514a4cf4426721eedf482047b0dc0b56fa2e71ca
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 30 16:40:05 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jan 30 16:40:31 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=514a4cf4
repoman: Fix commit af88402104c logic for the rewrite code
The logic was opposite for what the new code needed.
The original code skipped the scan for that logic, this code does the scan.
X-Gentoo-Bug: 540882
Commit: af88402104c90e99ab40bff956f58395ea362a6e
Author: Brian Dolbec <dolsen <AT> gentoo.org> (Wed 27 Jan 2016 12:32:47 PM PST)
Subject: repoman: Re-add an if that bypasses the changes scan (bug 540882)
pym/repoman/scanner.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 04d8b29..84dbdf2 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -172,8 +172,8 @@ class Scanner(object):
self.changed = Changes(self.options)
# bypass unneeded VCS operations if not needed
- if (self.options.if_modified != "y" and
- self.options.mode in ("manifest", "manifest-check")):
+ if (self.options.if_modified == "y" or
+ self.options.mode not in ("manifest", "manifest-check")):
self.changed.scan(self.vcs_settings)
self.have = {
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2016-01-29 23:04 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2016-01-29 23:04 UTC (permalink / raw
To: gentoo-commits
commit: af88402104c90e99ab40bff956f58395ea362a6e
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 27 20:32:47 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Jan 29 23:02:56 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=af884021
repoman: Re-add an if that bypasses the changes scan (bug 540882)
This if is neded to prevent unnecessary VCS operations which is a big slowdown for
large repositories.
X-Gentoo-Bug: 540882
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=540882
pym/repoman/scanner.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index d1c10d7..04d8b29 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -171,7 +171,10 @@ class Scanner(object):
print(green("\nRepoMan scours the neighborhood..."))
self.changed = Changes(self.options)
- self.changed.scan(self.vcs_settings)
+ # bypass unneeded VCS operations if not needed
+ if (self.options.if_modified != "y" and
+ self.options.mode in ("manifest", "manifest-check")):
+ self.changed.scan(self.vcs_settings)
self.have = {
'pmasked': False,
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2016-01-29 5:34 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2016-01-29 5:34 UTC (permalink / raw
To: gentoo-commits
commit: ac6eab129ec0aea4d5cd27d3a3606ad9df774af6
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 27 20:32:47 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Jan 29 05:33:10 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ac6eab12
repoman: Re-add an if that bypasses the changes scan (bug 540882)
This if is neded to prevent unnecessary VCS operations which is a big slowdown for
large repositories.
X-Gentoo-Bug: 540882
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=540882
pym/repoman/scanner.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index d1c10d7..04d8b29 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -171,7 +171,10 @@ class Scanner(object):
print(green("\nRepoMan scours the neighborhood..."))
self.changed = Changes(self.options)
- self.changed.scan(self.vcs_settings)
+ # bypass unneeded VCS operations if not needed
+ if (self.options.if_modified != "y" and
+ self.options.mode in ("manifest", "manifest-check")):
+ self.changed.scan(self.vcs_settings)
self.have = {
'pmasked': False,
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2016-01-27 20:39 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2016-01-27 20:39 UTC (permalink / raw
To: gentoo-commits
commit: 1e8f007ab878509cf54a339dd4d9b7037a85593e
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 27 20:32:47 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Jan 27 20:34:39 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1e8f007a
repoman: Re-add an if that bypasses the chnanges scan (bug 540882)
This if is neded to prevent unnecessary VCS operations which is a big slowdown for
large repositories.
X-Gentoo-Bug: 540882
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=540882
pym/repoman/scanner.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index d1c10d7..04d8b29 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -171,7 +171,10 @@ class Scanner(object):
print(green("\nRepoMan scours the neighborhood..."))
self.changed = Changes(self.options)
- self.changed.scan(self.vcs_settings)
+ # bypass unneeded VCS operations if not needed
+ if (self.options.if_modified != "y" and
+ self.options.mode in ("manifest", "manifest-check")):
+ self.changed.scan(self.vcs_settings)
self.have = {
'pmasked': False,
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-12-29 20:29 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2015-12-29 20:29 UTC (permalink / raw
To: gentoo-commits
commit: 87e32d4863f3f72ace3fc123b04a0e6f5ff96799
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 28 02:09:34 2015 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec 29 20:27:41 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=87e32d48
repoman: fix KeyError triggered by fetch failure during manifest generation (bug 569942)
Fix Scanner not to override portdbapi._aux_cache_keys when generating
manifests, since spawn_nofetch requires additional keys.
Fixes: 39d81c514c33 ("[...]config.__getitem__(): Partially drop backward compatibility for nonexistent keys.")
X-Gentoo-Bug: 569942
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=569942
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
pym/repoman/scanner.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 9a87f65..d1c10d7 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -93,9 +93,13 @@ class Scanner(object):
self.portdb.settings = self.repo_settings.repoman_settings
# We really only need to cache the metadata that's necessary for visibility
# filtering. Anything else can be discarded to reduce memory consumption.
- self.portdb._aux_cache_keys.clear()
- self.portdb._aux_cache_keys.update(
- ["EAPI", "IUSE", "KEYWORDS", "repository", "SLOT"])
+ if self.options.mode != "manifest" and self.options.digest != "y":
+ # Don't do this when generating manifests, since that uses
+ # additional keys if spawn_nofetch is called (RESTRICT and
+ # DEFINED_PHASES).
+ self.portdb._aux_cache_keys.clear()
+ self.portdb._aux_cache_keys.update(
+ ["EAPI", "IUSE", "KEYWORDS", "repository", "SLOT"])
self.reposplit = myreporoot.split(os.path.sep)
self.repolevel = len(self.reposplit)
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-12-24 14:30 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-12-24 14:30 UTC (permalink / raw
To: gentoo-commits
commit: be57961c1115cf4281a00503fa6a9711f474c38a
Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 24 14:27:12 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Dec 24 14:27:12 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=be57961c
Add a deprecation warning for ruby 1.9
Ruby 1.9 was package masked and will be removed soon.
Let's extend repoman's deprecation warning to it.
Applied from github pull request #17.
pym/repoman/qa_data.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/pym/repoman/qa_data.py b/pym/repoman/qa_data.py
index df9b836..b9475e8 100644
--- a/pym/repoman/qa_data.py
+++ b/pym/repoman/qa_data.py
@@ -343,6 +343,7 @@ suspect_virtual = {
ruby_deprecated = frozenset([
"ruby_targets_ree18",
"ruby_targets_ruby18",
+ "ruby_targets_ruby19",
])
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-10-13 16:27 Michał Górny
0 siblings, 0 replies; 123+ messages in thread
From: Michał Górny @ 2015-10-13 16:27 UTC (permalink / raw
To: gentoo-commits
commit: 47058bba9d8669118d6301ef4b48a0a8f3850477
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 12 07:48:00 2015 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Oct 13 16:26:39 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=47058bba
repoman: Set max DESCRIPTION length to 80, #562808
Correct the max DESCRIPTION length in qa_data, and remove the comment
confusingly suggesting that the variable name is taken into the count.
Bug: https://bugs.gentoo.org/show_bug.cgi?id=562808
Acked-by: Zac Medico <zmedico <AT> gentoo.org>
pym/repoman/qa_data.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pym/repoman/qa_data.py b/pym/repoman/qa_data.py
index dddfb98..df9b836 100644
--- a/pym/repoman/qa_data.py
+++ b/pym/repoman/qa_data.py
@@ -7,8 +7,7 @@ from _emerge.Package import Package
# import our initialized portage instance
from repoman._portage import portage
-# 14 is the length of DESCRIPTION=""
-max_desc_len = 100
+max_desc_len = 80
allowed_filename_chars = "a-zA-Z0-9._-+:"
qahelp = {
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-10-07 23:22 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-10-07 23:22 UTC (permalink / raw
To: gentoo-commits
commit: edd7a7e2fd16cb1d8ba6fbd05c5dee21966a920f
Author: Tom Daff <tdd20 <AT> cam <DOT> ac <DOT> uk>
AuthorDate: Mon Oct 5 15:31:10 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Oct 7 23:18:49 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=edd7a7e2
repoman: fix del of out of scope name in hg_scan
pym/repoman/scan.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pym/repoman/scan.py b/pym/repoman/scan.py
index 28dfa15..0b74efd 100644
--- a/pym/repoman/scan.py
+++ b/pym/repoman/scan.py
@@ -168,4 +168,5 @@ class Changes(object):
with repoman_popen("hg status --no-status --removed .") as f:
removed = f.readlines()
self.removed = ["./" + elem.rstrip() for elem in removed]
- del changed, new, removed
+ del removed
+ del changed, new
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-10-07 23:09 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-10-07 23:09 UTC (permalink / raw
To: gentoo-commits
commit: 3f7858731cbdd03298831df7e44b774b5fbcc541
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 7 23:04:14 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Oct 7 23:08:08 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3f785873
scanner.py: Fix options.output_style for column output (bug 534022)
Ever since commit: 310c548e708f72ba25d66a423b679b24888ed863
the column format output has broken machine readable or grep output.
This patch selectively applies the newlines and pformat of the atoms.
pym/repoman/scanner.py | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 0194017..df46144 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -689,15 +689,27 @@ class Scanner(object):
# if we emptied out our list, continue:
if not atoms:
continue
+ if self.options.output_style in ['column']:
+ self.qatracker.add_error(mykey,
+ "%s: %s: %s(%s) %s"
+ % (ebuild.relative_path, mytype, keyword,
+ prof, repr(atoms)))
+ else:
+ self.qatracker.add_error(mykey,
+ "%s: %s: %s(%s)\n%s"
+ % (ebuild.relative_path, mytype, keyword,
+ prof, pformat(atoms, indent=6)))
+ else:
+ if self.options.output_style in ['column']:
+ self.qatracker.add_error(mykey,
+ "%s: %s: %s(%s) %s"
+ % (ebuild.relative_path, mytype, keyword,
+ prof, repr(atoms)))
+ else:
self.qatracker.add_error(mykey,
"%s: %s: %s(%s)\n%s"
- % (ebuild.relative_path, mytype, keyword, prof,
- pformat(atoms, indent=6)))
- else:
- self.qatracker.add_error(mykey,
- "%s: %s: %s(%s)\n%s"
- % (ebuild.relative_path, mytype, keyword, prof,
- pformat(atoms, indent=6)))
+ % (ebuild.relative_path, mytype, keyword,
+ prof, pformat(atoms, indent=6)))
if not baddepsyntax and unknown_pkgs:
type_map = {}
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-10-04 21:15 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-10-04 21:15 UTC (permalink / raw
To: gentoo-commits
commit: b83c5e476dc69780ff66c0b252ee2e34830cd98d
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 3 17:14:11 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Oct 4 21:14:21 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=b83c5e47
repoman/argparser.py: _unicode_decode the commitmsg (bug 562108)
Force utf-8 for the comit message to prevent a possible traceback.
X-Gentoo-bug: 562108
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=562108
pym/repoman/argparser.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pym/repoman/argparser.py b/pym/repoman/argparser.py
index 85e261d..0f34ed0 100644
--- a/pym/repoman/argparser.py
+++ b/pym/repoman/argparser.py
@@ -1,4 +1,3 @@
-# -*- coding:utf-8 -*-
# repoman: Argument parser
# Copyright 2007-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
@@ -11,6 +10,7 @@ import sys
# import our initialized portage instance
from repoman._portage import portage
+from portage import _unicode_decode
from portage import util
from portage.util._argparse import ArgumentParser
@@ -211,6 +211,9 @@ def parse_args(argv, qahelp, repoman_default_opts):
logger = logging.getLogger()
logger.setLevel(logger.getEffectiveLevel() + 10)
+ if opts.mode == 'commit' and opts.commitmsg:
+ opts.commitmsg = _unicode_decode(opts.commitmsg)
+
if opts.mode == 'commit' and not (opts.force or opts.pretend):
if opts.ignore_masked:
opts.ignore_masked = False
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-09-26 20:53 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-26 20:53 UTC (permalink / raw
To: gentoo-commits
commit: 1c9ab10ca10839b6c6ad5dcd2a3b9b6f0e95bfd9
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 26 20:45:46 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Sep 26 20:51:32 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1c9ab10c
repoman/actions.py: Fix typo in function call (bug 561596)
X-Gentoo-bug: 561596
X-Gentoo-bug-url: https://bugs.gentoo.org/561596
Title: sys-apps/portage-2.2.22: repoman fails to sign commit/manifest
pym/repoman/actions.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 5462248..0806cb5 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -172,7 +172,7 @@ class Actions(object):
digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
if self.repo_settings.sign_manifests:
- self.sign_manifests(myupdates, myremoved, mymanifests)
+ self.sign_manifest(myupdates, myremoved, mymanifests)
if self.vcs_settings.vcs == 'git':
# It's not safe to use the git commit -a option since there might
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-09-26 20:53 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-26 20:53 UTC (permalink / raw
To: gentoo-commits
commit: 9f978b5c60fe40034ddc4d14abb69238fd60e3c5
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 25 17:52:36 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Sep 26 20:51:32 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9f978b5c
repoman/repos.py: Add check that we need commit signing (bug 561474)
Side effect of the code splitting, repoman full in a non -vcs repo directory was reporting the inability to sign warning.
X-Gentoo-bug: 561474
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=561474
Title: repoman: spews useless warning about commit while running 'full'
pym/repoman/repos.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pym/repoman/repos.py b/pym/repoman/repos.py
index f16bf7a..72e5735 100644
--- a/pym/repoman/repos.py
+++ b/pym/repoman/repos.py
@@ -60,7 +60,7 @@ class RepoSettings(object):
if self.repo_config.allow_provide_virtual:
qawarnings.add("virtual.oldstyle")
- if self.repo_config.sign_commit:
+ if self.repo_config.sign_commit and options.mode in ("commit", "fix", "manifest"):
if vcs_settings.vcs:
func = getattr(self, '_vcs_gpg_%s' % vcs_settings.vcs)
func()
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-09-26 20:49 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-26 20:49 UTC (permalink / raw
To: gentoo-commits
commit: 193803975a2cacdb216be099bab47f007a8762de
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 25 17:52:36 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Sep 25 17:52:36 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=19380397
repoman/repos.py: Add check that we need commit signing (bug 561474)
Side effect of the code splitting, repoman full in a non -vcs repo directory was reporting the inability to sign warning.
X-Gentoo-bug: 561474
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=561474
Title: repoman: spews useless warning about commit while running 'full'
pym/repoman/repos.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pym/repoman/repos.py b/pym/repoman/repos.py
index f16bf7a..72e5735 100644
--- a/pym/repoman/repos.py
+++ b/pym/repoman/repos.py
@@ -60,7 +60,7 @@ class RepoSettings(object):
if self.repo_config.allow_provide_virtual:
qawarnings.add("virtual.oldstyle")
- if self.repo_config.sign_commit:
+ if self.repo_config.sign_commit and options.mode in ("commit", "fix", "manifest"):
if vcs_settings.vcs:
func = getattr(self, '_vcs_gpg_%s' % vcs_settings.vcs)
func()
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-09-26 20:49 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-26 20:49 UTC (permalink / raw
To: gentoo-commits
commit: 39de2e620401e0d007d47ad5dbe545197c1ab1bc
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 26 20:45:46 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Sep 26 20:45:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=39de2e62
repoman/actions.py: Fix typo in function call (bug 561596)
X-Gentoo-bug: 561596
X-Gentoo-bug-url: https://bugs.gentoo.org/561596
Title: sys-apps/portage-2.2.22: repoman fails to sign commit/manifest
pym/repoman/actions.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 5462248..0806cb5 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -172,7 +172,7 @@ class Actions(object):
digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
if self.repo_settings.sign_manifests:
- self.sign_manifests(myupdates, myremoved, mymanifests)
+ self.sign_manifest(myupdates, myremoved, mymanifests)
if self.vcs_settings.vcs == 'git':
# It's not safe to use the git commit -a option since there might
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-09-24 16:19 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-24 16:19 UTC (permalink / raw
To: gentoo-commits
commit: 548265bd0b9e3890ad030e57fccc33e240f62e7b
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 24 16:18:45 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 24 16:18:45 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=548265bd
repoman/qa_data.py: Update docstrings
pym/repoman/qa_data.py | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/pym/repoman/qa_data.py b/pym/repoman/qa_data.py
index a68a53f..b26559c 100644
--- a/pym/repoman/qa_data.py
+++ b/pym/repoman/qa_data.py
@@ -354,14 +354,19 @@ def format_qa_output(
formatter, fails, dofull, dofail, options, qawarnings):
"""Helper function that formats output properly
- Args:
- formatter - a subclass of Formatter
- fails - a dict of qa status failures
- dofull - boolean to print full results or a summary
- dofail - boolean to decide if failure was hard or soft
-
- Returns:
- None (modifies formatter)
+ @param formatter: an instance of Formatter
+ @type formatter: Formatter
+ @param fails: dict of qa status failures
+ @type fails: dict
+ @param dofull: Whether to print full results or a summary
+ @type dofull: boolean
+ @param dofail: Whether failure was hard or soft
+ @type dofail: boolean
+ @param options: The command-line options provided to repoman
+ @type options: Namespace
+ @param qawarnings: the set of warning types
+ @type qawarnings: set
+ @return: None (modifies formatter)
"""
full = options.mode == 'full'
# we only want key value pairs where value > 0
@@ -398,8 +403,6 @@ def format_qa_output_column(
@param formatter: an instance of Formatter
@type formatter: Formatter
- @param path: dict of qa status items
- @type path: dict
@param fails: dict of qa status failures
@type fails: dict
@param dofull: Whether to print full results or a summary
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-09-24 16:19 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-24 16:19 UTC (permalink / raw
To: gentoo-commits
commit: 8f03fb3708bc3e1f2c0f7f3b1ba7832e415b09c9
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 24 16:18:04 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 24 16:18:04 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=8f03fb37
repoman/qa_data.py: Re-apply mgorny's "mark errors with explicit '[fatal']" patch
This patch was lost in the re-basing of the rewrite due to the code being moved to a new file.
Commit: 8482a88e8dfa3acf67d9bf4df4d3588ed993bb96
Author: Michał Górny <mgorny <AT> gentoo.org> (Tue 10 Feb 2015 03:38:07 AM PST)
Subject: repoman: mark errors with explicit '[fatal']
pym/repoman/qa_data.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/pym/repoman/qa_data.py b/pym/repoman/qa_data.py
index 461b064..a68a53f 100644
--- a/pym/repoman/qa_data.py
+++ b/pym/repoman/qa_data.py
@@ -367,11 +367,16 @@ def format_qa_output(
# we only want key value pairs where value > 0
for category in sorted(fails):
number = len(fails[category])
- formatter.add_literal_data(" " + category.ljust(30))
+ formatter.add_literal_data(" " + category)
+ spacing_width = 30 - len(category)
if category in qawarnings:
formatter.push_style("WARN")
else:
formatter.push_style("BAD")
+ formatter.add_literal_data(" [fatal]")
+ spacing_width -= 8
+
+ formatter.add_literal_data(" " * spacing_width)
formatter.add_literal_data("%s" % number)
formatter.pop_style()
formatter.add_line_break()
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-09-24 15:24 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-24 15:24 UTC (permalink / raw
To: gentoo-commits
commit: d37ad00e182a069b915f1666597a130956e139ad
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 24 15:14:53 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 24 15:23:10 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d37ad00e
repoman/actions.py: Adjust indent in thick_manifest()
pym/repoman/actions.py | 96 +++++++++++++++++++++++++-------------------------
1 file changed, 48 insertions(+), 48 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 9dda88e..5462248 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -726,55 +726,55 @@ class Actions(object):
def thick_manifest(self, myupdates, myheaders, no_expansion, expansion):
- if self.vcs_settings.vcs == 'cvs':
- headerstring = "'\$(Header|Id).*\$'"
+ if self.vcs_settings.vcs == 'cvs':
+ headerstring = "'\$(Header|Id).*\$'"
+ elif self.vcs_settings.vcs == "svn":
+ svn_keywords = dict((k.lower(), k) for k in [
+ "Rev",
+ "Revision",
+ "LastChangedRevision",
+ "Date",
+ "LastChangedDate",
+ "Author",
+ "LastChangedBy",
+ "URL",
+ "HeadURL",
+ "Id",
+ "Header",
+ ])
+
+ for myfile in myupdates:
+
+ # for CVS, no_expansion contains files that are excluded from expansion
+ if self.vcs_settings.vcs == "cvs":
+ if myfile in no_expansion:
+ continue
+
+ # for SVN, expansion contains files that are included in expansion
elif self.vcs_settings.vcs == "svn":
- svn_keywords = dict((k.lower(), k) for k in [
- "Rev",
- "Revision",
- "LastChangedRevision",
- "Date",
- "LastChangedDate",
- "Author",
- "LastChangedBy",
- "URL",
- "HeadURL",
- "Id",
- "Header",
- ])
-
- for myfile in myupdates:
-
- # for CVS, no_expansion contains files that are excluded from expansion
- if self.vcs_settings.vcs == "cvs":
- if myfile in no_expansion:
- continue
-
- # for SVN, expansion contains files that are included in expansion
- elif self.vcs_settings.vcs == "svn":
- if myfile not in expansion:
- continue
-
- # Subversion keywords are case-insensitive
- # in svn:keywords properties,
- # but case-sensitive in contents of files.
- enabled_keywords = []
- for k in expansion[myfile]:
- keyword = svn_keywords.get(k.lower())
- if keyword is not None:
- enabled_keywords.append(keyword)
-
- headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords)
-
- myout = repoman_getstatusoutput(
- "egrep -q %s %s" % (headerstring, portage._shell_quote(myfile)))
- if myout[0] == 0:
- myheaders.append(myfile)
-
- print("%s have headers that will change." % green(str(len(myheaders))))
- print(
- "* Files with headers will"
- " cause the manifests to be changed and committed separately.")
+ if myfile not in expansion:
+ continue
+
+ # Subversion keywords are case-insensitive
+ # in svn:keywords properties,
+ # but case-sensitive in contents of files.
+ enabled_keywords = []
+ for k in expansion[myfile]:
+ keyword = svn_keywords.get(k.lower())
+ if keyword is not None:
+ enabled_keywords.append(keyword)
+
+ headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords)
+
+ myout = repoman_getstatusoutput(
+ "egrep -q %s %s" % (headerstring, portage._shell_quote(myfile)))
+ if myout[0] == 0:
+ myheaders.append(myfile)
+
+ print("%s have headers that will change." % green(str(len(myheaders))))
+ print(
+ "* Files with headers will"
+ " cause the manifests to be changed and committed separately.")
def clear_attic(self, myheaders):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-09-21 23:51 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: befc99fa5ff79af530be6e3126a300e182866a2f
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 02:07:27 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=befc99fa
repoman/actions.py: Break out changes detectection into sudo vcs plugins
pym/repoman/actions.py | 215 +++++++++++++++++++++++++++----------------------
1 file changed, 120 insertions(+), 95 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 611c0dd..1f70815 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -74,102 +74,9 @@ class Actions(object):
self._vcs_deleted(mydeleted)
- if self.vcs_settings.vcs == "cvs":
- mycvstree = cvstree.getentries("./", recursive=1)
- mychanged = cvstree.findchanged(mycvstree, recursive=1, basedir="./")
- mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./")
- myremoved = portage.cvstree.findremoved(mycvstree, recursive=1, basedir="./")
- bin_blob_pattern = re.compile("^-kb$")
- no_expansion = set(portage.cvstree.findoption(
- mycvstree, bin_blob_pattern, recursive=1, basedir="./"))
-
- if self.vcs_settings.vcs == "svn":
- with repoman_popen("svn status") as f:
- svnstatus = f.readlines()
- mychanged = [
- "./" + elem.split()[-1:][0]
- for elem in svnstatus
- if (elem[:1] in "MR" or elem[1:2] in "M")]
- mynew = [
- "./" + elem.split()[-1:][0]
- for elem in svnstatus
- if elem.startswith("A")]
- myremoved = [
- "./" + elem.split()[-1:][0]
- for elem in svnstatus
- if elem.startswith("D")]
-
- # Subversion expands keywords specified in svn:keywords properties.
- with repoman_popen("svn propget -R svn:keywords") as f:
- props = f.readlines()
- expansion = dict(
- ("./" + prop.split(" - ")[0], prop.split(" - ")[1].split())
- for prop in props if " - " in prop)
-
- elif self.vcs_settings.vcs == "git":
- with repoman_popen(
- "git diff-index --name-only "
- "--relative --diff-filter=M HEAD") as f:
- mychanged = f.readlines()
- mychanged = ["./" + elem[:-1] for elem in mychanged]
-
- with repoman_popen(
- "git diff-index --name-only "
- "--relative --diff-filter=A HEAD") as f:
- mynew = f.readlines()
- mynew = ["./" + elem[:-1] for elem in mynew]
-
- with repoman_popen(
- "git diff-index --name-only "
- "--relative --diff-filter=D HEAD") as f:
- myremoved = f.readlines()
- myremoved = ["./" + elem[:-1] for elem in myremoved]
-
- if self.vcs_settings.vcs == "bzr":
- with repoman_popen("bzr status -S .") as f:
- bzrstatus = f.readlines()
- mychanged = [
- "./" + elem.split()[-1:][0].split('/')[-1:][0]
- for elem in bzrstatus
- if elem and elem[1:2] == "M"]
- mynew = [
- "./" + elem.split()[-1:][0].split('/')[-1:][0]
- for elem in bzrstatus
- if elem and (elem[1:2] in "NK" or elem[0:1] == "R")]
- myremoved = [
- "./" + elem.split()[-1:][0].split('/')[-1:][0]
- for elem in bzrstatus
- if elem.startswith("-")]
- myremoved = [
- "./" + elem.split()[-3:-2][0].split('/')[-1:][0]
- for elem in bzrstatus
- if elem and (elem[1:2] == "K" or elem[0:1] == "R")]
- # Bazaar expands nothing.
-
- if self.vcs_settings.vcs == "hg":
- with repoman_popen("hg status --no-status --modified .") as f:
- mychanged = f.readlines()
- mychanged = ["./" + elem.rstrip() for elem in mychanged]
-
- with repoman_popen("hg status --no-status --added .") as f:
- mynew = f.readlines()
- mynew = ["./" + elem.rstrip() for elem in mynew]
-
- with repoman_popen("hg status --no-status --removed .") as f:
- myremoved = f.readlines()
- myremoved = ["./" + elem.rstrip() for elem in myremoved]
+ changes = self.get_vcs_changed(mydeleted)
- if self.vcs_settings.vcs:
- a_file_is_changed = mychanged or mynew or myremoved
- a_file_is_deleted_hg = self.vcs_settings.vcs == "hg" and mydeleted
-
- if not (a_file_is_changed or a_file_is_deleted_hg):
- utilities.repoman_sez(
- "\"Doing nothing is not always good for QA.\"")
- print()
- print("(Didn't find any changed files...)")
- print()
- sys.exit(1)
+ mynew, mychanged, myremoved, no_expansion, expansion = changes
# Manifests need to be regenerated after all other commits, so don't commit
# them now even if they have changed.
@@ -772,3 +679,121 @@ class Actions(object):
print()
print()
sys.exit(1)
+
+
+ def get_vcs_changed(self, mydeleted):
+ '''Holding function which calls the approriate VCS module for the data'''
+ changed = ([], [], [], [], [])
+ if self.vcs_settings.vcs:
+ vcs_module = getattr(self, '_get_changed_%s_' % self.vcs_settings.vcs)
+ changed = vcs_module(mydeleted)
+ mynew, mychanged, myremoved, no_expansion, expansion = changed
+
+ a_file_is_changed = mychanged or mynew or myremoved
+ a_file_is_deleted_hg = self.vcs_settings.vcs == "hg" and mydeleted
+
+ if not (a_file_is_changed or a_file_is_deleted_hg):
+ utilities.repoman_sez(
+ "\"Doing nothing is not always good for QA.\"")
+ print()
+ print("(Didn't find any changed files...)")
+ print()
+ sys.exit(1)
+ return changed
+
+
+ def _get_changed_cvs_(self, mydeleted):
+ mycvstree = cvstree.getentries("./", recursive=1)
+ mychanged = cvstree.findchanged(mycvstree, recursive=1, basedir="./")
+ mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./")
+ myremoved = portage.cvstree.findremoved(mycvstree, recursive=1, basedir="./")
+ bin_blob_pattern = re.compile("^-kb$")
+ no_expansion = set(portage.cvstree.findoption(
+ mycvstree, bin_blob_pattern, recursive=1, basedir="./"))
+ expansion = {}
+ return (mynew, mychanged, myremoved, no_expansion, expansion)
+
+ def _get_changed_svn_(self, mydeleted):
+ with repoman_popen("svn status") as f:
+ svnstatus = f.readlines()
+ mychanged = [
+ "./" + elem.split()[-1:][0]
+ for elem in svnstatus
+ if (elem[:1] in "MR" or elem[1:2] in "M")]
+ mynew = [
+ "./" + elem.split()[-1:][0]
+ for elem in svnstatus
+ if elem.startswith("A")]
+ myremoved = [
+ "./" + elem.split()[-1:][0]
+ for elem in svnstatus
+ if elem.startswith("D")]
+ # Subversion expands keywords specified in svn:keywords properties.
+ with repoman_popen("svn propget -R svn:keywords") as f:
+ props = f.readlines()
+ expansion = dict(
+ ("./" + prop.split(" - ")[0], prop.split(" - ")[1].split())
+ for prop in props if " - " in prop)
+ no_expansion = set()
+ return (mynew, mychanged, myremoved, no_expansion, expansion)
+
+ def _get_changed_git_(self, mydeleted):
+ with repoman_popen(
+ "git diff-index --name-only "
+ "--relative --diff-filter=M HEAD") as f:
+ mychanged = f.readlines()
+ mychanged = ["./" + elem[:-1] for elem in mychanged]
+ with repoman_popen(
+ "git diff-index --name-only "
+ "--relative --diff-filter=A HEAD") as f:
+ mynew = f.readlines()
+ mynew = ["./" + elem[:-1] for elem in mynew]
+ with repoman_popen(
+ "git diff-index --name-only "
+ "--relative --diff-filter=D HEAD") as f:
+ myremoved = f.readlines()
+ myremoved = ["./" + elem[:-1] for elem in myremoved]
+ no_expansion = set()
+ expansion = {}
+ return (mynew, mychanged, myremoved, no_expansion, expansion)
+
+ def _get_changed_bzr_(self, mydeleted):
+ with repoman_popen("bzr status -S .") as f:
+ bzrstatus = f.readlines()
+ mychanged = [
+ "./" + elem.split()[-1:][0].split('/')[-1:][0]
+ for elem in bzrstatus
+ if elem and elem[1:2] == "M"]
+ mynew = [
+ "./" + elem.split()[-1:][0].split('/')[-1:][0]
+ for elem in bzrstatus
+ if elem and (elem[1:2] in "NK" or elem[0:1] == "R")]
+ myremoved = [
+ "./" + elem.split()[-1:][0].split('/')[-1:][0]
+ for elem in bzrstatus
+ if elem.startswith("-")]
+ myremoved = [
+ "./" + elem.split()[-3:-2][0].split('/')[-1:][0]
+ for elem in bzrstatus
+ if elem and (elem[1:2] == "K" or elem[0:1] == "R")]
+ # Bazaar expands nothing.
+ no_expansion = set()
+ expansion = {}
+ return (mynew, mychanged, myremoved, no_expansion, expansion)
+
+ def _get_changed_hg_(self, mydeleted):
+ with repoman_popen("hg status --no-status --modified .") as f:
+ mychanged = f.readlines()
+ mychanged = ["./" + elem.rstrip() for elem in mychanged]
+
+ with repoman_popen("hg status --no-status --added .") as f:
+ mynew = f.readlines()
+ mynew = ["./" + elem.rstrip() for elem in mynew]
+
+ with repoman_popen("hg status --no-status --removed .") as f:
+ myremoved = f.readlines()
+ myremoved = ["./" + elem.rstrip() for elem in myremoved]
+ no_expansion = set()
+ expansion = {}
+ return (mynew, mychanged, myremoved, no_expansion, expansion)
+
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-09-21 23:51 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: a0849ae0b37956da75b517b8d0b38c839261f4ba
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 04:26:39 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:47 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a0849ae0
repoman/actions.py: Splitout clear_attic()
pym/repoman/actions.py | 38 +++++++++++++++++++++-----------------
1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 974de62..5b55ff8 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -166,23 +166,7 @@ class Actions(object):
# inside the $Header path. This code detects the problem and corrects it
# so that the Manifest will generate correctly. See bug #169500.
# Use binary mode in order to avoid potential character encoding issues.
- cvs_header_re = re.compile(br'^#\s*\$Header.*\$$')
- attic_str = b'/Attic/'
- attic_replace = b'/'
- for x in myheaders:
- f = open(
- _unicode_encode(x, encoding=_encodings['fs'], errors='strict'),
- mode='rb')
- mylines = f.readlines()
- f.close()
- modified = False
- for i, line in enumerate(mylines):
- if cvs_header_re.match(line) is not None and \
- attic_str in line:
- mylines[i] = line.replace(attic_str, attic_replace)
- modified = True
- if modified:
- portage.util.write_atomic(x, b''.join(mylines), mode='wb')
+ self.clear_attic(myheaders)
if self.scanner.repolevel == 1:
utilities.repoman_sez(
@@ -817,3 +801,23 @@ class Actions(object):
print(
"* Files with headers will"
" cause the manifests to be changed and committed separately.")
+
+
+ def clear_attic(self, myheaders):
+ cvs_header_re = re.compile(br'^#\s*\$Header.*\$$')
+ attic_str = b'/Attic/'
+ attic_replace = b'/'
+ for x in myheaders:
+ f = open(
+ _unicode_encode(x, encoding=_encodings['fs'], errors='strict'),
+ mode='rb')
+ mylines = f.readlines()
+ f.close()
+ modified = False
+ for i, line in enumerate(mylines):
+ if cvs_header_re.match(line) is not None and \
+ attic_str in line:
+ mylines[i] = line.replace(attic_str, attic_replace)
+ modified = True
+ if modified:
+ portage.util.write_atomic(x, b''.join(mylines), mode='wb')
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-09-21 23:51 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: 458d0ca69f6e1d9fb0b673e48d86211a591581ee
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 03:25:28 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=458d0ca6
repoman/actions.py: Split out the changelog code to it's own function
pym/repoman/actions.py | 191 +++++++++++++++++++++++++------------------------
1 file changed, 99 insertions(+), 92 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index e9bf147..d70dd82 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -132,102 +132,14 @@ class Actions(object):
print("* no commit message? aborting commit.")
sys.exit(1)
commitmessage = commitmessage.rstrip()
- changelog_msg = commitmessage
+
+ myupdates, broken_changelog_manifests = self.changelogs(
+ myupdates, mymanifests, myremoved, mychanged, myautoadd,
+ mynew, commitmessage)
commit_footer = self.get_commit_footer()
commitmessage += commit_footer
- broken_changelog_manifests = []
- if self.options.echangelog in ('y', 'force'):
- logging.info("checking for unmodified ChangeLog files")
- committer_name = utilities.get_committer_name(env=self.repoman_settings)
- for x in sorted(vcs_files_to_cps(
- chain(myupdates, mymanifests, myremoved),
- self.scanner.repolevel, self.scanner.reposplit, self.scanner.categories)):
- catdir, pkgdir = x.split("/")
- checkdir = self.repo_settings.repodir + "/" + x
- checkdir_relative = ""
- if self.scanner.repolevel < 3:
- checkdir_relative = os.path.join(pkgdir, checkdir_relative)
- if self.scanner.repolevel < 2:
- checkdir_relative = os.path.join(catdir, checkdir_relative)
- checkdir_relative = os.path.join(".", checkdir_relative)
-
- changelog_path = os.path.join(checkdir_relative, "ChangeLog")
- changelog_modified = changelog_path in self.scanner.changed.changelogs
- if changelog_modified and self.options.echangelog != 'force':
- continue
-
- # get changes for this package
- cdrlen = len(checkdir_relative)
- check_relative = lambda e: e.startswith(checkdir_relative)
- split_relative = lambda e: e[cdrlen:]
- clnew = list(map(split_relative, filter(check_relative, mynew)))
- clremoved = list(map(split_relative, filter(check_relative, myremoved)))
- clchanged = list(map(split_relative, filter(check_relative, mychanged)))
-
- # Skip ChangeLog generation if only the Manifest was modified,
- # as discussed in bug #398009.
- nontrivial_cl_files = set()
- nontrivial_cl_files.update(clnew, clremoved, clchanged)
- nontrivial_cl_files.difference_update(['Manifest'])
- if not nontrivial_cl_files and self.options.echangelog != 'force':
- continue
-
- new_changelog = utilities.UpdateChangeLog(
- checkdir_relative, committer_name, changelog_msg,
- os.path.join(self.repo_settings.repodir, 'skel.ChangeLog'),
- catdir, pkgdir,
- new=clnew, removed=clremoved, changed=clchanged,
- pretend=self.options.pretend)
- if new_changelog is None:
- writemsg_level(
- "!!! Updating the ChangeLog failed\n",
- level=logging.ERROR, noiselevel=-1)
- sys.exit(1)
-
- # if the ChangeLog was just created, add it to vcs
- if new_changelog:
- myautoadd.append(changelog_path)
- # myautoadd is appended to myupdates below
- else:
- myupdates.append(changelog_path)
-
- if self.options.ask and not self.options.pretend:
- # regenerate Manifest for modified ChangeLog (bug #420735)
- self.repoman_settings["O"] = checkdir
- digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
- else:
- broken_changelog_manifests.append(x)
-
- if myautoadd:
- print(">>> Auto-Adding missing Manifest/ChangeLog file(s)...")
- add_cmd = [self.vcs_settings.vcs, "add"]
- add_cmd += myautoadd
- if self.options.pretend:
- portage.writemsg_stdout(
- "(%s)\n" % " ".join(add_cmd),
- noiselevel=-1)
- else:
-
- if sys.hexversion < 0x3020000 and sys.hexversion >= 0x3000000 and \
- not os.path.isabs(add_cmd[0]):
- # Python 3.1 _execvp throws TypeError for non-absolute executable
- # path passed as bytes (see http://bugs.python.org/issue8513).
- fullname = find_binary(add_cmd[0])
- if fullname is None:
- raise portage.exception.CommandNotFound(add_cmd[0])
- add_cmd[0] = fullname
-
- add_cmd = [_unicode_encode(arg) for arg in add_cmd]
- retcode = subprocess.call(add_cmd)
- if retcode != os.EX_OK:
- logging.error(
- "Exiting on %s error code: %s\n" % (self.vcs_settings.vcs, retcode))
- sys.exit(retcode)
-
- myupdates += myautoadd
-
print("* %s files being committed..." % green(str(len(myupdates))), end=' ')
if self.vcs_settings.vcs not in ('cvs', 'svn'):
@@ -800,3 +712,98 @@ class Actions(object):
commit_footer += ", unsigned Manifest commit"
commit_footer += ")"
return commit_footer
+
+
+ def changelogs(self, myupdates, mymanifests, myremoved, mychanged, myautoadd,
+ mynew, changelog_msg):
+ broken_changelog_manifests = []
+ if self.options.echangelog in ('y', 'force'):
+ logging.info("checking for unmodified ChangeLog files")
+ committer_name = utilities.get_committer_name(env=self.repoman_settings)
+ for x in sorted(vcs_files_to_cps(
+ chain(myupdates, mymanifests, myremoved),
+ self.scanner.repolevel, self.scanner.reposplit, self.scanner.categories)):
+ catdir, pkgdir = x.split("/")
+ checkdir = self.repo_settings.repodir + "/" + x
+ checkdir_relative = ""
+ if self.scanner.repolevel < 3:
+ checkdir_relative = os.path.join(pkgdir, checkdir_relative)
+ if self.scanner.repolevel < 2:
+ checkdir_relative = os.path.join(catdir, checkdir_relative)
+ checkdir_relative = os.path.join(".", checkdir_relative)
+
+ changelog_path = os.path.join(checkdir_relative, "ChangeLog")
+ changelog_modified = changelog_path in self.scanner.changed.changelogs
+ if changelog_modified and self.options.echangelog != 'force':
+ continue
+
+ # get changes for this package
+ cdrlen = len(checkdir_relative)
+ check_relative = lambda e: e.startswith(checkdir_relative)
+ split_relative = lambda e: e[cdrlen:]
+ clnew = list(map(split_relative, filter(check_relative, mynew)))
+ clremoved = list(map(split_relative, filter(check_relative, myremoved)))
+ clchanged = list(map(split_relative, filter(check_relative, mychanged)))
+
+ # Skip ChangeLog generation if only the Manifest was modified,
+ # as discussed in bug #398009.
+ nontrivial_cl_files = set()
+ nontrivial_cl_files.update(clnew, clremoved, clchanged)
+ nontrivial_cl_files.difference_update(['Manifest'])
+ if not nontrivial_cl_files and self.options.echangelog != 'force':
+ continue
+
+ new_changelog = utilities.UpdateChangeLog(
+ checkdir_relative, committer_name, changelog_msg,
+ os.path.join(self.repo_settings.repodir, 'skel.ChangeLog'),
+ catdir, pkgdir,
+ new=clnew, removed=clremoved, changed=clchanged,
+ pretend=self.options.pretend)
+ if new_changelog is None:
+ writemsg_level(
+ "!!! Updating the ChangeLog failed\n",
+ level=logging.ERROR, noiselevel=-1)
+ sys.exit(1)
+
+ # if the ChangeLog was just created, add it to vcs
+ if new_changelog:
+ myautoadd.append(changelog_path)
+ # myautoadd is appended to myupdates below
+ else:
+ myupdates.append(changelog_path)
+
+ if self.options.ask and not self.options.pretend:
+ # regenerate Manifest for modified ChangeLog (bug #420735)
+ self.repoman_settings["O"] = checkdir
+ digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
+ else:
+ broken_changelog_manifests.append(x)
+
+ if myautoadd:
+ print(">>> Auto-Adding missing Manifest/ChangeLog file(s)...")
+ add_cmd = [self.vcs_settings.vcs, "add"]
+ add_cmd += myautoadd
+ if self.options.pretend:
+ portage.writemsg_stdout(
+ "(%s)\n" % " ".join(add_cmd),
+ noiselevel=-1)
+ else:
+
+ if sys.hexversion < 0x3020000 and sys.hexversion >= 0x3000000 and \
+ not os.path.isabs(add_cmd[0]):
+ # Python 3.1 _execvp throws TypeError for non-absolute executable
+ # path passed as bytes (see http://bugs.python.org/issue8513).
+ fullname = find_binary(add_cmd[0])
+ if fullname is None:
+ raise portage.exception.CommandNotFound(add_cmd[0])
+ add_cmd[0] = fullname
+
+ add_cmd = [_unicode_encode(arg) for arg in add_cmd]
+ retcode = subprocess.call(add_cmd)
+ if retcode != os.EX_OK:
+ logging.error(
+ "Exiting on %s error code: %s\n" % (self.vcs_settings.vcs, retcode))
+ sys.exit(retcode)
+
+ myupdates += myautoadd
+ return myupdates, broken_changelog_manifests
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-09-21 23:51 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: 3d375a8705fbf6f0ad6f08ca5ffcadf656c9a8a1
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 17 02:07:13 2014 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:45 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3d375a87
repoman/main.py: Update dependency.perlcore error to us qatracker
Update the original code added after the re-write had started.
This brings it up to date with teh new stats tracking class instance.
pym/repoman/main.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 8497833..4dbc09e 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -560,7 +560,9 @@ for xpkg in effective_scanlist:
qatracker.add_error('dependency.perlcore',
ebuild.relative_path +
": %s: please use '%s' instead of '%s'" %
- (mytype, atom.replace("perl-core/","virtual/perl-"), atom))
+ (mytype,
+ atom.replace("perl-core/","virtual/perl-"),
+ atom))
if buildtime and \
not is_blocker and \
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-09-21 23:51 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: 001dd58b705449b08acb34a085673a69b41b697e
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 17 00:13:13 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:45 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=001dd58b
repoman/main.py: Move some functions out of the main code definition
Move gpgsign and need_signature to their own file: gpg.py
Move sort_key() to the main body ahead of the main code.
Add new file gpg.py
pym/repoman/gpg.py | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++
pym/repoman/main.py | 78 +++++-----------------------------------------------
2 files changed, 86 insertions(+), 71 deletions(-)
diff --git a/pym/repoman/gpg.py b/pym/repoman/gpg.py
new file mode 100644
index 0000000..a6c4c5f
--- /dev/null
+++ b/pym/repoman/gpg.py
@@ -0,0 +1,79 @@
+
+import errno
+import logging
+import subprocess
+import sys
+
+import portage
+from portage import os
+from portage import _encodings
+from portage import _unicode_encode
+from portage.exception import MissingParameter
+from portage.process import find_binary
+
+
+# Setup the GPG commands
+def gpgsign(filename, repoman_settings, options):
+ gpgcmd = repoman_settings.get("PORTAGE_GPG_SIGNING_COMMAND")
+ if gpgcmd in [None, '']:
+ raise MissingParameter("PORTAGE_GPG_SIGNING_COMMAND is unset!"
+ " Is make.globals missing?")
+ if "${PORTAGE_GPG_KEY}" in gpgcmd and \
+ "PORTAGE_GPG_KEY" not in repoman_settings:
+ raise MissingParameter("PORTAGE_GPG_KEY is unset!")
+ if "${PORTAGE_GPG_DIR}" in gpgcmd:
+ if "PORTAGE_GPG_DIR" not in repoman_settings:
+ repoman_settings["PORTAGE_GPG_DIR"] = \
+ os.path.expanduser("~/.gnupg")
+ logging.info(
+ "Automatically setting PORTAGE_GPG_DIR to '%s'" %
+ repoman_settings["PORTAGE_GPG_DIR"])
+ else:
+ repoman_settings["PORTAGE_GPG_DIR"] = \
+ os.path.expanduser(repoman_settings["PORTAGE_GPG_DIR"])
+ if not os.access(repoman_settings["PORTAGE_GPG_DIR"], os.X_OK):
+ raise portage.exception.InvalidLocation(
+ "Unable to access directory: PORTAGE_GPG_DIR='%s'" %
+ repoman_settings["PORTAGE_GPG_DIR"])
+ gpgvars = {"FILE": filename}
+ for k in ("PORTAGE_GPG_DIR", "PORTAGE_GPG_KEY"):
+ v = repoman_settings.get(k)
+ if v is not None:
+ gpgvars[k] = v
+ gpgcmd = portage.util.varexpand(gpgcmd, mydict=gpgvars)
+ if options.pretend:
+ print("(" + gpgcmd + ")")
+ else:
+ # Encode unicode manually for bug #310789.
+ gpgcmd = portage.util.shlex_split(gpgcmd)
+
+ if sys.hexversion < 0x3020000 and sys.hexversion >= 0x3000000 and \
+ not os.path.isabs(gpgcmd[0]):
+ # Python 3.1 _execvp throws TypeError for non-absolute executable
+ # path passed as bytes (see http://bugs.python.org/issue8513).
+ fullname = find_binary(gpgcmd[0])
+ if fullname is None:
+ raise portage.exception.CommandNotFound(gpgcmd[0])
+ gpgcmd[0] = fullname
+
+ gpgcmd = [
+ _unicode_encode(arg, encoding=_encodings['fs'], errors='strict')
+ for arg in gpgcmd]
+ rValue = subprocess.call(gpgcmd)
+ if rValue == os.EX_OK:
+ os.rename(filename + ".asc", filename)
+ else:
+ raise portage.exception.PortageException(
+ "!!! gpg exited with '" + str(rValue) + "' status")
+
+def need_signature(filename):
+ try:
+ with open(
+ _unicode_encode(
+ filename, encoding=_encodings['fs'], errors='strict'),
+ 'rb') as f:
+ return b"BEGIN PGP SIGNED MESSAGE" not in f.readline()
+ except IOError as e:
+ if e.errno in (errno.ENOENT, errno.ESTALE):
+ return False
+ raise
diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 4dbc09e..e276aba 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -38,7 +38,6 @@ import portage.repository.config
from portage import cvstree, normalize_path
from portage import util
from portage.dep import Atom
-from portage.exception import MissingParameter
from portage.process import find_binary, spawn
from portage.output import (
bold, create_color_func, green, nocolor, red)
@@ -67,6 +66,7 @@ from repoman.checks.ebuilds.variables.license import LicenseChecks
from repoman.checks.ebuilds.variables.restrict import RestrictChecks
from repoman.ebuild import Ebuild
from repoman.errors import err
+from repoman.gpg import gpgsign, need_signature
from repoman.modules.commit import repochecks
from repoman.profile import check_profiles, dev_keywords, setup_profile
from repoman.qa_data import (
@@ -97,6 +97,11 @@ non_ascii_re = re.compile(r'[^\x00-\x7f]')
# A sane umask is needed for files that portage creates.
os.umask(0o22)
+
+def sort_key(item):
+ return item[2].sub_path
+
+
# Repoman sets it's own ACCEPT_KEYWORDS and we don't want it to
# behave incrementally.
repoman_incrementals = tuple(
@@ -673,9 +678,6 @@ for xpkg in effective_scanlist:
relevant_profiles.extend(
(keyword, groups, prof) for prof in profiles[arch])
- def sort_key(item):
- return item[2].sub_path
-
relevant_profiles.sort(key=sort_key)
for keyword, groups, prof in relevant_profiles:
@@ -1441,72 +1443,6 @@ else:
except OSError:
pass
- # Setup the GPG commands
- def gpgsign(filename):
- gpgcmd = repoman_settings.get("PORTAGE_GPG_SIGNING_COMMAND")
- if gpgcmd in [None, '']:
- raise MissingParameter("PORTAGE_GPG_SIGNING_COMMAND is unset!"
- " Is make.globals missing?")
- if "${PORTAGE_GPG_KEY}" in gpgcmd and \
- "PORTAGE_GPG_KEY" not in repoman_settings:
- raise MissingParameter("PORTAGE_GPG_KEY is unset!")
- if "${PORTAGE_GPG_DIR}" in gpgcmd:
- if "PORTAGE_GPG_DIR" not in repoman_settings:
- repoman_settings["PORTAGE_GPG_DIR"] = \
- os.path.expanduser("~/.gnupg")
- logging.info(
- "Automatically setting PORTAGE_GPG_DIR to '%s'" %
- repoman_settings["PORTAGE_GPG_DIR"])
- else:
- repoman_settings["PORTAGE_GPG_DIR"] = \
- os.path.expanduser(repoman_settings["PORTAGE_GPG_DIR"])
- if not os.access(repoman_settings["PORTAGE_GPG_DIR"], os.X_OK):
- raise portage.exception.InvalidLocation(
- "Unable to access directory: PORTAGE_GPG_DIR='%s'" %
- repoman_settings["PORTAGE_GPG_DIR"])
- gpgvars = {"FILE": filename}
- for k in ("PORTAGE_GPG_DIR", "PORTAGE_GPG_KEY"):
- v = repoman_settings.get(k)
- if v is not None:
- gpgvars[k] = v
- gpgcmd = portage.util.varexpand(gpgcmd, mydict=gpgvars)
- if options.pretend:
- print("(" + gpgcmd + ")")
- else:
- # Encode unicode manually for bug #310789.
- gpgcmd = portage.util.shlex_split(gpgcmd)
-
- if sys.hexversion < 0x3020000 and sys.hexversion >= 0x3000000 and \
- not os.path.isabs(gpgcmd[0]):
- # Python 3.1 _execvp throws TypeError for non-absolute executable
- # path passed as bytes (see http://bugs.python.org/issue8513).
- fullname = find_binary(gpgcmd[0])
- if fullname is None:
- raise portage.exception.CommandNotFound(gpgcmd[0])
- gpgcmd[0] = fullname
-
- gpgcmd = [
- _unicode_encode(arg, encoding=_encodings['fs'], errors='strict')
- for arg in gpgcmd]
- rValue = subprocess.call(gpgcmd)
- if rValue == os.EX_OK:
- os.rename(filename + ".asc", filename)
- else:
- raise portage.exception.PortageException(
- "!!! gpg exited with '" + str(rValue) + "' status")
-
- def need_signature(filename):
- try:
- with open(
- _unicode_encode(
- filename, encoding=_encodings['fs'], errors='strict'),
- 'rb') as f:
- return b"BEGIN PGP SIGNED MESSAGE" not in f.readline()
- except IOError as e:
- if e.errno in (errno.ENOENT, errno.ESTALE):
- return False
- raise
-
# When files are removed and re-added, the cvs server will put /Attic/
# inside the $Header path. This code detects the problem and corrects it
# so that the Manifest will generate correctly. See bug #169500.
@@ -1557,7 +1493,7 @@ else:
manifest_path = os.path.join(repoman_settings["O"], "Manifest")
if not need_signature(manifest_path):
continue
- gpgsign(manifest_path)
+ gpgsign(manifest_path, repoman_settings, options)
except portage.exception.PortageException as e:
portage.writemsg("!!! %s\n" % str(e))
portage.writemsg("!!! Disabled FEATURES='sign'\n")
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
@ 2015-09-21 23:47 Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
0 siblings, 1 reply; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:47 UTC (permalink / raw
To: gentoo-commits
commit: 4d38fd403a374a07def13421cd276c0b2de84605
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 04:34:01 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:47 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4d38fd40
repoman/actions.py: Split out get_new_commit_message()
pym/repoman/actions.py | 39 ++++++++++++++++++++++-----------------
1 file changed, 22 insertions(+), 17 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 4f516da..9d97b20 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -111,24 +111,8 @@ class Actions(object):
else:
raise
if not commitmessage or not commitmessage.strip():
- msg_prefix = ""
- if self.scanner.repolevel > 1:
- msg_prefix = "/".join(self.scanner.reposplit[1:]) + ": "
+ commitmessage = self.get_new_commit_message(qa_output)
- try:
- editor = os.environ.get("EDITOR")
- if editor and utilities.editor_is_executable(editor):
- commitmessage = utilities.get_commit_message_with_editor(
- editor, message=qa_output, prefix=msg_prefix)
- else:
- commitmessage = utilities.get_commit_message_with_stdin()
- except KeyboardInterrupt:
- logging.fatal("Interrupted; exiting...")
- sys.exit(1)
- if (not commitmessage or not commitmessage.strip()
- or commitmessage.strip() == msg_prefix):
- print("* no commit message? aborting commit.")
- sys.exit(1)
commitmessage = commitmessage.rstrip()
myupdates, broken_changelog_manifests = self.changelogs(
@@ -826,3 +810,24 @@ class Actions(object):
portage.writemsg("!!! Disabled FEATURES='sign'\n")
self.repo_settings.sign_manifests = False
+
+ def get_new_commit_message(self, qa_output):
+ msg_prefix = ""
+ if self.scanner.repolevel > 1:
+ msg_prefix = "/".join(self.scanner.reposplit[1:]) + ": "
+
+ try:
+ editor = os.environ.get("EDITOR")
+ if editor and utilities.editor_is_executable(editor):
+ commitmessage = utilities.get_commit_message_with_editor(
+ editor, message=qa_output, prefix=msg_prefix)
+ else:
+ commitmessage = utilities.get_commit_message_with_stdin()
+ except KeyboardInterrupt:
+ logging.fatal("Interrupted; exiting...")
+ sys.exit(1)
+ if (not commitmessage or not commitmessage.strip()
+ or commitmessage.strip() == msg_prefix):
+ print("* no commit message? aborting commit.")
+ sys.exit(1)
+ return commitmessage
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
@ 2015-09-21 23:51 ` Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: 4d38fd403a374a07def13421cd276c0b2de84605
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 04:34:01 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:47 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4d38fd40
repoman/actions.py: Split out get_new_commit_message()
pym/repoman/actions.py | 39 ++++++++++++++++++++++-----------------
1 file changed, 22 insertions(+), 17 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 4f516da..9d97b20 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -111,24 +111,8 @@ class Actions(object):
else:
raise
if not commitmessage or not commitmessage.strip():
- msg_prefix = ""
- if self.scanner.repolevel > 1:
- msg_prefix = "/".join(self.scanner.reposplit[1:]) + ": "
+ commitmessage = self.get_new_commit_message(qa_output)
- try:
- editor = os.environ.get("EDITOR")
- if editor and utilities.editor_is_executable(editor):
- commitmessage = utilities.get_commit_message_with_editor(
- editor, message=qa_output, prefix=msg_prefix)
- else:
- commitmessage = utilities.get_commit_message_with_stdin()
- except KeyboardInterrupt:
- logging.fatal("Interrupted; exiting...")
- sys.exit(1)
- if (not commitmessage or not commitmessage.strip()
- or commitmessage.strip() == msg_prefix):
- print("* no commit message? aborting commit.")
- sys.exit(1)
commitmessage = commitmessage.rstrip()
myupdates, broken_changelog_manifests = self.changelogs(
@@ -826,3 +810,24 @@ class Actions(object):
portage.writemsg("!!! Disabled FEATURES='sign'\n")
self.repo_settings.sign_manifests = False
+
+ def get_new_commit_message(self, qa_output):
+ msg_prefix = ""
+ if self.scanner.repolevel > 1:
+ msg_prefix = "/".join(self.scanner.reposplit[1:]) + ": "
+
+ try:
+ editor = os.environ.get("EDITOR")
+ if editor and utilities.editor_is_executable(editor):
+ commitmessage = utilities.get_commit_message_with_editor(
+ editor, message=qa_output, prefix=msg_prefix)
+ else:
+ commitmessage = utilities.get_commit_message_with_stdin()
+ except KeyboardInterrupt:
+ logging.fatal("Interrupted; exiting...")
+ sys.exit(1)
+ if (not commitmessage or not commitmessage.strip()
+ or commitmessage.strip() == msg_prefix):
+ print("* no commit message? aborting commit.")
+ sys.exit(1)
+ return commitmessage
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
@ 2015-09-21 23:47 Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
0 siblings, 1 reply; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:47 UTC (permalink / raw
To: gentoo-commits
commit: e5c1c0899f0cf8e1331a1e523a27703fe84fb8c9
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 17 04:06:24 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:45 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e5c1c089
repoman: Change name of dev_keywords() due to variable name conflict
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>
pym/repoman/main.py | 4 ++--
pym/repoman/profile.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index e276aba..006afc9 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -68,7 +68,7 @@ from repoman.ebuild import Ebuild
from repoman.errors import err
from repoman.gpg import gpgsign, need_signature
from repoman.modules.commit import repochecks
-from repoman.profile import check_profiles, dev_keywords, setup_profile
+from repoman.profile import check_profiles, dev_profile_keywords, setup_profile
from repoman.qa_data import (
format_qa_output, format_qa_output_column, qahelp,
qawarnings, qacats, missingvars,
@@ -243,7 +243,7 @@ scanlist = scan(repolevel, reposplit, startdir, categories, repo_settings)
####################
-dev_keywords = dev_keywords(profiles)
+dev_keywords = dev_profile_keywords(profiles)
qatracker = QATracker()
diff --git a/pym/repoman/profile.py b/pym/repoman/profile.py
index 11b93c7..0aedbe8 100644
--- a/pym/repoman/profile.py
+++ b/pym/repoman/profile.py
@@ -28,7 +28,7 @@ class ProfileDesc(object):
valid_profile_types = frozenset(['dev', 'exp', 'stable'])
-def dev_keywords(profiles):
+def dev_profile_keywords(profiles):
"""
Create a set of KEYWORDS values that exist in 'dev'
profiles. These are used
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
@ 2015-09-21 23:51 ` Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: e5c1c0899f0cf8e1331a1e523a27703fe84fb8c9
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 17 04:06:24 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:45 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e5c1c089
repoman: Change name of dev_keywords() due to variable name conflict
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>
pym/repoman/main.py | 4 ++--
pym/repoman/profile.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index e276aba..006afc9 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -68,7 +68,7 @@ from repoman.ebuild import Ebuild
from repoman.errors import err
from repoman.gpg import gpgsign, need_signature
from repoman.modules.commit import repochecks
-from repoman.profile import check_profiles, dev_keywords, setup_profile
+from repoman.profile import check_profiles, dev_profile_keywords, setup_profile
from repoman.qa_data import (
format_qa_output, format_qa_output_column, qahelp,
qawarnings, qacats, missingvars,
@@ -243,7 +243,7 @@ scanlist = scan(repolevel, reposplit, startdir, categories, repo_settings)
####################
-dev_keywords = dev_keywords(profiles)
+dev_keywords = dev_profile_keywords(profiles)
qatracker = QATracker()
diff --git a/pym/repoman/profile.py b/pym/repoman/profile.py
index 11b93c7..0aedbe8 100644
--- a/pym/repoman/profile.py
+++ b/pym/repoman/profile.py
@@ -28,7 +28,7 @@ class ProfileDesc(object):
valid_profile_types = frozenset(['dev', 'exp', 'stable'])
-def dev_keywords(profiles):
+def dev_profile_keywords(profiles):
"""
Create a set of KEYWORDS values that exist in 'dev'
profiles. These are used
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
@ 2015-09-21 23:47 Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
0 siblings, 1 reply; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:47 UTC (permalink / raw
To: gentoo-commits
commit: 9c022fd0fe3d40a5c80e2362da48035d03f237f7
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 17 02:43:27 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:45 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9c022fd0
repoamn/repos.py: Indent fix
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>
pym/repoman/repos.py | 46 +++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/pym/repoman/repos.py b/pym/repoman/repos.py
index de99fdf..f16bf7a 100644
--- a/pym/repoman/repos.py
+++ b/pym/repoman/repos.py
@@ -128,29 +128,29 @@ class RepoSettings(object):
sys.exit(1)
def _add_repo(self, config_root, portdir_overlay):
- self.repo_conf = portage.repository.config
- self.repo_name = self.repo_conf.RepoConfig._read_valid_repo_name(
- portdir_overlay)[0]
- self.layout_conf_data = self.repo_conf.parse_layout_conf(portdir_overlay)[0]
- if self.layout_conf_data['repo-name']:
- self.repo_name = self.layout_conf_data['repo-name']
- tmp_conf_file = io.StringIO(textwrap.dedent("""
- [%s]
- location = %s
- """) % (self.repo_name, portdir_overlay))
- # Ensure that the repository corresponding to $PWD overrides a
- # repository of the same name referenced by the existing PORTDIR
- # or PORTDIR_OVERLAY settings.
- self.repoman_settings['PORTDIR_OVERLAY'] = "%s %s" % (
- self.repoman_settings.get('PORTDIR_OVERLAY', ''),
- portage._shell_quote(portdir_overlay))
- self.repositories = self.repo_conf.load_repository_config(
- self.repoman_settings, extra_files=[tmp_conf_file])
- # We have to call the config constructor again so that attributes
- # dependent on config.repositories are initialized correctly.
- self.repoman_settings = portage.config(
- config_root=config_root, local_config=False,
- repositories=self.repositories)
+ self.repo_conf = portage.repository.config
+ self.repo_name = self.repo_conf.RepoConfig._read_valid_repo_name(
+ portdir_overlay)[0]
+ self.layout_conf_data = self.repo_conf.parse_layout_conf(portdir_overlay)[0]
+ if self.layout_conf_data['repo-name']:
+ self.repo_name = self.layout_conf_data['repo-name']
+ tmp_conf_file = io.StringIO(textwrap.dedent("""
+ [%s]
+ location = %s
+ """) % (self.repo_name, portdir_overlay))
+ # Ensure that the repository corresponding to $PWD overrides a
+ # repository of the same name referenced by the existing PORTDIR
+ # or PORTDIR_OVERLAY settings.
+ self.repoman_settings['PORTDIR_OVERLAY'] = "%s %s" % (
+ self.repoman_settings.get('PORTDIR_OVERLAY', ''),
+ portage._shell_quote(portdir_overlay))
+ self.repositories = self.repo_conf.load_repository_config(
+ self.repoman_settings, extra_files=[tmp_conf_file])
+ # We have to call the config constructor again so that attributes
+ # dependent on config.repositories are initialized correctly.
+ self.repoman_settings = portage.config(
+ config_root=config_root, local_config=False,
+ repositories=self.repositories)
##########
# future vcs plugin functions
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
@ 2015-09-21 23:51 ` Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: 9c022fd0fe3d40a5c80e2362da48035d03f237f7
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 17 02:43:27 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:45 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9c022fd0
repoamn/repos.py: Indent fix
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>
pym/repoman/repos.py | 46 +++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/pym/repoman/repos.py b/pym/repoman/repos.py
index de99fdf..f16bf7a 100644
--- a/pym/repoman/repos.py
+++ b/pym/repoman/repos.py
@@ -128,29 +128,29 @@ class RepoSettings(object):
sys.exit(1)
def _add_repo(self, config_root, portdir_overlay):
- self.repo_conf = portage.repository.config
- self.repo_name = self.repo_conf.RepoConfig._read_valid_repo_name(
- portdir_overlay)[0]
- self.layout_conf_data = self.repo_conf.parse_layout_conf(portdir_overlay)[0]
- if self.layout_conf_data['repo-name']:
- self.repo_name = self.layout_conf_data['repo-name']
- tmp_conf_file = io.StringIO(textwrap.dedent("""
- [%s]
- location = %s
- """) % (self.repo_name, portdir_overlay))
- # Ensure that the repository corresponding to $PWD overrides a
- # repository of the same name referenced by the existing PORTDIR
- # or PORTDIR_OVERLAY settings.
- self.repoman_settings['PORTDIR_OVERLAY'] = "%s %s" % (
- self.repoman_settings.get('PORTDIR_OVERLAY', ''),
- portage._shell_quote(portdir_overlay))
- self.repositories = self.repo_conf.load_repository_config(
- self.repoman_settings, extra_files=[tmp_conf_file])
- # We have to call the config constructor again so that attributes
- # dependent on config.repositories are initialized correctly.
- self.repoman_settings = portage.config(
- config_root=config_root, local_config=False,
- repositories=self.repositories)
+ self.repo_conf = portage.repository.config
+ self.repo_name = self.repo_conf.RepoConfig._read_valid_repo_name(
+ portdir_overlay)[0]
+ self.layout_conf_data = self.repo_conf.parse_layout_conf(portdir_overlay)[0]
+ if self.layout_conf_data['repo-name']:
+ self.repo_name = self.layout_conf_data['repo-name']
+ tmp_conf_file = io.StringIO(textwrap.dedent("""
+ [%s]
+ location = %s
+ """) % (self.repo_name, portdir_overlay))
+ # Ensure that the repository corresponding to $PWD overrides a
+ # repository of the same name referenced by the existing PORTDIR
+ # or PORTDIR_OVERLAY settings.
+ self.repoman_settings['PORTDIR_OVERLAY'] = "%s %s" % (
+ self.repoman_settings.get('PORTDIR_OVERLAY', ''),
+ portage._shell_quote(portdir_overlay))
+ self.repositories = self.repo_conf.load_repository_config(
+ self.repoman_settings, extra_files=[tmp_conf_file])
+ # We have to call the config constructor again so that attributes
+ # dependent on config.repositories are initialized correctly.
+ self.repoman_settings = portage.config(
+ config_root=config_root, local_config=False,
+ repositories=self.repositories)
##########
# future vcs plugin functions
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
@ 2015-09-21 23:47 Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
0 siblings, 1 reply; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:47 UTC (permalink / raw
To: gentoo-commits
commit: 3f47be32adcee89a34234d594b04e81089ea85ce
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 04:25:34 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:47 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3f47be32
repoman/actions.py: Split out thick_manifest()
pym/repoman/actions.py | 101 +++++++++++++++++++++++++------------------------
1 file changed, 52 insertions(+), 49 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index af50c1b..974de62 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -146,55 +146,7 @@ class Actions(object):
# committed in one big commit at the end.
print()
elif not self.repo_settings.repo_config.thin_manifest:
- if self.vcs_settings.vcs == 'cvs':
- headerstring = "'\$(Header|Id).*\$'"
- elif self.vcs_settings.vcs == "svn":
- svn_keywords = dict((k.lower(), k) for k in [
- "Rev",
- "Revision",
- "LastChangedRevision",
- "Date",
- "LastChangedDate",
- "Author",
- "LastChangedBy",
- "URL",
- "HeadURL",
- "Id",
- "Header",
- ])
-
- for myfile in myupdates:
-
- # for CVS, no_expansion contains files that are excluded from expansion
- if self.vcs_settings.vcs == "cvs":
- if myfile in no_expansion:
- continue
-
- # for SVN, expansion contains files that are included in expansion
- elif self.vcs_settings.vcs == "svn":
- if myfile not in expansion:
- continue
-
- # Subversion keywords are case-insensitive
- # in svn:keywords properties,
- # but case-sensitive in contents of files.
- enabled_keywords = []
- for k in expansion[myfile]:
- keyword = svn_keywords.get(k.lower())
- if keyword is not None:
- enabled_keywords.append(keyword)
-
- headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords)
-
- myout = repoman_getstatusoutput(
- "egrep -q %s %s" % (headerstring, portage._shell_quote(myfile)))
- if myout[0] == 0:
- myheaders.append(myfile)
-
- print("%s have headers that will change." % green(str(len(myheaders))))
- print(
- "* Files with headers will"
- " cause the manifests to be changed and committed separately.")
+ self.thick_manifest(myupdates, myheaders, no_expansion, expansion)
logging.info("myupdates: %s", myupdates)
logging.info("myheaders: %s", myheaders)
@@ -814,3 +766,54 @@ class Actions(object):
except OSError:
pass
+
+ def thick_manifest(self, myupdates, myheaders, no_expansion, expansion):
+ if self.vcs_settings.vcs == 'cvs':
+ headerstring = "'\$(Header|Id).*\$'"
+ elif self.vcs_settings.vcs == "svn":
+ svn_keywords = dict((k.lower(), k) for k in [
+ "Rev",
+ "Revision",
+ "LastChangedRevision",
+ "Date",
+ "LastChangedDate",
+ "Author",
+ "LastChangedBy",
+ "URL",
+ "HeadURL",
+ "Id",
+ "Header",
+ ])
+
+ for myfile in myupdates:
+
+ # for CVS, no_expansion contains files that are excluded from expansion
+ if self.vcs_settings.vcs == "cvs":
+ if myfile in no_expansion:
+ continue
+
+ # for SVN, expansion contains files that are included in expansion
+ elif self.vcs_settings.vcs == "svn":
+ if myfile not in expansion:
+ continue
+
+ # Subversion keywords are case-insensitive
+ # in svn:keywords properties,
+ # but case-sensitive in contents of files.
+ enabled_keywords = []
+ for k in expansion[myfile]:
+ keyword = svn_keywords.get(k.lower())
+ if keyword is not None:
+ enabled_keywords.append(keyword)
+
+ headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords)
+
+ myout = repoman_getstatusoutput(
+ "egrep -q %s %s" % (headerstring, portage._shell_quote(myfile)))
+ if myout[0] == 0:
+ myheaders.append(myfile)
+
+ print("%s have headers that will change." % green(str(len(myheaders))))
+ print(
+ "* Files with headers will"
+ " cause the manifests to be changed and committed separately.")
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
@ 2015-09-21 23:51 ` Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: 3f47be32adcee89a34234d594b04e81089ea85ce
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 04:25:34 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:47 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3f47be32
repoman/actions.py: Split out thick_manifest()
pym/repoman/actions.py | 101 +++++++++++++++++++++++++------------------------
1 file changed, 52 insertions(+), 49 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index af50c1b..974de62 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -146,55 +146,7 @@ class Actions(object):
# committed in one big commit at the end.
print()
elif not self.repo_settings.repo_config.thin_manifest:
- if self.vcs_settings.vcs == 'cvs':
- headerstring = "'\$(Header|Id).*\$'"
- elif self.vcs_settings.vcs == "svn":
- svn_keywords = dict((k.lower(), k) for k in [
- "Rev",
- "Revision",
- "LastChangedRevision",
- "Date",
- "LastChangedDate",
- "Author",
- "LastChangedBy",
- "URL",
- "HeadURL",
- "Id",
- "Header",
- ])
-
- for myfile in myupdates:
-
- # for CVS, no_expansion contains files that are excluded from expansion
- if self.vcs_settings.vcs == "cvs":
- if myfile in no_expansion:
- continue
-
- # for SVN, expansion contains files that are included in expansion
- elif self.vcs_settings.vcs == "svn":
- if myfile not in expansion:
- continue
-
- # Subversion keywords are case-insensitive
- # in svn:keywords properties,
- # but case-sensitive in contents of files.
- enabled_keywords = []
- for k in expansion[myfile]:
- keyword = svn_keywords.get(k.lower())
- if keyword is not None:
- enabled_keywords.append(keyword)
-
- headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords)
-
- myout = repoman_getstatusoutput(
- "egrep -q %s %s" % (headerstring, portage._shell_quote(myfile)))
- if myout[0] == 0:
- myheaders.append(myfile)
-
- print("%s have headers that will change." % green(str(len(myheaders))))
- print(
- "* Files with headers will"
- " cause the manifests to be changed and committed separately.")
+ self.thick_manifest(myupdates, myheaders, no_expansion, expansion)
logging.info("myupdates: %s", myupdates)
logging.info("myheaders: %s", myheaders)
@@ -814,3 +766,54 @@ class Actions(object):
except OSError:
pass
+
+ def thick_manifest(self, myupdates, myheaders, no_expansion, expansion):
+ if self.vcs_settings.vcs == 'cvs':
+ headerstring = "'\$(Header|Id).*\$'"
+ elif self.vcs_settings.vcs == "svn":
+ svn_keywords = dict((k.lower(), k) for k in [
+ "Rev",
+ "Revision",
+ "LastChangedRevision",
+ "Date",
+ "LastChangedDate",
+ "Author",
+ "LastChangedBy",
+ "URL",
+ "HeadURL",
+ "Id",
+ "Header",
+ ])
+
+ for myfile in myupdates:
+
+ # for CVS, no_expansion contains files that are excluded from expansion
+ if self.vcs_settings.vcs == "cvs":
+ if myfile in no_expansion:
+ continue
+
+ # for SVN, expansion contains files that are included in expansion
+ elif self.vcs_settings.vcs == "svn":
+ if myfile not in expansion:
+ continue
+
+ # Subversion keywords are case-insensitive
+ # in svn:keywords properties,
+ # but case-sensitive in contents of files.
+ enabled_keywords = []
+ for k in expansion[myfile]:
+ keyword = svn_keywords.get(k.lower())
+ if keyword is not None:
+ enabled_keywords.append(keyword)
+
+ headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords)
+
+ myout = repoman_getstatusoutput(
+ "egrep -q %s %s" % (headerstring, portage._shell_quote(myfile)))
+ if myout[0] == 0:
+ myheaders.append(myfile)
+
+ print("%s have headers that will change." % green(str(len(myheaders))))
+ print(
+ "* Files with headers will"
+ " cause the manifests to be changed and committed separately.")
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
@ 2015-09-21 23:47 Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
0 siblings, 1 reply; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:47 UTC (permalink / raw
To: gentoo-commits
commit: 6a7e4358e3fbf359d77623b007c1a68c901a1790
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 04:10:03 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:47 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=6a7e4358
repoman/actions.py: Split out priming_commit()
pym/repoman/actions.py | 91 ++++++++++++++++++++++++++------------------------
1 file changed, 48 insertions(+), 43 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 2318ce2..af50c1b 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -208,49 +208,7 @@ class Actions(object):
# will change and need a priming commit before the Manifest
# can be committed.
if (myupdates or myremoved) and myheaders:
- myfiles = myupdates + myremoved
- fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
- mymsg = os.fdopen(fd, "wb")
- mymsg.write(_unicode_encode(commitmessage))
- mymsg.close()
-
- separator = '-' * 78
-
- print()
- print(green("Using commit message:"))
- print(green(separator))
- print(commitmessage)
- print(green(separator))
- print()
-
- # Having a leading ./ prefix on file paths can trigger a bug in
- # the cvs server when committing files to multiple directories,
- # so strip the prefix.
- myfiles = [f.lstrip("./") for f in myfiles]
-
- commit_cmd = [self.vcs_settings.vcs]
- commit_cmd.extend(self.vcs_settings.vcs_global_opts)
- commit_cmd.append("commit")
- commit_cmd.extend(self.vcs_settings.vcs_local_opts)
- commit_cmd.extend(["-F", commitmessagefile])
- commit_cmd.extend(myfiles)
-
- try:
- if self.options.pretend:
- print("(%s)" % (" ".join(commit_cmd),))
- else:
- retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
- if retval != os.EX_OK:
- writemsg_level(
- "!!! Exiting on %s (shell) "
- "error code: %s\n" % (self.vcs_settings.vcs, retval),
- level=logging.ERROR, noiselevel=-1)
- sys.exit(retval)
- finally:
- try:
- os.unlink(commitmessagefile)
- except OSError:
- pass
+ self.priming_commit(myupdates, myremoved, commitmessage)
# When files are removed and re-added, the cvs server will put /Attic/
# inside the $Header path. This code detects the problem and corrects it
@@ -809,3 +767,50 @@ class Actions(object):
os.unlink(commitmessagefile)
except OSError:
pass
+
+
+ def priming_commit(self, myupdates, myremoved, commitmessage):
+ myfiles = myupdates + myremoved
+ fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
+ mymsg = os.fdopen(fd, "wb")
+ mymsg.write(_unicode_encode(commitmessage))
+ mymsg.close()
+
+ separator = '-' * 78
+
+ print()
+ print(green("Using commit message:"))
+ print(green(separator))
+ print(commitmessage)
+ print(green(separator))
+ print()
+
+ # Having a leading ./ prefix on file paths can trigger a bug in
+ # the cvs server when committing files to multiple directories,
+ # so strip the prefix.
+ myfiles = [f.lstrip("./") for f in myfiles]
+
+ commit_cmd = [self.vcs_settings.vcs]
+ commit_cmd.extend(self.vcs_settings.vcs_global_opts)
+ commit_cmd.append("commit")
+ commit_cmd.extend(self.vcs_settings.vcs_local_opts)
+ commit_cmd.extend(["-F", commitmessagefile])
+ commit_cmd.extend(myfiles)
+
+ try:
+ if self.options.pretend:
+ print("(%s)" % (" ".join(commit_cmd),))
+ else:
+ retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
+ if retval != os.EX_OK:
+ writemsg_level(
+ "!!! Exiting on %s (shell) "
+ "error code: %s\n" % (self.vcs_settings.vcs, retval),
+ level=logging.ERROR, noiselevel=-1)
+ sys.exit(retval)
+ finally:
+ try:
+ os.unlink(commitmessagefile)
+ except OSError:
+ pass
+
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
@ 2015-09-21 23:51 ` Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: 6a7e4358e3fbf359d77623b007c1a68c901a1790
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 04:10:03 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:47 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=6a7e4358
repoman/actions.py: Split out priming_commit()
pym/repoman/actions.py | 91 ++++++++++++++++++++++++++------------------------
1 file changed, 48 insertions(+), 43 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 2318ce2..af50c1b 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -208,49 +208,7 @@ class Actions(object):
# will change and need a priming commit before the Manifest
# can be committed.
if (myupdates or myremoved) and myheaders:
- myfiles = myupdates + myremoved
- fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
- mymsg = os.fdopen(fd, "wb")
- mymsg.write(_unicode_encode(commitmessage))
- mymsg.close()
-
- separator = '-' * 78
-
- print()
- print(green("Using commit message:"))
- print(green(separator))
- print(commitmessage)
- print(green(separator))
- print()
-
- # Having a leading ./ prefix on file paths can trigger a bug in
- # the cvs server when committing files to multiple directories,
- # so strip the prefix.
- myfiles = [f.lstrip("./") for f in myfiles]
-
- commit_cmd = [self.vcs_settings.vcs]
- commit_cmd.extend(self.vcs_settings.vcs_global_opts)
- commit_cmd.append("commit")
- commit_cmd.extend(self.vcs_settings.vcs_local_opts)
- commit_cmd.extend(["-F", commitmessagefile])
- commit_cmd.extend(myfiles)
-
- try:
- if self.options.pretend:
- print("(%s)" % (" ".join(commit_cmd),))
- else:
- retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
- if retval != os.EX_OK:
- writemsg_level(
- "!!! Exiting on %s (shell) "
- "error code: %s\n" % (self.vcs_settings.vcs, retval),
- level=logging.ERROR, noiselevel=-1)
- sys.exit(retval)
- finally:
- try:
- os.unlink(commitmessagefile)
- except OSError:
- pass
+ self.priming_commit(myupdates, myremoved, commitmessage)
# When files are removed and re-added, the cvs server will put /Attic/
# inside the $Header path. This code detects the problem and corrects it
@@ -809,3 +767,50 @@ class Actions(object):
os.unlink(commitmessagefile)
except OSError:
pass
+
+
+ def priming_commit(self, myupdates, myremoved, commitmessage):
+ myfiles = myupdates + myremoved
+ fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
+ mymsg = os.fdopen(fd, "wb")
+ mymsg.write(_unicode_encode(commitmessage))
+ mymsg.close()
+
+ separator = '-' * 78
+
+ print()
+ print(green("Using commit message:"))
+ print(green(separator))
+ print(commitmessage)
+ print(green(separator))
+ print()
+
+ # Having a leading ./ prefix on file paths can trigger a bug in
+ # the cvs server when committing files to multiple directories,
+ # so strip the prefix.
+ myfiles = [f.lstrip("./") for f in myfiles]
+
+ commit_cmd = [self.vcs_settings.vcs]
+ commit_cmd.extend(self.vcs_settings.vcs_global_opts)
+ commit_cmd.append("commit")
+ commit_cmd.extend(self.vcs_settings.vcs_local_opts)
+ commit_cmd.extend(["-F", commitmessagefile])
+ commit_cmd.extend(myfiles)
+
+ try:
+ if self.options.pretend:
+ print("(%s)" % (" ".join(commit_cmd),))
+ else:
+ retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
+ if retval != os.EX_OK:
+ writemsg_level(
+ "!!! Exiting on %s (shell) "
+ "error code: %s\n" % (self.vcs_settings.vcs, retval),
+ level=logging.ERROR, noiselevel=-1)
+ sys.exit(retval)
+ finally:
+ try:
+ os.unlink(commitmessagefile)
+ except OSError:
+ pass
+
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
@ 2015-09-21 23:47 Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
0 siblings, 1 reply; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:47 UTC (permalink / raw
To: gentoo-commits
commit: 56cd8391579d206245232b0766d7cfe6c6b82dbc
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 04:03:54 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:47 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=56cd8391
repoman/actions.py: Remove unused variable
pym/repoman/actions.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 405a8c7..2318ce2 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -110,8 +110,6 @@ class Actions(object):
" --commitmsgfile='%s'\n" % self.options.commitmsgfile)
else:
raise
- # We've read the content so the file is no longer needed.
- commitmessagefile = None
if not commitmessage or not commitmessage.strip():
msg_prefix = ""
if self.scanner.repolevel > 1:
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
@ 2015-09-21 23:47 Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
0 siblings, 1 reply; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:47 UTC (permalink / raw
To: gentoo-commits
commit: f702bf4c75b03b19e214c6d9f5a376afa647dce5
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 03:59:10 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f702bf4c
repoman/actions.py: split out a manifest function
pym/repoman/actions.py | 110 +++++++++++++++++++++++++------------------------
1 file changed, 57 insertions(+), 53 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index d70dd82..405a8c7 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -330,59 +330,7 @@ class Actions(object):
level=logging.ERROR, noiselevel=-1)
sys.exit(retval)
- if True:
- myfiles = mymanifests[:]
- # If there are no header (SVN/CVS keywords) changes in
- # the files, this Manifest commit must include the
- # other (yet uncommitted) files.
- if not myheaders:
- myfiles += myupdates
- myfiles += myremoved
- myfiles.sort()
-
- fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
- mymsg = os.fdopen(fd, "wb")
- mymsg.write(_unicode_encode(commitmessage))
- mymsg.close()
-
- commit_cmd = []
- if self.options.pretend and self.vcs_settings.vcs is None:
- # substitute a bogus value for pretend output
- commit_cmd.append("cvs")
- else:
- commit_cmd.append(self.vcs_settings.vcs)
- commit_cmd.extend(self.vcs_settings.vcs_global_opts)
- commit_cmd.append("commit")
- commit_cmd.extend(self.vcs_settings.vcs_local_opts)
- if self.vcs_settings.vcs == "hg":
- commit_cmd.extend(["--logfile", commitmessagefile])
- commit_cmd.extend(myfiles)
- else:
- commit_cmd.extend(["-F", commitmessagefile])
- commit_cmd.extend(f.lstrip("./") for f in myfiles)
-
- try:
- if self.options.pretend:
- print("(%s)" % (" ".join(commit_cmd),))
- else:
- retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
- if retval != os.EX_OK:
- if self.repo_settings.repo_config.sign_commit and self.vcs_settings.vcs == 'git' and \
- not git_supports_gpg_sign():
- # Inform user that newer git is needed (bug #403323).
- logging.error(
- "Git >=1.7.9 is required for signed commits!")
-
- writemsg_level(
- "!!! Exiting on %s (shell) "
- "error code: %s\n" % (self.vcs_settings.vcs, retval),
- level=logging.ERROR, noiselevel=-1)
- sys.exit(retval)
- finally:
- try:
- os.unlink(commitmessagefile)
- except OSError:
- pass
+ self.add_manifest(mymanifests, myheaders, myupdates, myremoved, commitmessage)
print()
if self.vcs_settings.vcs:
@@ -807,3 +755,59 @@ class Actions(object):
myupdates += myautoadd
return myupdates, broken_changelog_manifests
+
+
+ def add_manifest(self, mymanifests, myheaders, myupdates, myremoved,
+ commitmessage):
+ myfiles = mymanifests[:]
+ # If there are no header (SVN/CVS keywords) changes in
+ # the files, this Manifest commit must include the
+ # other (yet uncommitted) files.
+ if not myheaders:
+ myfiles += myupdates
+ myfiles += myremoved
+ myfiles.sort()
+
+ fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
+ mymsg = os.fdopen(fd, "wb")
+ mymsg.write(_unicode_encode(commitmessage))
+ mymsg.close()
+
+ commit_cmd = []
+ if self.options.pretend and self.vcs_settings.vcs is None:
+ # substitute a bogus value for pretend output
+ commit_cmd.append("cvs")
+ else:
+ commit_cmd.append(self.vcs_settings.vcs)
+ commit_cmd.extend(self.vcs_settings.vcs_global_opts)
+ commit_cmd.append("commit")
+ commit_cmd.extend(self.vcs_settings.vcs_local_opts)
+ if self.vcs_settings.vcs == "hg":
+ commit_cmd.extend(["--logfile", commitmessagefile])
+ commit_cmd.extend(myfiles)
+ else:
+ commit_cmd.extend(["-F", commitmessagefile])
+ commit_cmd.extend(f.lstrip("./") for f in myfiles)
+
+ try:
+ if self.options.pretend:
+ print("(%s)" % (" ".join(commit_cmd),))
+ else:
+ retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
+ if retval != os.EX_OK:
+ if self.repo_settings.repo_config.sign_commit and self.vcs_settings.vcs == 'git' and \
+ not git_supports_gpg_sign():
+ # Inform user that newer git is needed (bug #403323).
+ logging.error(
+ "Git >=1.7.9 is required for signed commits!")
+
+ writemsg_level(
+ "!!! Exiting on %s (shell) "
+ "error code: %s\n" % (self.vcs_settings.vcs, retval),
+ level=logging.ERROR, noiselevel=-1)
+ sys.exit(retval)
+ finally:
+ try:
+ os.unlink(commitmessagefile)
+ except OSError:
+ pass
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
@ 2015-09-21 23:51 ` Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: f702bf4c75b03b19e214c6d9f5a376afa647dce5
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 03:59:10 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f702bf4c
repoman/actions.py: split out a manifest function
pym/repoman/actions.py | 110 +++++++++++++++++++++++++------------------------
1 file changed, 57 insertions(+), 53 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index d70dd82..405a8c7 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -330,59 +330,7 @@ class Actions(object):
level=logging.ERROR, noiselevel=-1)
sys.exit(retval)
- if True:
- myfiles = mymanifests[:]
- # If there are no header (SVN/CVS keywords) changes in
- # the files, this Manifest commit must include the
- # other (yet uncommitted) files.
- if not myheaders:
- myfiles += myupdates
- myfiles += myremoved
- myfiles.sort()
-
- fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
- mymsg = os.fdopen(fd, "wb")
- mymsg.write(_unicode_encode(commitmessage))
- mymsg.close()
-
- commit_cmd = []
- if self.options.pretend and self.vcs_settings.vcs is None:
- # substitute a bogus value for pretend output
- commit_cmd.append("cvs")
- else:
- commit_cmd.append(self.vcs_settings.vcs)
- commit_cmd.extend(self.vcs_settings.vcs_global_opts)
- commit_cmd.append("commit")
- commit_cmd.extend(self.vcs_settings.vcs_local_opts)
- if self.vcs_settings.vcs == "hg":
- commit_cmd.extend(["--logfile", commitmessagefile])
- commit_cmd.extend(myfiles)
- else:
- commit_cmd.extend(["-F", commitmessagefile])
- commit_cmd.extend(f.lstrip("./") for f in myfiles)
-
- try:
- if self.options.pretend:
- print("(%s)" % (" ".join(commit_cmd),))
- else:
- retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
- if retval != os.EX_OK:
- if self.repo_settings.repo_config.sign_commit and self.vcs_settings.vcs == 'git' and \
- not git_supports_gpg_sign():
- # Inform user that newer git is needed (bug #403323).
- logging.error(
- "Git >=1.7.9 is required for signed commits!")
-
- writemsg_level(
- "!!! Exiting on %s (shell) "
- "error code: %s\n" % (self.vcs_settings.vcs, retval),
- level=logging.ERROR, noiselevel=-1)
- sys.exit(retval)
- finally:
- try:
- os.unlink(commitmessagefile)
- except OSError:
- pass
+ self.add_manifest(mymanifests, myheaders, myupdates, myremoved, commitmessage)
print()
if self.vcs_settings.vcs:
@@ -807,3 +755,59 @@ class Actions(object):
myupdates += myautoadd
return myupdates, broken_changelog_manifests
+
+
+ def add_manifest(self, mymanifests, myheaders, myupdates, myremoved,
+ commitmessage):
+ myfiles = mymanifests[:]
+ # If there are no header (SVN/CVS keywords) changes in
+ # the files, this Manifest commit must include the
+ # other (yet uncommitted) files.
+ if not myheaders:
+ myfiles += myupdates
+ myfiles += myremoved
+ myfiles.sort()
+
+ fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
+ mymsg = os.fdopen(fd, "wb")
+ mymsg.write(_unicode_encode(commitmessage))
+ mymsg.close()
+
+ commit_cmd = []
+ if self.options.pretend and self.vcs_settings.vcs is None:
+ # substitute a bogus value for pretend output
+ commit_cmd.append("cvs")
+ else:
+ commit_cmd.append(self.vcs_settings.vcs)
+ commit_cmd.extend(self.vcs_settings.vcs_global_opts)
+ commit_cmd.append("commit")
+ commit_cmd.extend(self.vcs_settings.vcs_local_opts)
+ if self.vcs_settings.vcs == "hg":
+ commit_cmd.extend(["--logfile", commitmessagefile])
+ commit_cmd.extend(myfiles)
+ else:
+ commit_cmd.extend(["-F", commitmessagefile])
+ commit_cmd.extend(f.lstrip("./") for f in myfiles)
+
+ try:
+ if self.options.pretend:
+ print("(%s)" % (" ".join(commit_cmd),))
+ else:
+ retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
+ if retval != os.EX_OK:
+ if self.repo_settings.repo_config.sign_commit and self.vcs_settings.vcs == 'git' and \
+ not git_supports_gpg_sign():
+ # Inform user that newer git is needed (bug #403323).
+ logging.error(
+ "Git >=1.7.9 is required for signed commits!")
+
+ writemsg_level(
+ "!!! Exiting on %s (shell) "
+ "error code: %s\n" % (self.vcs_settings.vcs, retval),
+ level=logging.ERROR, noiselevel=-1)
+ sys.exit(retval)
+ finally:
+ try:
+ os.unlink(commitmessagefile)
+ except OSError:
+ pass
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
@ 2015-09-21 23:47 Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
0 siblings, 1 reply; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:47 UTC (permalink / raw
To: gentoo-commits
commit: 3769fd0b8cfa080197cf154b2742bc2d7895ae15
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 04:27:19 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:47 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3769fd0b
repoamn/actions.py: Split out sign_manifest()
pym/repoman/actions.py | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 5b55ff8..4f516da 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -186,19 +186,7 @@ class Actions(object):
digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
if self.repo_settings.sign_manifests:
- try:
- for x in sorted(vcs_files_to_cps(
- chain(myupdates, myremoved, mymanifests),
- self.scanner.repolevel, self.scanner.reposplit, self.scanner.categories)):
- self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
- manifest_path = os.path.join(self.repoman_settings["O"], "Manifest")
- if not need_signature(manifest_path):
- continue
- gpgsign(manifest_path, self.repoman_settings, self.options)
- except portage.exception.PortageException as e:
- portage.writemsg("!!! %s\n" % str(e))
- portage.writemsg("!!! Disabled FEATURES='sign'\n")
- self.repo_settings.sign_manifests = False
+ self.sign_manifests(myupdates, myremoved, mymanifests)
if self.vcs_settings.vcs == 'git':
# It's not safe to use the git commit -a option since there might
@@ -821,3 +809,20 @@ class Actions(object):
modified = True
if modified:
portage.util.write_atomic(x, b''.join(mylines), mode='wb')
+
+
+ def sign_manifest(self, myupdates, myremoved, mymanifests):
+ try:
+ for x in sorted(vcs_files_to_cps(
+ chain(myupdates, myremoved, mymanifests),
+ self.scanner.repolevel, self.scanner.reposplit, self.scanner.categories)):
+ self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
+ manifest_path = os.path.join(self.repoman_settings["O"], "Manifest")
+ if not need_signature(manifest_path):
+ continue
+ gpgsign(manifest_path, self.repoman_settings, self.options)
+ except portage.exception.PortageException as e:
+ portage.writemsg("!!! %s\n" % str(e))
+ portage.writemsg("!!! Disabled FEATURES='sign'\n")
+ self.repo_settings.sign_manifests = False
+
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
@ 2015-09-21 23:51 ` Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: 3769fd0b8cfa080197cf154b2742bc2d7895ae15
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 04:27:19 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:47 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3769fd0b
repoamn/actions.py: Split out sign_manifest()
pym/repoman/actions.py | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 5b55ff8..4f516da 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -186,19 +186,7 @@ class Actions(object):
digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
if self.repo_settings.sign_manifests:
- try:
- for x in sorted(vcs_files_to_cps(
- chain(myupdates, myremoved, mymanifests),
- self.scanner.repolevel, self.scanner.reposplit, self.scanner.categories)):
- self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
- manifest_path = os.path.join(self.repoman_settings["O"], "Manifest")
- if not need_signature(manifest_path):
- continue
- gpgsign(manifest_path, self.repoman_settings, self.options)
- except portage.exception.PortageException as e:
- portage.writemsg("!!! %s\n" % str(e))
- portage.writemsg("!!! Disabled FEATURES='sign'\n")
- self.repo_settings.sign_manifests = False
+ self.sign_manifests(myupdates, myremoved, mymanifests)
if self.vcs_settings.vcs == 'git':
# It's not safe to use the git commit -a option since there might
@@ -821,3 +809,20 @@ class Actions(object):
modified = True
if modified:
portage.util.write_atomic(x, b''.join(mylines), mode='wb')
+
+
+ def sign_manifest(self, myupdates, myremoved, mymanifests):
+ try:
+ for x in sorted(vcs_files_to_cps(
+ chain(myupdates, myremoved, mymanifests),
+ self.scanner.repolevel, self.scanner.reposplit, self.scanner.categories)):
+ self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
+ manifest_path = os.path.join(self.repoman_settings["O"], "Manifest")
+ if not need_signature(manifest_path):
+ continue
+ gpgsign(manifest_path, self.repoman_settings, self.options)
+ except portage.exception.PortageException as e:
+ portage.writemsg("!!! %s\n" % str(e))
+ portage.writemsg("!!! Disabled FEATURES='sign'\n")
+ self.repo_settings.sign_manifests = False
+
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
@ 2015-09-21 23:47 Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
0 siblings, 1 reply; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:47 UTC (permalink / raw
To: gentoo-commits
commit: 5d91183c50d57d7ddb06721a64f2ae6f95b6aeea
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 02:59:11 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=5d91183c
repoman/actions.py: Split out the commit footer to a function
pym/repoman/actions.py | 95 ++++++++++++++++++++++++++------------------------
1 file changed, 49 insertions(+), 46 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 1f70815..e9bf147 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -133,53 +133,8 @@ class Actions(object):
sys.exit(1)
commitmessage = commitmessage.rstrip()
changelog_msg = commitmessage
- portage_version = getattr(portage, "VERSION", None)
- gpg_key = self.repoman_settings.get("PORTAGE_GPG_KEY", "")
- dco_sob = self.repoman_settings.get("DCO_SIGNED_OFF_BY", "")
- if portage_version is None:
- sys.stderr.write("Failed to insert portage version in message!\n")
- sys.stderr.flush()
- portage_version = "Unknown"
-
- report_options = []
- if self.options.force:
- report_options.append("--force")
- if self.options.ignore_arches:
- report_options.append("--ignore-arches")
- if self.scanner.include_arches is not None:
- report_options.append(
- "--include-arches=\"%s\"" %
- " ".join(sorted(self.scanner.include_arches)))
-
- if self.vcs_settings.vcs == "git":
- # Use new footer only for git (see bug #438364).
- commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version
- if report_options:
- commit_footer += "\nRepoMan-Options: " + " ".join(report_options)
- if self.repo_settings.sign_manifests:
- commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, )
- if dco_sob:
- commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
- else:
- unameout = platform.system() + " "
- if platform.system() in ["Darwin", "SunOS"]:
- unameout += platform.processor()
- else:
- unameout += platform.machine()
- commit_footer = "\n\n"
- if dco_sob:
- commit_footer += "Signed-off-by: %s\n" % (dco_sob, )
- commit_footer += "(Portage version: %s/%s/%s" % \
- (portage_version, self.vcs_settings.vcs, unameout)
- if report_options:
- commit_footer += ", RepoMan options: " + " ".join(report_options)
- if self.repo_settings.sign_manifests:
- commit_footer += ", signed Manifest commit with key %s" % \
- (gpg_key, )
- else:
- commit_footer += ", unsigned Manifest commit"
- commit_footer += ")"
+ commit_footer = self.get_commit_footer()
commitmessage += commit_footer
broken_changelog_manifests = []
@@ -797,3 +752,51 @@ class Actions(object):
expansion = {}
return (mynew, mychanged, myremoved, no_expansion, expansion)
+
+ def get_commit_footer(self):
+ portage_version = getattr(portage, "VERSION", None)
+ gpg_key = self.repoman_settings.get("PORTAGE_GPG_KEY", "")
+ dco_sob = self.repoman_settings.get("DCO_SIGNED_OFF_BY", "")
+ report_options = []
+ if self.options.force:
+ report_options.append("--force")
+ if self.options.ignore_arches:
+ report_options.append("--ignore-arches")
+ if self.scanner.include_arches is not None:
+ report_options.append(
+ "--include-arches=\"%s\"" %
+ " ".join(sorted(self.scanner.include_arches)))
+
+ if portage_version is None:
+ sys.stderr.write("Failed to insert portage version in message!\n")
+ sys.stderr.flush()
+ portage_version = "Unknown"
+ # Use new footer only for git (see bug #438364).
+ if self.vcs_settings.vcs in ["git"]:
+ commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version
+ if report_options:
+ commit_footer += "\nRepoMan-Options: " + " ".join(report_options)
+ if self.repo_settings.sign_manifests:
+ commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, )
+ if dco_sob:
+ commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
+ else:
+ unameout = platform.system() + " "
+ if platform.system() in ["Darwin", "SunOS"]:
+ unameout += platform.processor()
+ else:
+ unameout += platform.machine()
+ commit_footer = "\n\n"
+ if dco_sob:
+ commit_footer += "Signed-off-by: %s\n" % (dco_sob, )
+ commit_footer += "(Portage version: %s/%s/%s" % \
+ (portage_version, self.vcs_settings.vcs, unameout)
+ if report_options:
+ commit_footer += ", RepoMan options: " + " ".join(report_options)
+ if self.repo_settings.sign_manifests:
+ commit_footer += ", signed Manifest commit with key %s" % \
+ (gpg_key, )
+ else:
+ commit_footer += ", unsigned Manifest commit"
+ commit_footer += ")"
+ return commit_footer
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
@ 2015-09-21 23:51 ` Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: 5d91183c50d57d7ddb06721a64f2ae6f95b6aeea
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 02:59:11 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=5d91183c
repoman/actions.py: Split out the commit footer to a function
pym/repoman/actions.py | 95 ++++++++++++++++++++++++++------------------------
1 file changed, 49 insertions(+), 46 deletions(-)
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index 1f70815..e9bf147 100644
--- a/pym/repoman/actions.py
+++ b/pym/repoman/actions.py
@@ -133,53 +133,8 @@ class Actions(object):
sys.exit(1)
commitmessage = commitmessage.rstrip()
changelog_msg = commitmessage
- portage_version = getattr(portage, "VERSION", None)
- gpg_key = self.repoman_settings.get("PORTAGE_GPG_KEY", "")
- dco_sob = self.repoman_settings.get("DCO_SIGNED_OFF_BY", "")
- if portage_version is None:
- sys.stderr.write("Failed to insert portage version in message!\n")
- sys.stderr.flush()
- portage_version = "Unknown"
-
- report_options = []
- if self.options.force:
- report_options.append("--force")
- if self.options.ignore_arches:
- report_options.append("--ignore-arches")
- if self.scanner.include_arches is not None:
- report_options.append(
- "--include-arches=\"%s\"" %
- " ".join(sorted(self.scanner.include_arches)))
-
- if self.vcs_settings.vcs == "git":
- # Use new footer only for git (see bug #438364).
- commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version
- if report_options:
- commit_footer += "\nRepoMan-Options: " + " ".join(report_options)
- if self.repo_settings.sign_manifests:
- commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, )
- if dco_sob:
- commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
- else:
- unameout = platform.system() + " "
- if platform.system() in ["Darwin", "SunOS"]:
- unameout += platform.processor()
- else:
- unameout += platform.machine()
- commit_footer = "\n\n"
- if dco_sob:
- commit_footer += "Signed-off-by: %s\n" % (dco_sob, )
- commit_footer += "(Portage version: %s/%s/%s" % \
- (portage_version, self.vcs_settings.vcs, unameout)
- if report_options:
- commit_footer += ", RepoMan options: " + " ".join(report_options)
- if self.repo_settings.sign_manifests:
- commit_footer += ", signed Manifest commit with key %s" % \
- (gpg_key, )
- else:
- commit_footer += ", unsigned Manifest commit"
- commit_footer += ")"
+ commit_footer = self.get_commit_footer()
commitmessage += commit_footer
broken_changelog_manifests = []
@@ -797,3 +752,51 @@ class Actions(object):
expansion = {}
return (mynew, mychanged, myremoved, no_expansion, expansion)
+
+ def get_commit_footer(self):
+ portage_version = getattr(portage, "VERSION", None)
+ gpg_key = self.repoman_settings.get("PORTAGE_GPG_KEY", "")
+ dco_sob = self.repoman_settings.get("DCO_SIGNED_OFF_BY", "")
+ report_options = []
+ if self.options.force:
+ report_options.append("--force")
+ if self.options.ignore_arches:
+ report_options.append("--ignore-arches")
+ if self.scanner.include_arches is not None:
+ report_options.append(
+ "--include-arches=\"%s\"" %
+ " ".join(sorted(self.scanner.include_arches)))
+
+ if portage_version is None:
+ sys.stderr.write("Failed to insert portage version in message!\n")
+ sys.stderr.flush()
+ portage_version = "Unknown"
+ # Use new footer only for git (see bug #438364).
+ if self.vcs_settings.vcs in ["git"]:
+ commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version
+ if report_options:
+ commit_footer += "\nRepoMan-Options: " + " ".join(report_options)
+ if self.repo_settings.sign_manifests:
+ commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, )
+ if dco_sob:
+ commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
+ else:
+ unameout = platform.system() + " "
+ if platform.system() in ["Darwin", "SunOS"]:
+ unameout += platform.processor()
+ else:
+ unameout += platform.machine()
+ commit_footer = "\n\n"
+ if dco_sob:
+ commit_footer += "Signed-off-by: %s\n" % (dco_sob, )
+ commit_footer += "(Portage version: %s/%s/%s" % \
+ (portage_version, self.vcs_settings.vcs, unameout)
+ if report_options:
+ commit_footer += ", RepoMan options: " + " ".join(report_options)
+ if self.repo_settings.sign_manifests:
+ commit_footer += ", signed Manifest commit with key %s" % \
+ (gpg_key, )
+ else:
+ commit_footer += ", unsigned Manifest commit"
+ commit_footer += ")"
+ return commit_footer
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
@ 2015-09-21 23:47 Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
0 siblings, 1 reply; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:47 UTC (permalink / raw
To: gentoo-commits
commit: 9f63c395ee23b00d77d00e667a28624de5baff49
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 17 15:29:11 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9f63c395
repoman: Move the primary checks loop to it's own class and file
Only minimal changes were done for this initial move.
The _scan_ebuilds() needs major hacking up into manageable chunks.
Clean out code separation demarcation lines
These lines were originally used to mark places where code was removed.
And replaced with a class instance and/or function call.
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>
pym/repoman/main.py | 756 ++-----------------------------------------------
pym/repoman/scanner.py | 715 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 743 insertions(+), 728 deletions(-)
diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index e3d0472..2b2f91d 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -4,7 +4,6 @@
from __future__ import print_function, unicode_literals
-import copy
import errno
import io
import logging
@@ -15,7 +14,6 @@ import sys
import tempfile
import platform
from itertools import chain
-from pprint import pformat
from os import path as osp
if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
@@ -30,14 +28,12 @@ portage._disable_legacy_globals()
from portage import os
from portage import _encodings
from portage import _unicode_encode
-from _emerge.Package import Package
from _emerge.UserQuery import UserQuery
import portage.checksum
import portage.const
import portage.repository.config
-from portage import cvstree, normalize_path
+from portage import cvstree
from portage import util
-from portage.dep import Atom
from portage.process import find_binary, spawn
from portage.output import (
bold, create_color_func, green, nocolor, red)
@@ -47,40 +43,18 @@ from portage.util import writemsg_level
from portage.package.ebuild.digestgen import digestgen
from repoman.argparser import parse_args
-from repoman.checks.directories.files import FileChecks
-from repoman.checks.ebuilds.checks import run_checks, checks_init
-from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
-from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
-from repoman.checks.ebuilds.fetches import FetchChecks
-from repoman.checks.ebuilds.keywords import KeywordChecks
-from repoman.checks.ebuilds.isebuild import IsEbuild
-from repoman.checks.ebuilds.thirdpartymirrors import ThirdPartyMirrors
-from repoman.checks.ebuilds.manifests import Manifests
-from repoman.check_missingslot import check_missingslot
-from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
-from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
-from repoman.checks.ebuilds.use_flags import USEFlagChecks
-from repoman.checks.ebuilds.variables.description import DescriptionChecks
-from repoman.checks.ebuilds.variables.eapi import EAPIChecks
-from repoman.checks.ebuilds.variables.license import LicenseChecks
-from repoman.checks.ebuilds.variables.restrict import RestrictChecks
-from repoman.ebuild import Ebuild
+from repoman.checks.ebuilds.checks import checks_init
from repoman.errors import err
from repoman.gpg import gpgsign, need_signature
-from repoman.modules.commit import repochecks
-from repoman.profile import check_profiles, dev_profile_keywords, setup_profile
from repoman.qa_data import (
format_qa_output, format_qa_output_column, qahelp,
- qawarnings, qacats, missingvars,
- suspect_virtual, suspect_rdepend)
-from repoman.qa_tracker import QATracker
-from repoman.repos import RepoSettings, repo_metadata
-from repoman.scan import Changes, scan
+ qawarnings, qacats)
+from repoman.repos import RepoSettings
+from repoman.scanner import Scanner
from repoman._subprocess import repoman_popen, repoman_getstatusoutput
from repoman import utilities
from repoman.vcs.vcs import (
git_supports_gpg_sign, vcs_files_to_cps, VCSSettings)
-from repoman.vcs.vcsstatus import VCSStatus
if sys.hexversion >= 0x3000000:
@@ -90,21 +64,11 @@ util.initialize_logger()
bad = create_color_func("BAD")
-live_eclasses = portage.const.LIVE_ECLASSES
-non_ascii_re = re.compile(r'[^\x00-\x7f]')
-
# A sane umask is needed for files that portage creates.
os.umask(0o22)
-def sort_key(item):
- return item[2].sub_path
-
def repoman_main(argv):
- # Repoman sets it's own ACCEPT_KEYWORDS and we don't want it to
- # behave incrementally.
- repoman_incrementals = tuple(
- x for x in portage.const.INCREMENTALS if x != 'ACCEPT_KEYWORDS')
config_root = os.environ.get("PORTAGE_CONFIGROOT")
repoman_settings = portage.config(config_root=config_root, local_config=False)
@@ -142,30 +106,9 @@ def repoman_main(argv):
repo_settings = RepoSettings(
config_root, portdir, portdir_overlay,
repoman_settings, vcs_settings, options, qawarnings)
-
repoman_settings = repo_settings.repoman_settings
-
portdb = repo_settings.portdb
- if options.echangelog is None and repo_settings.repo_config.update_changelog:
- options.echangelog = 'y'
-
- if vcs_settings.vcs is None:
- options.echangelog = 'n'
-
- # The --echangelog option causes automatic ChangeLog generation,
- # which invalidates changelog.ebuildadded and changelog.missing
- # checks.
- # Note: Some don't use ChangeLogs in distributed SCMs.
- # It will be generated on server side from scm log,
- # before package moves to the rsync server.
- # This is needed because they try to avoid merge collisions.
- # Gentoo's Council decided to always use the ChangeLog file.
- # TODO: shouldn't this just be switched on the repo, iso the VCS?
- is_echangelog_enabled = options.echangelog in ('y', 'force')
- vcs_settings.vcs_is_cvs_or_svn = vcs_settings.vcs in ('cvs', 'svn')
- check_changelog = not is_echangelog_enabled and vcs_settings.vcs_is_cvs_or_svn
-
if 'digest' in repoman_settings.features and options.digest != 'n':
options.digest = 'y'
@@ -178,663 +121,16 @@ def repoman_main(argv):
env = os.environ.copy()
env['FEATURES'] = env.get('FEATURES', '') + ' -unknown-features-warn'
- categories = []
- for path in repo_settings.repo_config.eclass_db.porttrees:
- categories.extend(portage.util.grabfile(
- os.path.join(path, 'profiles', 'categories')))
- repoman_settings.categories = frozenset(
- portage.util.stack_lists([categories], incremental=1))
- categories = repoman_settings.categories
-
- portdb.settings = repoman_settings
- # We really only need to cache the metadata that's necessary for visibility
- # filtering. Anything else can be discarded to reduce memory consumption.
- portdb._aux_cache_keys.clear()
- portdb._aux_cache_keys.update(
- ["EAPI", "IUSE", "KEYWORDS", "repository", "SLOT"])
-
- reposplit = myreporoot.split(os.path.sep)
- repolevel = len(reposplit)
-
- ###################
- commitmessage = None
- if options.mode == 'commit':
- repochecks.commit_check(repolevel, reposplit)
- repochecks.conflict_check(vcs_settings, options)
-
- ###################
-
- # Make startdir relative to the canonical repodir, so that we can pass
- # it to digestgen and it won't have to be canonicalized again.
- if repolevel == 1:
- startdir = repo_settings.repodir
- else:
- startdir = normalize_path(mydir)
- startdir = os.path.join(
- repo_settings.repodir, *startdir.split(os.sep)[-2 - repolevel + 3:])
- ###################
-
-
- # get lists of valid keywords, licenses, and use
- new_data = repo_metadata(repo_settings.portdb, repoman_settings)
- kwlist, liclist, uselist, profile_list, \
- global_pmaskdict, liclist_deprecated = new_data
-
- repoman_settings['PORTAGE_ARCHLIST'] = ' '.join(sorted(kwlist))
- repoman_settings.backup_changes('PORTAGE_ARCHLIST')
-
- ####################
-
- profiles = setup_profile(profile_list)
-
- ####################
-
- check_profiles(profiles, repoman_settings.archlist())
-
- ####################
-
- scanlist = scan(repolevel, reposplit, startdir, categories, repo_settings)
-
- ####################
-
- dev_keywords = dev_profile_keywords(profiles)
-
- qatracker = QATracker()
-
-
- if options.mode == "manifest":
- pass
- elif options.pretend:
- print(green("\nRepoMan does a once-over of the neighborhood..."))
- else:
- print(green("\nRepoMan scours the neighborhood..."))
-
- #####################
-
- changed = Changes(options)
- changed.scan(vcs_settings)
-
- ######################
-
- have_pmasked = False
- have_dev_keywords = False
- dofail = 0
-
- # NOTE: match-all caches are not shared due to potential
- # differences between profiles in _get_implicit_iuse.
- arch_caches = {}
- arch_xmatch_caches = {}
- shared_xmatch_caches = {"cp-list": {}}
-
- include_arches = None
- if options.include_arches:
- include_arches = set()
- include_arches.update(*[x.split() for x in options.include_arches])
-
- # Disable the "ebuild.notadded" check when not in commit mode and
- # running `svn status` in every package dir will be too expensive.
-
- check_ebuild_notadded = not \
- (vcs_settings.vcs == "svn" and repolevel < 3 and options.mode != "commit")
-
- effective_scanlist = scanlist
- if options.if_modified == "y":
- effective_scanlist = sorted(vcs_files_to_cps(
- chain(changed.changed, changed.new, changed.removed),
- repolevel, reposplit, categories))
-
- ######################
- # initialize our checks classes here before the big xpkg loop
- manifester = Manifests(options, qatracker, repoman_settings)
- is_ebuild = IsEbuild(repoman_settings, repo_settings, portdb, qatracker)
- filescheck = FileChecks(
- qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
- status_check = VCSStatus(vcs_settings, qatracker)
- fetchcheck = FetchChecks(
- qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
- pkgmeta = PkgMetadata(options, qatracker, repoman_settings)
- thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
- use_flag_checks = USEFlagChecks(qatracker, uselist)
- keywordcheck = KeywordChecks(qatracker, options)
- liveeclasscheck = LiveEclassChecks(qatracker)
- rubyeclasscheck = RubyEclassChecks(qatracker)
- eapicheck = EAPIChecks(qatracker, repo_settings)
- descriptioncheck = DescriptionChecks(qatracker)
- licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
- restrictcheck = RestrictChecks(qatracker)
- ######################
-
- for xpkg in effective_scanlist:
- # ebuilds and digests added to cvs respectively.
- logging.info("checking package %s" % xpkg)
- # save memory by discarding xmatch caches from previous package(s)
- arch_xmatch_caches.clear()
- eadded = []
- catdir, pkgdir = xpkg.split("/")
- checkdir = repo_settings.repodir + "/" + xpkg
- checkdir_relative = ""
- if repolevel < 3:
- checkdir_relative = os.path.join(pkgdir, checkdir_relative)
- if repolevel < 2:
- checkdir_relative = os.path.join(catdir, checkdir_relative)
- checkdir_relative = os.path.join(".", checkdir_relative)
-
- #####################
- if manifester.run(checkdir, portdb):
- continue
- if not manifester.generated_manifest:
- manifester.digest_check(xpkg, checkdir)
- ######################
-
- if options.mode == 'manifest-check':
- continue
-
- checkdirlist = os.listdir(checkdir)
-
- ######################
- pkgs, allvalid = is_ebuild.check(checkdirlist, checkdir, xpkg)
- if is_ebuild.continue_:
- # If we can't access all the metadata then it's totally unsafe to
- # commit since there's no way to generate a correct Manifest.
- # 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.
- can_force = False
- continue
- ######################
-
- keywordcheck.prepare()
-
- # Sort ebuilds in ascending order for the KEYWORDS.dropped check.
- ebuildlist = sorted(pkgs.values())
- ebuildlist = [pkg.pf for pkg in ebuildlist]
- #######################
- filescheck.check(
- checkdir, checkdirlist, checkdir_relative, changed.changed, changed.new)
- #######################
- status_check.check(check_ebuild_notadded, checkdir, checkdir_relative, xpkg)
- eadded.extend(status_check.eadded)
-
- #################
- fetchcheck.check(
- xpkg, checkdir, checkdir_relative, changed.changed, changed.new)
- #################
-
- if check_changelog and "ChangeLog" not in checkdirlist:
- qatracker.add_error("changelog.missing", xpkg + "/ChangeLog")
- #################
- pkgmeta.check(xpkg, checkdir, checkdirlist, repolevel)
- muselist = frozenset(pkgmeta.musedict)
- #################
-
- changelog_path = os.path.join(checkdir_relative, "ChangeLog")
- changelog_modified = changelog_path in changed.changelogs
-
- # detect unused local USE-descriptions
- used_useflags = set()
-
- for y_ebuild in ebuildlist:
- ##################
- ebuild = Ebuild(
- repo_settings, repolevel, pkgdir, catdir, vcs_settings,
- xpkg, y_ebuild)
- ##################
-
- if check_changelog and not changelog_modified \
- and ebuild.ebuild_path in changed.new_ebuilds:
- qatracker.add_error('changelog.ebuildadded', ebuild.relative_path)
-
- if ebuild.untracked(check_ebuild_notadded, y_ebuild, eadded):
- # ebuild not added to vcs
- qatracker.add_error(
- "ebuild.notadded", xpkg + "/" + y_ebuild + ".ebuild")
-
- ##################
- if bad_split_check(xpkg, y_ebuild, pkgdir, qatracker):
- continue
- ###################
- pkg = pkgs[y_ebuild]
- if pkg_invalid(pkg, qatracker, ebuild):
- allvalid = False
- continue
-
- myaux = pkg._metadata
- eapi = myaux["EAPI"]
- inherited = pkg.inherited
- live_ebuild = live_eclasses.intersection(inherited)
-
- #######################
- eapicheck.check(pkg, ebuild)
- #######################
-
- for k, v in myaux.items():
- if not isinstance(v, basestring):
- continue
- m = non_ascii_re.search(v)
- if m is not None:
- qatracker.add_error(
- "variable.invalidchar",
- "%s: %s variable contains non-ASCII "
- "character at position %s" %
- (ebuild.relative_path, k, m.start() + 1))
-
- if not fetchcheck.src_uri_error:
- #######################
- thirdparty.check(myaux, ebuild.relative_path)
- #######################
- if myaux.get("PROVIDE"):
- qatracker.add_error("virtual.oldstyle", ebuild.relative_path)
-
- for pos, missing_var in enumerate(missingvars):
- if not myaux.get(missing_var):
- if catdir == "virtual" and \
- missing_var in ("HOMEPAGE", "LICENSE"):
- continue
- if live_ebuild and missing_var == "KEYWORDS":
- continue
- myqakey = missingvars[pos] + ".missing"
- qatracker.add_error(myqakey, xpkg + "/" + y_ebuild + ".ebuild")
-
- if catdir == "virtual":
- for var in ("HOMEPAGE", "LICENSE"):
- if myaux.get(var):
- myqakey = var + ".virtual"
- qatracker.add_error(myqakey, ebuild.relative_path)
-
- #######################
- descriptioncheck.check(pkg, ebuild)
- #######################
-
- keywords = myaux["KEYWORDS"].split()
-
- ebuild_archs = set(
- kw.lstrip("~") for kw in keywords if not kw.startswith("-"))
-
- #######################
- keywordcheck.check(
- pkg, xpkg, ebuild, y_ebuild, keywords, ebuild_archs, changed,
- live_ebuild, kwlist, profiles)
- #######################
-
- if live_ebuild and repo_settings.repo_config.name == "gentoo":
- #######################
- liveeclasscheck.check(
- pkg, xpkg, ebuild, y_ebuild, keywords, global_pmaskdict)
- #######################
-
- if options.ignore_arches:
- arches = [[
- repoman_settings["ARCH"], repoman_settings["ARCH"],
- repoman_settings["ACCEPT_KEYWORDS"].split()]]
- else:
- arches = set()
- for keyword in keywords:
- if keyword[0] == "-":
- continue
- elif keyword[0] == "~":
- arch = keyword[1:]
- if arch == "*":
- for expanded_arch in profiles:
- if expanded_arch == "**":
- continue
- arches.add(
- (keyword, expanded_arch, (
- expanded_arch, "~" + expanded_arch)))
- else:
- arches.add((keyword, arch, (arch, keyword)))
- else:
- if keyword == "*":
- for expanded_arch in profiles:
- if expanded_arch == "**":
- continue
- arches.add(
- (keyword, expanded_arch, (expanded_arch,)))
- else:
- arches.add((keyword, keyword, (keyword,)))
- if not arches:
- # Use an empty profile for checking dependencies of
- # packages that have empty KEYWORDS.
- arches.add(('**', '**', ('**',)))
-
- unknown_pkgs = set()
- baddepsyntax = False
- badlicsyntax = False
- badprovsyntax = False
- # catpkg = catdir + "/" + y_ebuild
-
- inherited_java_eclass = "java-pkg-2" in inherited or \
- "java-pkg-opt-2" in inherited
- inherited_wxwidgets_eclass = "wxwidgets" in inherited
- # operator_tokens = set(["||", "(", ")"])
- type_list, badsyntax = [], []
- for mytype in Package._dep_keys + ("LICENSE", "PROPERTIES", "PROVIDE"):
- mydepstr = myaux[mytype]
-
- buildtime = mytype in Package._buildtime_keys
- runtime = mytype in Package._runtime_keys
- token_class = None
- if mytype.endswith("DEPEND"):
- token_class = portage.dep.Atom
+ # Perform the main checks
+ scanner = Scanner(repo_settings, myreporoot, config_root, options,
+ vcs_settings, mydir, env)
+ qatracker, can_force = scanner.scan_pkgs(can_force)
- try:
- atoms = portage.dep.use_reduce(
- mydepstr, matchall=1, flat=True,
- is_valid_flag=pkg.iuse.is_valid_flag, token_class=token_class)
- except portage.exception.InvalidDependString as e:
- atoms = None
- badsyntax.append(str(e))
-
- if atoms and mytype.endswith("DEPEND"):
- if runtime and \
- "test?" in mydepstr.split():
- qatracker.add_error(
- mytype + '.suspect',
- "%s: 'test?' USE conditional in %s" %
- (ebuild.relative_path, mytype))
-
- for atom in atoms:
- if atom == "||":
- continue
-
- is_blocker = atom.blocker
-
- # Skip dependency.unknown for blockers, so that we
- # don't encourage people to remove necessary blockers,
- # as discussed in bug 382407. We use atom.without_use
- # due to bug 525376.
- if not is_blocker and \
- not portdb.xmatch("match-all", atom.without_use) and \
- not atom.cp.startswith("virtual/"):
- unknown_pkgs.add((mytype, atom.unevaluated_atom))
-
- if catdir != "virtual":
- if not is_blocker and \
- atom.cp in suspect_virtual:
- qatracker.add_error(
- 'virtual.suspect', ebuild.relative_path +
- ": %s: consider using '%s' instead of '%s'" %
- (mytype, suspect_virtual[atom.cp], atom))
- if not is_blocker and \
- atom.cp.startswith("perl-core/"):
- qatracker.add_error('dependency.perlcore',
- ebuild.relative_path +
- ": %s: please use '%s' instead of '%s'" %
- (mytype,
- atom.replace("perl-core/","virtual/perl-"),
- atom))
-
- if buildtime and \
- not is_blocker and \
- not inherited_java_eclass and \
- atom.cp == "virtual/jdk":
- qatracker.add_error(
- 'java.eclassesnotused', ebuild.relative_path)
- elif buildtime and \
- not is_blocker and \
- not inherited_wxwidgets_eclass and \
- atom.cp == "x11-libs/wxGTK":
- qatracker.add_error(
- 'wxwidgets.eclassnotused',
- "%s: %ss on x11-libs/wxGTK without inheriting"
- " wxwidgets.eclass" % (ebuild.relative_path, mytype))
- elif runtime:
- if not is_blocker and \
- atom.cp in suspect_rdepend:
- qatracker.add_error(
- mytype + '.suspect',
- ebuild.relative_path + ": '%s'" % atom)
-
- if atom.operator == "~" and \
- portage.versions.catpkgsplit(atom.cpv)[3] != "r0":
- qacat = 'dependency.badtilde'
- qatracker.add_error(
- qacat, "%s: %s uses the ~ operator"
- " with a non-zero revision: '%s'" %
- (ebuild.relative_path, mytype, atom))
-
- check_missingslot(atom, mytype, eapi, portdb, qatracker,
- ebuild.relative_path, myaux)
-
- type_list.extend([mytype] * (len(badsyntax) - len(type_list)))
-
- for m, b in zip(type_list, badsyntax):
- if m.endswith("DEPEND"):
- qacat = "dependency.syntax"
- else:
- qacat = m + ".syntax"
- qatracker.add_error(
- qacat, "%s: %s: %s" % (ebuild.relative_path, m, b))
-
- badlicsyntax = len([z for z in type_list if z == "LICENSE"])
- badprovsyntax = len([z for z in type_list if z == "PROVIDE"])
- baddepsyntax = len(type_list) != badlicsyntax + badprovsyntax
- badlicsyntax = badlicsyntax > 0
- badprovsyntax = badprovsyntax > 0
-
- #################
- use_flag_checks.check(pkg, xpkg, ebuild, y_ebuild, muselist)
-
- ebuild_used_useflags = use_flag_checks.getUsedUseFlags()
- used_useflags = used_useflags.union(ebuild_used_useflags)
- #################
- rubyeclasscheck.check(pkg, ebuild)
- #################
-
- # license checks
- if not badlicsyntax:
- #################
- licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
- #################
-
- #################
- restrictcheck.check(pkg, xpkg, ebuild, y_ebuild)
- #################
-
- # Syntax Checks
-
- if not vcs_settings.vcs_preserves_mtime:
- if ebuild.ebuild_path not in changed.new_ebuilds and \
- ebuild.ebuild_path not in changed.ebuilds:
- pkg.mtime = None
- try:
- # All ebuilds should have utf_8 encoding.
- f = io.open(
- _unicode_encode(
- ebuild.full_path, encoding=_encodings['fs'], errors='strict'),
- mode='r', encoding=_encodings['repo.content'])
- try:
- for check_name, e in run_checks(f, pkg):
- qatracker.add_error(
- check_name, ebuild.relative_path + ': %s' % e)
- finally:
- f.close()
- except UnicodeDecodeError:
- # A file.UTF8 failure will have already been recorded above.
- pass
-
- if options.force:
- # The dep_check() calls are the most expensive QA test. If --force
- # is enabled, there's no point in wasting time on these since the
- # user is intent on forcing the commit anyway.
- continue
-
- relevant_profiles = []
- for keyword, arch, groups in arches:
- if arch not in profiles:
- # A missing profile will create an error further down
- # during the KEYWORDS verification.
- continue
-
- if include_arches is not None:
- if arch not in include_arches:
- continue
-
- relevant_profiles.extend(
- (keyword, groups, prof) for prof in profiles[arch])
-
- relevant_profiles.sort(key=sort_key)
-
- for keyword, groups, prof in relevant_profiles:
-
- is_stable_profile = prof.status == "stable"
- is_dev_profile = prof.status == "dev" and \
- options.include_dev
- is_exp_profile = prof.status == "exp" and \
- options.include_exp_profiles == 'y'
- if not (is_stable_profile or is_dev_profile or is_exp_profile):
- continue
+ commitmessage = None
- dep_settings = arch_caches.get(prof.sub_path)
- if dep_settings is None:
- dep_settings = portage.config(
- config_profile_path=prof.abs_path,
- config_incrementals=repoman_incrementals,
- config_root=config_root,
- local_config=False,
- _unmatched_removal=options.unmatched_removal,
- env=env, repositories=repoman_settings.repositories)
- dep_settings.categories = repoman_settings.categories
- if options.without_mask:
- dep_settings._mask_manager_obj = \
- copy.deepcopy(dep_settings._mask_manager)
- dep_settings._mask_manager._pmaskdict.clear()
- arch_caches[prof.sub_path] = dep_settings
-
- xmatch_cache_key = (prof.sub_path, tuple(groups))
- xcache = arch_xmatch_caches.get(xmatch_cache_key)
- if xcache is None:
- portdb.melt()
- portdb.freeze()
- xcache = portdb.xcache
- xcache.update(shared_xmatch_caches)
- arch_xmatch_caches[xmatch_cache_key] = xcache
-
- repo_settings.trees[repo_settings.root]["porttree"].settings = dep_settings
- portdb.settings = dep_settings
- portdb.xcache = xcache
-
- dep_settings["ACCEPT_KEYWORDS"] = " ".join(groups)
- # just in case, prevent config.reset() from nuking these.
- dep_settings.backup_changes("ACCEPT_KEYWORDS")
-
- # This attribute is used in dbapi._match_use() to apply
- # use.stable.{mask,force} settings based on the stable
- # status of the parent package. This is required in order
- # for USE deps of unstable packages to be resolved correctly,
- # since otherwise use.stable.{mask,force} settings of
- # dependencies may conflict (see bug #456342).
- dep_settings._parent_stable = dep_settings._isStable(pkg)
-
- # Handle package.use*.{force,mask) calculation, for use
- # in dep_check.
- dep_settings.useforce = dep_settings._use_manager.getUseForce(
- pkg, stable=dep_settings._parent_stable)
- dep_settings.usemask = dep_settings._use_manager.getUseMask(
- pkg, stable=dep_settings._parent_stable)
-
- if not baddepsyntax:
- ismasked = not ebuild_archs or \
- pkg.cpv not in portdb.xmatch("match-visible",
- Atom("%s::%s" % (pkg.cp, repo_settings.repo_config.name)))
- if ismasked:
- if not have_pmasked:
- have_pmasked = bool(dep_settings._getMaskAtom(
- pkg.cpv, pkg._metadata))
- if options.ignore_masked:
- continue
- # we are testing deps for a masked package; give it some lee-way
- suffix = "masked"
- matchmode = "minimum-all"
- else:
- suffix = ""
- matchmode = "minimum-visible"
-
- if not have_dev_keywords:
- have_dev_keywords = \
- bool(dev_keywords.intersection(keywords))
-
- if prof.status == "dev":
- suffix = suffix + "indev"
-
- for mytype in Package._dep_keys:
-
- mykey = "dependency.bad" + suffix
- myvalue = myaux[mytype]
- if not myvalue:
- continue
-
- success, atoms = portage.dep_check(
- myvalue, portdb, dep_settings,
- use="all", mode=matchmode, trees=repo_settings.trees)
-
- if success:
- if atoms:
-
- # Don't bother with dependency.unknown for
- # cases in which *DEPEND.bad is triggered.
- for atom in atoms:
- # dep_check returns all blockers and they
- # aren't counted for *DEPEND.bad, so we
- # ignore them here.
- if not atom.blocker:
- unknown_pkgs.discard(
- (mytype, atom.unevaluated_atom))
-
- if not prof.sub_path:
- # old-style virtuals currently aren't
- # resolvable with empty profile, since
- # 'virtuals' mappings are unavailable
- # (it would be expensive to search
- # for PROVIDE in all ebuilds)
- atoms = [
- atom for atom in atoms if not (
- atom.cp.startswith('virtual/')
- and not portdb.cp_list(atom.cp))]
-
- # we have some unsolvable deps
- # remove ! deps, which always show up as unsatisfiable
- atoms = [
- str(atom.unevaluated_atom)
- for atom in atoms if not atom.blocker]
-
- # if we emptied out our list, continue:
- if not atoms:
- continue
- qatracker.add_error(mykey,
- "%s: %s: %s(%s)\n%s"
- % (ebuild.relative_path, mytype, keyword, prof,
- pformat(atoms, indent=6)))
- else:
- qatracker.add_error(mykey,
- "%s: %s: %s(%s)\n%s"
- % (ebuild.relative_path, mytype, keyword, prof,
- pformat(atoms, indent=6)))
-
- if not baddepsyntax and unknown_pkgs:
- type_map = {}
- for mytype, atom in unknown_pkgs:
- type_map.setdefault(mytype, set()).add(atom)
- for mytype, atoms in type_map.items():
- qatracker.add_error(
- "dependency.unknown", "%s: %s: %s"
- % (ebuild.relative_path, mytype, ", ".join(sorted(atoms))))
-
- # check if there are unused local USE-descriptions in metadata.xml
- # (unless there are any invalids, to avoid noise)
- if allvalid:
- for myflag in muselist.difference(used_useflags):
- qatracker.add_error(
- "metadata.warning",
- "%s/metadata.xml: unused local USE-description: '%s'"
- % (xpkg, myflag))
-
-
- if options.if_modified == "y" and len(effective_scanlist) < 1:
+ if options.if_modified == "y" and len(scanner.effective_scanlist) < 1:
logging.warning("--if-modified is enabled, but no modified packages were found!")
- if options.mode == "manifest":
- sys.exit(dofail)
-
# dofail will be true if we have failed in at least one non-warning category
dofail = 0
# dowarn will be true if we tripped any warnings
@@ -842,6 +138,10 @@ def repoman_main(argv):
# dofull will be true if we should print a "repoman full" informational message
dofull = options.mode != 'full'
+ # early out for manifest generation
+ if options.mode == "manifest":
+ sys.exit(dofail)
+
for x in qacats:
if x not in qatracker.fails:
continue
@@ -884,9 +184,9 @@ def repoman_main(argv):
suggest_ignore_masked = False
suggest_include_dev = False
- if have_pmasked and not (options.without_mask or options.ignore_masked):
+ if scanner.have['pmasked'] and not (options.without_mask or options.ignore_masked):
suggest_ignore_masked = True
- if have_dev_keywords and not options.include_dev:
+ if scanner.have['dev_keywords'] and not options.include_dev:
suggest_include_dev = True
if suggest_ignore_masked or suggest_include_dev:
@@ -1164,8 +464,8 @@ def repoman_main(argv):
commitmessagefile = None
if not commitmessage or not commitmessage.strip():
msg_prefix = ""
- if repolevel > 1:
- msg_prefix = "/".join(reposplit[1:]) + ": "
+ if scanner.repolevel > 1:
+ msg_prefix = "/".join(scanner.reposplit[1:]) + ": "
try:
editor = os.environ.get("EDITOR")
@@ -1196,10 +496,10 @@ def repoman_main(argv):
report_options.append("--force")
if options.ignore_arches:
report_options.append("--ignore-arches")
- if include_arches is not None:
+ if scanner.include_arches is not None:
report_options.append(
"--include-arches=\"%s\"" %
- " ".join(sorted(include_arches)))
+ " ".join(sorted(scanner.include_arches)))
if vcs_settings.vcs == "git":
# Use new footer only for git (see bug #438364).
@@ -1238,18 +538,18 @@ def repoman_main(argv):
committer_name = utilities.get_committer_name(env=repoman_settings)
for x in sorted(vcs_files_to_cps(
chain(myupdates, mymanifests, myremoved),
- repolevel, reposplit, categories)):
+ scanner.repolevel, scanner.reposplit, scanner.categories)):
catdir, pkgdir = x.split("/")
checkdir = repo_settings.repodir + "/" + x
checkdir_relative = ""
- if repolevel < 3:
+ if scanner.repolevel < 3:
checkdir_relative = os.path.join(pkgdir, checkdir_relative)
- if repolevel < 2:
+ if scanner.repolevel < 2:
checkdir_relative = os.path.join(catdir, checkdir_relative)
checkdir_relative = os.path.join(".", checkdir_relative)
changelog_path = os.path.join(checkdir_relative, "ChangeLog")
- changelog_modified = changelog_path in changed.changelogs
+ changelog_modified = changelog_path in scanner.changed.changelogs
if changelog_modified and options.echangelog != 'force':
continue
@@ -1459,7 +759,7 @@ def repoman_main(argv):
if modified:
portage.util.write_atomic(x, b''.join(mylines), mode='wb')
- if repolevel == 1:
+ if scanner.repolevel == 1:
utilities.repoman_sez(
"\"You're rather crazy... "
"doing the entire repository.\"\n")
@@ -1467,7 +767,7 @@ def repoman_main(argv):
if vcs_settings.vcs in ('cvs', 'svn') and (myupdates or myremoved):
for x in sorted(vcs_files_to_cps(
chain(myupdates, myremoved, mymanifests),
- repolevel, reposplit, categories)):
+ scanner.repolevel, scanner.reposplit, scanner.categories)):
repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
digestgen(mysettings=repoman_settings, myportdb=portdb)
@@ -1480,7 +780,7 @@ def repoman_main(argv):
try:
for x in sorted(vcs_files_to_cps(
chain(myupdates, myremoved, mymanifests),
- repolevel, reposplit, categories)):
+ scanner.repolevel, scanner.reposplit, scanner.categories)):
repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
manifest_path = os.path.join(repoman_settings["O"], "Manifest")
if not need_signature(manifest_path):
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
new file mode 100644
index 0000000..44ff33b
--- /dev/null
+++ b/pym/repoman/scanner.py
@@ -0,0 +1,715 @@
+
+import copy
+import io
+import logging
+import re
+import sys
+from itertools import chain
+from pprint import pformat
+
+from _emerge.Package import Package
+
+import portage
+from portage import normalize_path
+from portage import os
+from portage import _encodings
+from portage import _unicode_encode
+from portage.dep import Atom
+from portage.output import green
+from repoman.checks.directories.files import FileChecks
+from repoman.checks.ebuilds.checks import run_checks
+from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
+from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
+from repoman.checks.ebuilds.fetches import FetchChecks
+from repoman.checks.ebuilds.keywords import KeywordChecks
+from repoman.checks.ebuilds.isebuild import IsEbuild
+from repoman.checks.ebuilds.thirdpartymirrors import ThirdPartyMirrors
+from repoman.checks.ebuilds.manifests import Manifests
+from repoman.check_missingslot import check_missingslot
+from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
+from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
+from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.description import DescriptionChecks
+from repoman.checks.ebuilds.variables.eapi import EAPIChecks
+from repoman.checks.ebuilds.variables.license import LicenseChecks
+from repoman.checks.ebuilds.variables.restrict import RestrictChecks
+from repoman.ebuild import Ebuild
+from repoman.modules.commit import repochecks
+from repoman.profile import check_profiles, dev_profile_keywords, setup_profile
+from repoman.qa_data import missingvars, suspect_virtual, suspect_rdepend
+from repoman.qa_tracker import QATracker
+from repoman.repos import repo_metadata
+from repoman.scan import Changes, scan
+from repoman.vcs.vcsstatus import VCSStatus
+from repoman.vcs.vcs import vcs_files_to_cps
+
+if sys.hexversion >= 0x3000000:
+ basestring = str
+
+NON_ASCII_RE = re.compile(r'[^\x00-\x7f]')
+
+
+def sort_key(item):
+ return item[2].sub_path
+
+
+
+class Scanner(object):
+ '''Primary scan class. Operates all the small Q/A tests and checks'''
+
+ def __init__(self, repo_settings, myreporoot, config_root, options,
+ vcs_settings, mydir, env):
+ '''Class __init__'''
+ self.repo_settings = repo_settings
+ self.config_root = config_root
+ self.options = options
+ self.vcs_settings = vcs_settings
+ self.env = env
+
+ # Repoman sets it's own ACCEPT_KEYWORDS and we don't want it to
+ # behave incrementally.
+ self.repoman_incrementals = tuple(
+ x for x in portage.const.INCREMENTALS if x != 'ACCEPT_KEYWORDS')
+
+ self.categories = []
+ for path in self.repo_settings.repo_config.eclass_db.porttrees:
+ self.categories.extend(portage.util.grabfile(
+ os.path.join(path, 'profiles', 'categories')))
+ self.repo_settings.repoman_settings.categories = frozenset(
+ portage.util.stack_lists([self.categories], incremental=1))
+ self.categories = self.repo_settings.repoman_settings.categories
+
+ self.portdb = repo_settings.portdb
+ self.portdb.settings = self.repo_settings.repoman_settings
+ # We really only need to cache the metadata that's necessary for visibility
+ # filtering. Anything else can be discarded to reduce memory consumption.
+ self.portdb._aux_cache_keys.clear()
+ self.portdb._aux_cache_keys.update(
+ ["EAPI", "IUSE", "KEYWORDS", "repository", "SLOT"])
+
+ self.reposplit = myreporoot.split(os.path.sep)
+ self.repolevel = len(self.reposplit)
+
+ if self.options.mode == 'commit':
+ repochecks.commit_check(self.repolevel, self.reposplit)
+ repochecks.conflict_check(self.vcs_settings, self.options)
+
+ # Make startdir relative to the canonical repodir, so that we can pass
+ # it to digestgen and it won't have to be canonicalized again.
+ if self.repolevel == 1:
+ startdir = self.repo_settings.repodir
+ else:
+ startdir = normalize_path(mydir)
+ startdir = os.path.join(
+ self.repo_settings.repodir, *startdir.split(os.sep)[-2 - self.repolevel + 3:])
+
+ # get lists of valid keywords, licenses, and use
+ new_data = repo_metadata(self.portdb, self.repo_settings.repoman_settings)
+ kwlist, liclist, uselist, profile_list, \
+ global_pmaskdict, liclist_deprecated = new_data
+ self.repo_metadata = {
+ 'kwlist': kwlist,
+ 'liclist': liclist,
+ 'uselist': uselist,
+ 'profile_list': profile_list,
+ 'pmaskdict': global_pmaskdict,
+ 'lic_deprecated': liclist_deprecated,
+ }
+
+ self.repo_settings.repoman_settings['PORTAGE_ARCHLIST'] = ' '.join(sorted(kwlist))
+ self.repo_settings.repoman_settings.backup_changes('PORTAGE_ARCHLIST')
+
+ self.profiles = setup_profile(profile_list)
+
+ check_profiles(self.profiles, self.repo_settings.repoman_settings.archlist())
+
+ scanlist = scan(self.repolevel, self.reposplit, startdir, self.categories, self.repo_settings)
+
+ self.dev_keywords = dev_profile_keywords(self.profiles)
+
+ self.qatracker = QATracker()
+
+ if self.options.echangelog is None and self.repo_settings.repo_config.update_changelog:
+ self.options.echangelog = 'y'
+
+ if self.vcs_settings.vcs is None:
+ self.options.echangelog = 'n'
+
+ self.check = {}
+ # The --echangelog option causes automatic ChangeLog generation,
+ # which invalidates changelog.ebuildadded and changelog.missing
+ # checks.
+ # Note: Some don't use ChangeLogs in distributed SCMs.
+ # It will be generated on server side from scm log,
+ # before package moves to the rsync server.
+ # This is needed because they try to avoid merge collisions.
+ # Gentoo's Council decided to always use the ChangeLog file.
+ # TODO: shouldn't this just be switched on the repo, iso the VCS?
+ is_echangelog_enabled = self.options.echangelog in ('y', 'force')
+ self.vcs_settings.vcs_is_cvs_or_svn = self.vcs_settings.vcs in ('cvs', 'svn')
+ self.check['changelog'] = not is_echangelog_enabled and self.vcs_settings.vcs_is_cvs_or_svn
+
+ if self.options.mode == "manifest":
+ pass
+ elif self.options.pretend:
+ print(green("\nRepoMan does a once-over of the neighborhood..."))
+ else:
+ print(green("\nRepoMan scours the neighborhood..."))
+
+ self.changed = Changes(self.options)
+ self.changed.scan(self.vcs_settings)
+
+ self.have = {
+ 'pmasked': False,
+ 'dev_keywords': False,
+ }
+
+ # NOTE: match-all caches are not shared due to potential
+ # differences between profiles in _get_implicit_iuse.
+ self.caches = {
+ 'arch': {},
+ 'arch_xmatch': {},
+ 'shared_xmatch': {"cp-list": {}},
+ }
+
+ self.include_arches = None
+ if self.options.include_arches:
+ self.include_arches = set()
+ self.include_arches.update(*[x.split() for x in self.options.include_arches])
+
+ # Disable the "ebuild.notadded" check when not in commit mode and
+ # running `svn status` in every package dir will be too expensive.
+ self.check['ebuild_notadded'] = not \
+ (self.vcs_settings.vcs == "svn" and self.repolevel < 3 and self.options.mode != "commit")
+
+ self.effective_scanlist = scanlist
+ if self.options.if_modified == "y":
+ self.effective_scanlist = sorted(vcs_files_to_cps(
+ chain(self.changed.changed, self.changed.new, self.changed.removed),
+ self.repolevel, self.reposplit, self.categories))
+
+ self.live_eclasses = portage.const.LIVE_ECLASSES
+
+ # initialize our checks classes here before the big xpkg loop
+ self.manifester = Manifests(self.options, self.qatracker, self.repo_settings.repoman_settings)
+ self.is_ebuild = IsEbuild(self.repo_settings.repoman_settings, self.repo_settings, self.portdb, self.qatracker)
+ self.filescheck = FileChecks(
+ self.qatracker, self.repo_settings.repoman_settings, self.repo_settings, self.portdb, self.vcs_settings)
+ self.status_check = VCSStatus(self.vcs_settings, self.qatracker)
+ self.fetchcheck = FetchChecks(
+ self.qatracker, self.repo_settings.repoman_settings, self.repo_settings, self.portdb, self.vcs_settings)
+ self.pkgmeta = PkgMetadata(self.options, self.qatracker, self.repo_settings.repoman_settings)
+ self.thirdparty = ThirdPartyMirrors(self.repo_settings.repoman_settings, self.qatracker)
+ self.use_flag_checks = USEFlagChecks(self.qatracker, uselist)
+ self.keywordcheck = KeywordChecks(self.qatracker, self.options)
+ self.liveeclasscheck = LiveEclassChecks(self.qatracker)
+ self.rubyeclasscheck = RubyEclassChecks(self.qatracker)
+ self.eapicheck = EAPIChecks(self.qatracker, self.repo_settings)
+ self.descriptioncheck = DescriptionChecks(self.qatracker)
+ self.licensecheck = LicenseChecks(self.qatracker, liclist, liclist_deprecated)
+ self.restrictcheck = RestrictChecks(self.qatracker)
+
+
+ def scan_pkgs(self, can_force):
+ for xpkg in self.effective_scanlist:
+ # ebuilds and digests added to cvs respectively.
+ logging.info("checking package %s" % xpkg)
+ # save memory by discarding xmatch caches from previous package(s)
+ self.caches['arch_xmatch'].clear()
+ self.eadded = []
+ catdir, pkgdir = xpkg.split("/")
+ checkdir = self.repo_settings.repodir + "/" + xpkg
+ checkdir_relative = ""
+ if self.repolevel < 3:
+ checkdir_relative = os.path.join(pkgdir, checkdir_relative)
+ if self.repolevel < 2:
+ checkdir_relative = os.path.join(catdir, checkdir_relative)
+ checkdir_relative = os.path.join(".", checkdir_relative)
+
+ if self.manifester.run(checkdir, self.portdb):
+ continue
+ if not self.manifester.generated_manifest:
+ self.manifester.digest_check(xpkg, checkdir)
+ if self.options.mode == 'manifest-check':
+ continue
+
+ checkdirlist = os.listdir(checkdir)
+
+ self.pkgs, self.allvalid = self.is_ebuild.check(checkdirlist, checkdir, xpkg)
+ if self.is_ebuild.continue_:
+ # If we can't access all the metadata then it's totally unsafe to
+ # commit since there's no way to generate a correct Manifest.
+ # 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.
+ can_force = False
+ continue
+
+ self.keywordcheck.prepare()
+
+ # Sort ebuilds in ascending order for the KEYWORDS.dropped check.
+ ebuildlist = sorted(self.pkgs.values())
+ ebuildlist = [pkg.pf for pkg in ebuildlist]
+
+ self.filescheck.check(
+ checkdir, checkdirlist, checkdir_relative, self.changed.changed, self.changed.new)
+
+ self.status_check.check(self.check['ebuild_notadded'], checkdir, checkdir_relative, xpkg)
+ self.eadded.extend(self.status_check.eadded)
+
+ self.fetchcheck.check(
+ xpkg, checkdir, checkdir_relative, self.changed.changed, self.changed.new)
+
+ if self.check['changelog'] and "ChangeLog" not in checkdirlist:
+ self.qatracker.add_error("changelog.missing", xpkg + "/ChangeLog")
+
+ self.pkgmeta.check(xpkg, checkdir, checkdirlist, self.repolevel)
+ self.muselist = frozenset(self.pkgmeta.musedict)
+
+ changelog_path = os.path.join(checkdir_relative, "ChangeLog")
+ self.changelog_modified = changelog_path in self.changed.changelogs
+
+ self._scan_ebuilds(ebuildlist, xpkg, catdir, pkgdir)
+ return self.qatracker, can_force
+
+
+ def _scan_ebuilds(self, ebuildlist, xpkg, catdir, pkgdir):
+ # detect unused local USE-descriptions
+ used_useflags = set()
+
+ for y_ebuild in ebuildlist:
+
+ ebuild = Ebuild(
+ self.repo_settings, self.repolevel, pkgdir, catdir, self.vcs_settings,
+ xpkg, y_ebuild)
+
+ if self.check['changelog'] and not self.changelog_modified \
+ and ebuild.ebuild_path in self.changed.new_ebuilds:
+ self.qatracker.add_error('changelog.ebuildadded', ebuild.relative_path)
+
+ if ebuild.untracked(self.check['ebuild_notadded'], y_ebuild, self.eadded):
+ # ebuild not added to vcs
+ self.qatracker.add_error(
+ "ebuild.notadded", xpkg + "/" + y_ebuild + ".ebuild")
+
+ if bad_split_check(xpkg, y_ebuild, pkgdir, self.qatracker):
+ continue
+
+ pkg = self.pkgs[y_ebuild]
+ if pkg_invalid(pkg, self.qatracker, ebuild):
+ self.allvalid = False
+ continue
+
+ myaux = pkg._metadata
+ eapi = myaux["EAPI"]
+ inherited = pkg.inherited
+ live_ebuild = self.live_eclasses.intersection(inherited)
+
+ self.eapicheck.check(pkg, ebuild)
+
+ for k, v in myaux.items():
+ if not isinstance(v, basestring):
+ continue
+ m = NON_ASCII_RE.search(v)
+ if m is not None:
+ self.qatracker.add_error(
+ "variable.invalidchar",
+ "%s: %s variable contains non-ASCII "
+ "character at position %s" %
+ (ebuild.relative_path, k, m.start() + 1))
+
+ if not self.fetchcheck.src_uri_error:
+ self.thirdparty.check(myaux, ebuild.relative_path)
+
+ if myaux.get("PROVIDE"):
+ self.qatracker.add_error("virtual.oldstyle", ebuild.relative_path)
+
+ for pos, missing_var in enumerate(missingvars):
+ if not myaux.get(missing_var):
+ if catdir == "virtual" and \
+ missing_var in ("HOMEPAGE", "LICENSE"):
+ continue
+ if live_ebuild and missing_var == "KEYWORDS":
+ continue
+ myqakey = missingvars[pos] + ".missing"
+ self.qatracker.add_error(myqakey, xpkg + "/" + y_ebuild + ".ebuild")
+
+ if catdir == "virtual":
+ for var in ("HOMEPAGE", "LICENSE"):
+ if myaux.get(var):
+ myqakey = var + ".virtual"
+ self.qatracker.add_error(myqakey, ebuild.relative_path)
+
+ self.descriptioncheck.check(pkg, ebuild)
+
+ keywords = myaux["KEYWORDS"].split()
+
+ ebuild_archs = set(
+ kw.lstrip("~") for kw in keywords if not kw.startswith("-"))
+
+ self.keywordcheck.check(
+ pkg, xpkg, ebuild, y_ebuild, keywords, ebuild_archs, self.changed,
+ live_ebuild, self.repo_metadata['kwlist'], self.profiles)
+
+ if live_ebuild and self.repo_settings.repo_config.name == "gentoo":
+ self.liveeclasscheck.check(
+ pkg, xpkg, ebuild, y_ebuild, keywords, self.repo_metadata['pmaskdict'])
+
+ if self.options.ignore_arches:
+ arches = [[
+ self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
+ self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
+ else:
+ arches = set()
+ for keyword in keywords:
+ if keyword[0] == "-":
+ continue
+ elif keyword[0] == "~":
+ arch = keyword[1:]
+ if arch == "*":
+ for expanded_arch in self.profiles:
+ if expanded_arch == "**":
+ continue
+ arches.add(
+ (keyword, expanded_arch, (
+ expanded_arch, "~" + expanded_arch)))
+ else:
+ arches.add((keyword, arch, (arch, keyword)))
+ else:
+ if keyword == "*":
+ for expanded_arch in self.profiles:
+ if expanded_arch == "**":
+ continue
+ arches.add(
+ (keyword, expanded_arch, (expanded_arch,)))
+ else:
+ arches.add((keyword, keyword, (keyword,)))
+ if not arches:
+ # Use an empty profile for checking dependencies of
+ # packages that have empty KEYWORDS.
+ arches.add(('**', '**', ('**',)))
+
+ unknown_pkgs = set()
+ baddepsyntax = False
+ badlicsyntax = False
+ badprovsyntax = False
+ # catpkg = catdir + "/" + y_ebuild
+
+ inherited_java_eclass = "java-pkg-2" in inherited or \
+ "java-pkg-opt-2" in inherited
+ inherited_wxwidgets_eclass = "wxwidgets" in inherited
+ # operator_tokens = set(["||", "(", ")"])
+ type_list, badsyntax = [], []
+ for mytype in Package._dep_keys + ("LICENSE", "PROPERTIES", "PROVIDE"):
+ mydepstr = myaux[mytype]
+
+ buildtime = mytype in Package._buildtime_keys
+ runtime = mytype in Package._runtime_keys
+ token_class = None
+ if mytype.endswith("DEPEND"):
+ token_class = portage.dep.Atom
+
+ try:
+ atoms = portage.dep.use_reduce(
+ mydepstr, matchall=1, flat=True,
+ is_valid_flag=pkg.iuse.is_valid_flag, token_class=token_class)
+ except portage.exception.InvalidDependString as e:
+ atoms = None
+ badsyntax.append(str(e))
+
+ if atoms and mytype.endswith("DEPEND"):
+ if runtime and \
+ "test?" in mydepstr.split():
+ self.qatracker.add_error(
+ mytype + '.suspect',
+ "%s: 'test?' USE conditional in %s" %
+ (ebuild.relative_path, mytype))
+
+ for atom in atoms:
+ if atom == "||":
+ continue
+
+ is_blocker = atom.blocker
+
+ # Skip dependency.unknown for blockers, so that we
+ # don't encourage people to remove necessary blockers,
+ # as discussed in bug 382407. We use atom.without_use
+ # due to bug 525376.
+ if not is_blocker and \
+ not self.portdb.xmatch("match-all", atom.without_use) and \
+ not atom.cp.startswith("virtual/"):
+ unknown_pkgs.add((mytype, atom.unevaluated_atom))
+
+ if catdir != "virtual":
+ if not is_blocker and \
+ atom.cp in suspect_virtual:
+ self.qatracker.add_error(
+ 'virtual.suspect', ebuild.relative_path +
+ ": %s: consider using '%s' instead of '%s'" %
+ (mytype, suspect_virtual[atom.cp], atom))
+ if not is_blocker and \
+ atom.cp.startswith("perl-core/"):
+ self.qatracker.add_error('dependency.perlcore',
+ ebuild.relative_path +
+ ": %s: please use '%s' instead of '%s'" %
+ (mytype,
+ atom.replace("perl-core/","virtual/perl-"),
+ atom))
+
+ if buildtime and \
+ not is_blocker and \
+ not inherited_java_eclass and \
+ atom.cp == "virtual/jdk":
+ self.qatracker.add_error(
+ 'java.eclassesnotused', ebuild.relative_path)
+ elif buildtime and \
+ not is_blocker and \
+ not inherited_wxwidgets_eclass and \
+ atom.cp == "x11-libs/wxGTK":
+ self.qatracker.add_error(
+ 'wxwidgets.eclassnotused',
+ "%s: %ss on x11-libs/wxGTK without inheriting"
+ " wxwidgets.eclass" % (ebuild.relative_path, mytype))
+ elif runtime:
+ if not is_blocker and \
+ atom.cp in suspect_rdepend:
+ self.qatracker.add_error(
+ mytype + '.suspect',
+ ebuild.relative_path + ": '%s'" % atom)
+
+ if atom.operator == "~" and \
+ portage.versions.catpkgsplit(atom.cpv)[3] != "r0":
+ qacat = 'dependency.badtilde'
+ self.qatracker.add_error(
+ qacat, "%s: %s uses the ~ operator"
+ " with a non-zero revision: '%s'" %
+ (ebuild.relative_path, mytype, atom))
+
+ check_missingslot(atom, mytype, eapi, self.portdb, self.qatracker,
+ ebuild.relative_path, myaux)
+
+ type_list.extend([mytype] * (len(badsyntax) - len(type_list)))
+
+ for m, b in zip(type_list, badsyntax):
+ if m.endswith("DEPEND"):
+ qacat = "dependency.syntax"
+ else:
+ qacat = m + ".syntax"
+ self.qatracker.add_error(
+ qacat, "%s: %s: %s" % (ebuild.relative_path, m, b))
+
+ badlicsyntax = len([z for z in type_list if z == "LICENSE"])
+ badprovsyntax = len([z for z in type_list if z == "PROVIDE"])
+ baddepsyntax = len(type_list) != badlicsyntax + badprovsyntax
+ badlicsyntax = badlicsyntax > 0
+ badprovsyntax = badprovsyntax > 0
+
+ self.use_flag_checks.check(pkg, xpkg, ebuild, y_ebuild, self.muselist)
+
+ ebuild_used_useflags = self.use_flag_checks.getUsedUseFlags()
+ used_useflags = used_useflags.union(ebuild_used_useflags)
+
+ self.rubyeclasscheck.check(pkg, ebuild)
+
+ # license checks
+ if not badlicsyntax:
+ self.licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
+
+ self.restrictcheck.check(pkg, xpkg, ebuild, y_ebuild)
+
+ # Syntax Checks
+ if not self.vcs_settings.vcs_preserves_mtime:
+ if ebuild.ebuild_path not in self.changed.new_ebuilds and \
+ ebuild.ebuild_path not in self.changed.ebuilds:
+ pkg.mtime = None
+ try:
+ # All ebuilds should have utf_8 encoding.
+ f = io.open(
+ _unicode_encode(
+ ebuild.full_path, encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['repo.content'])
+ try:
+ for check_name, e in run_checks(f, pkg):
+ self.qatracker.add_error(
+ check_name, ebuild.relative_path + ': %s' % e)
+ finally:
+ f.close()
+ except UnicodeDecodeError:
+ # A file.UTF8 failure will have already been recorded above.
+ pass
+
+ if self.options.force:
+ # The dep_check() calls are the most expensive QA test. If --force
+ # is enabled, there's no point in wasting time on these since the
+ # user is intent on forcing the commit anyway.
+ continue
+
+ relevant_profiles = []
+ for keyword, arch, groups in arches:
+ if arch not in self.profiles:
+ # A missing profile will create an error further down
+ # during the KEYWORDS verification.
+ continue
+
+ if self.include_arches is not None:
+ if arch not in self.include_arches:
+ continue
+
+ relevant_profiles.extend(
+ (keyword, groups, prof) for prof in self.profiles[arch])
+
+ relevant_profiles.sort(key=sort_key)
+
+ for keyword, groups, prof in relevant_profiles:
+
+ is_stable_profile = prof.status == "stable"
+ is_dev_profile = prof.status == "dev" and \
+ self.options.include_dev
+ is_exp_profile = prof.status == "exp" and \
+ self.options.include_exp_profiles == 'y'
+ if not (is_stable_profile or is_dev_profile or is_exp_profile):
+ continue
+
+ dep_settings = self.caches['arch'].get(prof.sub_path)
+ if dep_settings is None:
+ dep_settings = portage.config(
+ config_profile_path=prof.abs_path,
+ config_incrementals=self.repoman_incrementals,
+ config_root=self.config_root,
+ local_config=False,
+ _unmatched_removal=self.options.unmatched_removal,
+ env=self.env, repositories=self.repo_settings.repoman_settings.repositories)
+ dep_settings.categories = self.repo_settings.repoman_settings.categories
+ if self.options.without_mask:
+ dep_settings._mask_manager_obj = \
+ copy.deepcopy(dep_settings._mask_manager)
+ dep_settings._mask_manager._pmaskdict.clear()
+ self.caches['arch'][prof.sub_path] = dep_settings
+
+ xmatch_cache_key = (prof.sub_path, tuple(groups))
+ xcache = self.caches['arch_xmatch'].get(xmatch_cache_key)
+ if xcache is None:
+ self.portdb.melt()
+ self.portdb.freeze()
+ xcache = self.portdb.xcache
+ xcache.update(self.caches['shared_xmatch'])
+ self.caches['arch_xmatch'][xmatch_cache_key] = xcache
+
+ self.repo_settings.trees[self.repo_settings.root]["porttree"].settings = dep_settings
+ self.portdb.settings = dep_settings
+ self.portdb.xcache = xcache
+
+ dep_settings["ACCEPT_KEYWORDS"] = " ".join(groups)
+ # just in case, prevent config.reset() from nuking these.
+ dep_settings.backup_changes("ACCEPT_KEYWORDS")
+
+ # This attribute is used in dbapi._match_use() to apply
+ # use.stable.{mask,force} settings based on the stable
+ # status of the parent package. This is required in order
+ # for USE deps of unstable packages to be resolved correctly,
+ # since otherwise use.stable.{mask,force} settings of
+ # dependencies may conflict (see bug #456342).
+ dep_settings._parent_stable = dep_settings._isStable(pkg)
+
+ # Handle package.use*.{force,mask) calculation, for use
+ # in dep_check.
+ dep_settings.useforce = dep_settings._use_manager.getUseForce(
+ pkg, stable=dep_settings._parent_stable)
+ dep_settings.usemask = dep_settings._use_manager.getUseMask(
+ pkg, stable=dep_settings._parent_stable)
+
+ if not baddepsyntax:
+ ismasked = not ebuild_archs or \
+ pkg.cpv not in self.portdb.xmatch("match-visible",
+ Atom("%s::%s" % (pkg.cp, self.repo_settings.repo_config.name)))
+ if ismasked:
+ if not self.have['pmasked']:
+ self.have['pmasked'] = bool(dep_settings._getMaskAtom(
+ pkg.cpv, pkg._metadata))
+ if self.options.ignore_masked:
+ continue
+ # we are testing deps for a masked package; give it some lee-way
+ suffix = "masked"
+ matchmode = "minimum-all"
+ else:
+ suffix = ""
+ matchmode = "minimum-visible"
+
+ if not self.have['dev_keywords']:
+ self.have['dev_keywords'] = \
+ bool(self.dev_keywords.intersection(keywords))
+
+ if prof.status == "dev":
+ suffix = suffix + "indev"
+
+ for mytype in Package._dep_keys:
+
+ mykey = "dependency.bad" + suffix
+ myvalue = myaux[mytype]
+ if not myvalue:
+ continue
+
+ success, atoms = portage.dep_check(
+ myvalue, self.portdb, dep_settings,
+ use="all", mode=matchmode, trees=self.repo_settings.trees)
+
+ if success:
+ if atoms:
+
+ # Don't bother with dependency.unknown for
+ # cases in which *DEPEND.bad is triggered.
+ for atom in atoms:
+ # dep_check returns all blockers and they
+ # aren't counted for *DEPEND.bad, so we
+ # ignore them here.
+ if not atom.blocker:
+ unknown_pkgs.discard(
+ (mytype, atom.unevaluated_atom))
+
+ if not prof.sub_path:
+ # old-style virtuals currently aren't
+ # resolvable with empty profile, since
+ # 'virtuals' mappings are unavailable
+ # (it would be expensive to search
+ # for PROVIDE in all ebuilds)
+ atoms = [
+ atom for atom in atoms if not (
+ atom.cp.startswith('virtual/')
+ and not self.portdb.cp_list(atom.cp))]
+
+ # we have some unsolvable deps
+ # remove ! deps, which always show up as unsatisfiable
+ atoms = [
+ str(atom.unevaluated_atom)
+ for atom in atoms if not atom.blocker]
+
+ # if we emptied out our list, continue:
+ if not atoms:
+ continue
+ self.qatracker.add_error(mykey,
+ "%s: %s: %s(%s)\n%s"
+ % (ebuild.relative_path, mytype, keyword, prof,
+ pformat(atoms, indent=6)))
+ else:
+ self.qatracker.add_error(mykey,
+ "%s: %s: %s(%s)\n%s"
+ % (ebuild.relative_path, mytype, keyword, prof,
+ pformat(atoms, indent=6)))
+
+ if not baddepsyntax and unknown_pkgs:
+ type_map = {}
+ for mytype, atom in unknown_pkgs:
+ type_map.setdefault(mytype, set()).add(atom)
+ for mytype, atoms in type_map.items():
+ self.qatracker.add_error(
+ "dependency.unknown", "%s: %s: %s"
+ % (ebuild.relative_path, mytype, ", ".join(sorted(atoms))))
+
+ # check if there are unused local USE-descriptions in metadata.xml
+ # (unless there are any invalids, to avoid noise)
+ if self.allvalid:
+ for myflag in self.muselist.difference(used_useflags):
+ self.qatracker.add_error(
+ "metadata.warning",
+ "%s/metadata.xml: unused local USE-description: '%s'"
+ % (xpkg, myflag))
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
@ 2015-09-21 23:51 ` Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: 9f63c395ee23b00d77d00e667a28624de5baff49
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 17 15:29:11 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9f63c395
repoman: Move the primary checks loop to it's own class and file
Only minimal changes were done for this initial move.
The _scan_ebuilds() needs major hacking up into manageable chunks.
Clean out code separation demarcation lines
These lines were originally used to mark places where code was removed.
And replaced with a class instance and/or function call.
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>
pym/repoman/main.py | 756 ++-----------------------------------------------
pym/repoman/scanner.py | 715 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 743 insertions(+), 728 deletions(-)
diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index e3d0472..2b2f91d 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -4,7 +4,6 @@
from __future__ import print_function, unicode_literals
-import copy
import errno
import io
import logging
@@ -15,7 +14,6 @@ import sys
import tempfile
import platform
from itertools import chain
-from pprint import pformat
from os import path as osp
if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
@@ -30,14 +28,12 @@ portage._disable_legacy_globals()
from portage import os
from portage import _encodings
from portage import _unicode_encode
-from _emerge.Package import Package
from _emerge.UserQuery import UserQuery
import portage.checksum
import portage.const
import portage.repository.config
-from portage import cvstree, normalize_path
+from portage import cvstree
from portage import util
-from portage.dep import Atom
from portage.process import find_binary, spawn
from portage.output import (
bold, create_color_func, green, nocolor, red)
@@ -47,40 +43,18 @@ from portage.util import writemsg_level
from portage.package.ebuild.digestgen import digestgen
from repoman.argparser import parse_args
-from repoman.checks.directories.files import FileChecks
-from repoman.checks.ebuilds.checks import run_checks, checks_init
-from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
-from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
-from repoman.checks.ebuilds.fetches import FetchChecks
-from repoman.checks.ebuilds.keywords import KeywordChecks
-from repoman.checks.ebuilds.isebuild import IsEbuild
-from repoman.checks.ebuilds.thirdpartymirrors import ThirdPartyMirrors
-from repoman.checks.ebuilds.manifests import Manifests
-from repoman.check_missingslot import check_missingslot
-from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
-from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
-from repoman.checks.ebuilds.use_flags import USEFlagChecks
-from repoman.checks.ebuilds.variables.description import DescriptionChecks
-from repoman.checks.ebuilds.variables.eapi import EAPIChecks
-from repoman.checks.ebuilds.variables.license import LicenseChecks
-from repoman.checks.ebuilds.variables.restrict import RestrictChecks
-from repoman.ebuild import Ebuild
+from repoman.checks.ebuilds.checks import checks_init
from repoman.errors import err
from repoman.gpg import gpgsign, need_signature
-from repoman.modules.commit import repochecks
-from repoman.profile import check_profiles, dev_profile_keywords, setup_profile
from repoman.qa_data import (
format_qa_output, format_qa_output_column, qahelp,
- qawarnings, qacats, missingvars,
- suspect_virtual, suspect_rdepend)
-from repoman.qa_tracker import QATracker
-from repoman.repos import RepoSettings, repo_metadata
-from repoman.scan import Changes, scan
+ qawarnings, qacats)
+from repoman.repos import RepoSettings
+from repoman.scanner import Scanner
from repoman._subprocess import repoman_popen, repoman_getstatusoutput
from repoman import utilities
from repoman.vcs.vcs import (
git_supports_gpg_sign, vcs_files_to_cps, VCSSettings)
-from repoman.vcs.vcsstatus import VCSStatus
if sys.hexversion >= 0x3000000:
@@ -90,21 +64,11 @@ util.initialize_logger()
bad = create_color_func("BAD")
-live_eclasses = portage.const.LIVE_ECLASSES
-non_ascii_re = re.compile(r'[^\x00-\x7f]')
-
# A sane umask is needed for files that portage creates.
os.umask(0o22)
-def sort_key(item):
- return item[2].sub_path
-
def repoman_main(argv):
- # Repoman sets it's own ACCEPT_KEYWORDS and we don't want it to
- # behave incrementally.
- repoman_incrementals = tuple(
- x for x in portage.const.INCREMENTALS if x != 'ACCEPT_KEYWORDS')
config_root = os.environ.get("PORTAGE_CONFIGROOT")
repoman_settings = portage.config(config_root=config_root, local_config=False)
@@ -142,30 +106,9 @@ def repoman_main(argv):
repo_settings = RepoSettings(
config_root, portdir, portdir_overlay,
repoman_settings, vcs_settings, options, qawarnings)
-
repoman_settings = repo_settings.repoman_settings
-
portdb = repo_settings.portdb
- if options.echangelog is None and repo_settings.repo_config.update_changelog:
- options.echangelog = 'y'
-
- if vcs_settings.vcs is None:
- options.echangelog = 'n'
-
- # The --echangelog option causes automatic ChangeLog generation,
- # which invalidates changelog.ebuildadded and changelog.missing
- # checks.
- # Note: Some don't use ChangeLogs in distributed SCMs.
- # It will be generated on server side from scm log,
- # before package moves to the rsync server.
- # This is needed because they try to avoid merge collisions.
- # Gentoo's Council decided to always use the ChangeLog file.
- # TODO: shouldn't this just be switched on the repo, iso the VCS?
- is_echangelog_enabled = options.echangelog in ('y', 'force')
- vcs_settings.vcs_is_cvs_or_svn = vcs_settings.vcs in ('cvs', 'svn')
- check_changelog = not is_echangelog_enabled and vcs_settings.vcs_is_cvs_or_svn
-
if 'digest' in repoman_settings.features and options.digest != 'n':
options.digest = 'y'
@@ -178,663 +121,16 @@ def repoman_main(argv):
env = os.environ.copy()
env['FEATURES'] = env.get('FEATURES', '') + ' -unknown-features-warn'
- categories = []
- for path in repo_settings.repo_config.eclass_db.porttrees:
- categories.extend(portage.util.grabfile(
- os.path.join(path, 'profiles', 'categories')))
- repoman_settings.categories = frozenset(
- portage.util.stack_lists([categories], incremental=1))
- categories = repoman_settings.categories
-
- portdb.settings = repoman_settings
- # We really only need to cache the metadata that's necessary for visibility
- # filtering. Anything else can be discarded to reduce memory consumption.
- portdb._aux_cache_keys.clear()
- portdb._aux_cache_keys.update(
- ["EAPI", "IUSE", "KEYWORDS", "repository", "SLOT"])
-
- reposplit = myreporoot.split(os.path.sep)
- repolevel = len(reposplit)
-
- ###################
- commitmessage = None
- if options.mode == 'commit':
- repochecks.commit_check(repolevel, reposplit)
- repochecks.conflict_check(vcs_settings, options)
-
- ###################
-
- # Make startdir relative to the canonical repodir, so that we can pass
- # it to digestgen and it won't have to be canonicalized again.
- if repolevel == 1:
- startdir = repo_settings.repodir
- else:
- startdir = normalize_path(mydir)
- startdir = os.path.join(
- repo_settings.repodir, *startdir.split(os.sep)[-2 - repolevel + 3:])
- ###################
-
-
- # get lists of valid keywords, licenses, and use
- new_data = repo_metadata(repo_settings.portdb, repoman_settings)
- kwlist, liclist, uselist, profile_list, \
- global_pmaskdict, liclist_deprecated = new_data
-
- repoman_settings['PORTAGE_ARCHLIST'] = ' '.join(sorted(kwlist))
- repoman_settings.backup_changes('PORTAGE_ARCHLIST')
-
- ####################
-
- profiles = setup_profile(profile_list)
-
- ####################
-
- check_profiles(profiles, repoman_settings.archlist())
-
- ####################
-
- scanlist = scan(repolevel, reposplit, startdir, categories, repo_settings)
-
- ####################
-
- dev_keywords = dev_profile_keywords(profiles)
-
- qatracker = QATracker()
-
-
- if options.mode == "manifest":
- pass
- elif options.pretend:
- print(green("\nRepoMan does a once-over of the neighborhood..."))
- else:
- print(green("\nRepoMan scours the neighborhood..."))
-
- #####################
-
- changed = Changes(options)
- changed.scan(vcs_settings)
-
- ######################
-
- have_pmasked = False
- have_dev_keywords = False
- dofail = 0
-
- # NOTE: match-all caches are not shared due to potential
- # differences between profiles in _get_implicit_iuse.
- arch_caches = {}
- arch_xmatch_caches = {}
- shared_xmatch_caches = {"cp-list": {}}
-
- include_arches = None
- if options.include_arches:
- include_arches = set()
- include_arches.update(*[x.split() for x in options.include_arches])
-
- # Disable the "ebuild.notadded" check when not in commit mode and
- # running `svn status` in every package dir will be too expensive.
-
- check_ebuild_notadded = not \
- (vcs_settings.vcs == "svn" and repolevel < 3 and options.mode != "commit")
-
- effective_scanlist = scanlist
- if options.if_modified == "y":
- effective_scanlist = sorted(vcs_files_to_cps(
- chain(changed.changed, changed.new, changed.removed),
- repolevel, reposplit, categories))
-
- ######################
- # initialize our checks classes here before the big xpkg loop
- manifester = Manifests(options, qatracker, repoman_settings)
- is_ebuild = IsEbuild(repoman_settings, repo_settings, portdb, qatracker)
- filescheck = FileChecks(
- qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
- status_check = VCSStatus(vcs_settings, qatracker)
- fetchcheck = FetchChecks(
- qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
- pkgmeta = PkgMetadata(options, qatracker, repoman_settings)
- thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
- use_flag_checks = USEFlagChecks(qatracker, uselist)
- keywordcheck = KeywordChecks(qatracker, options)
- liveeclasscheck = LiveEclassChecks(qatracker)
- rubyeclasscheck = RubyEclassChecks(qatracker)
- eapicheck = EAPIChecks(qatracker, repo_settings)
- descriptioncheck = DescriptionChecks(qatracker)
- licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
- restrictcheck = RestrictChecks(qatracker)
- ######################
-
- for xpkg in effective_scanlist:
- # ebuilds and digests added to cvs respectively.
- logging.info("checking package %s" % xpkg)
- # save memory by discarding xmatch caches from previous package(s)
- arch_xmatch_caches.clear()
- eadded = []
- catdir, pkgdir = xpkg.split("/")
- checkdir = repo_settings.repodir + "/" + xpkg
- checkdir_relative = ""
- if repolevel < 3:
- checkdir_relative = os.path.join(pkgdir, checkdir_relative)
- if repolevel < 2:
- checkdir_relative = os.path.join(catdir, checkdir_relative)
- checkdir_relative = os.path.join(".", checkdir_relative)
-
- #####################
- if manifester.run(checkdir, portdb):
- continue
- if not manifester.generated_manifest:
- manifester.digest_check(xpkg, checkdir)
- ######################
-
- if options.mode == 'manifest-check':
- continue
-
- checkdirlist = os.listdir(checkdir)
-
- ######################
- pkgs, allvalid = is_ebuild.check(checkdirlist, checkdir, xpkg)
- if is_ebuild.continue_:
- # If we can't access all the metadata then it's totally unsafe to
- # commit since there's no way to generate a correct Manifest.
- # 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.
- can_force = False
- continue
- ######################
-
- keywordcheck.prepare()
-
- # Sort ebuilds in ascending order for the KEYWORDS.dropped check.
- ebuildlist = sorted(pkgs.values())
- ebuildlist = [pkg.pf for pkg in ebuildlist]
- #######################
- filescheck.check(
- checkdir, checkdirlist, checkdir_relative, changed.changed, changed.new)
- #######################
- status_check.check(check_ebuild_notadded, checkdir, checkdir_relative, xpkg)
- eadded.extend(status_check.eadded)
-
- #################
- fetchcheck.check(
- xpkg, checkdir, checkdir_relative, changed.changed, changed.new)
- #################
-
- if check_changelog and "ChangeLog" not in checkdirlist:
- qatracker.add_error("changelog.missing", xpkg + "/ChangeLog")
- #################
- pkgmeta.check(xpkg, checkdir, checkdirlist, repolevel)
- muselist = frozenset(pkgmeta.musedict)
- #################
-
- changelog_path = os.path.join(checkdir_relative, "ChangeLog")
- changelog_modified = changelog_path in changed.changelogs
-
- # detect unused local USE-descriptions
- used_useflags = set()
-
- for y_ebuild in ebuildlist:
- ##################
- ebuild = Ebuild(
- repo_settings, repolevel, pkgdir, catdir, vcs_settings,
- xpkg, y_ebuild)
- ##################
-
- if check_changelog and not changelog_modified \
- and ebuild.ebuild_path in changed.new_ebuilds:
- qatracker.add_error('changelog.ebuildadded', ebuild.relative_path)
-
- if ebuild.untracked(check_ebuild_notadded, y_ebuild, eadded):
- # ebuild not added to vcs
- qatracker.add_error(
- "ebuild.notadded", xpkg + "/" + y_ebuild + ".ebuild")
-
- ##################
- if bad_split_check(xpkg, y_ebuild, pkgdir, qatracker):
- continue
- ###################
- pkg = pkgs[y_ebuild]
- if pkg_invalid(pkg, qatracker, ebuild):
- allvalid = False
- continue
-
- myaux = pkg._metadata
- eapi = myaux["EAPI"]
- inherited = pkg.inherited
- live_ebuild = live_eclasses.intersection(inherited)
-
- #######################
- eapicheck.check(pkg, ebuild)
- #######################
-
- for k, v in myaux.items():
- if not isinstance(v, basestring):
- continue
- m = non_ascii_re.search(v)
- if m is not None:
- qatracker.add_error(
- "variable.invalidchar",
- "%s: %s variable contains non-ASCII "
- "character at position %s" %
- (ebuild.relative_path, k, m.start() + 1))
-
- if not fetchcheck.src_uri_error:
- #######################
- thirdparty.check(myaux, ebuild.relative_path)
- #######################
- if myaux.get("PROVIDE"):
- qatracker.add_error("virtual.oldstyle", ebuild.relative_path)
-
- for pos, missing_var in enumerate(missingvars):
- if not myaux.get(missing_var):
- if catdir == "virtual" and \
- missing_var in ("HOMEPAGE", "LICENSE"):
- continue
- if live_ebuild and missing_var == "KEYWORDS":
- continue
- myqakey = missingvars[pos] + ".missing"
- qatracker.add_error(myqakey, xpkg + "/" + y_ebuild + ".ebuild")
-
- if catdir == "virtual":
- for var in ("HOMEPAGE", "LICENSE"):
- if myaux.get(var):
- myqakey = var + ".virtual"
- qatracker.add_error(myqakey, ebuild.relative_path)
-
- #######################
- descriptioncheck.check(pkg, ebuild)
- #######################
-
- keywords = myaux["KEYWORDS"].split()
-
- ebuild_archs = set(
- kw.lstrip("~") for kw in keywords if not kw.startswith("-"))
-
- #######################
- keywordcheck.check(
- pkg, xpkg, ebuild, y_ebuild, keywords, ebuild_archs, changed,
- live_ebuild, kwlist, profiles)
- #######################
-
- if live_ebuild and repo_settings.repo_config.name == "gentoo":
- #######################
- liveeclasscheck.check(
- pkg, xpkg, ebuild, y_ebuild, keywords, global_pmaskdict)
- #######################
-
- if options.ignore_arches:
- arches = [[
- repoman_settings["ARCH"], repoman_settings["ARCH"],
- repoman_settings["ACCEPT_KEYWORDS"].split()]]
- else:
- arches = set()
- for keyword in keywords:
- if keyword[0] == "-":
- continue
- elif keyword[0] == "~":
- arch = keyword[1:]
- if arch == "*":
- for expanded_arch in profiles:
- if expanded_arch == "**":
- continue
- arches.add(
- (keyword, expanded_arch, (
- expanded_arch, "~" + expanded_arch)))
- else:
- arches.add((keyword, arch, (arch, keyword)))
- else:
- if keyword == "*":
- for expanded_arch in profiles:
- if expanded_arch == "**":
- continue
- arches.add(
- (keyword, expanded_arch, (expanded_arch,)))
- else:
- arches.add((keyword, keyword, (keyword,)))
- if not arches:
- # Use an empty profile for checking dependencies of
- # packages that have empty KEYWORDS.
- arches.add(('**', '**', ('**',)))
-
- unknown_pkgs = set()
- baddepsyntax = False
- badlicsyntax = False
- badprovsyntax = False
- # catpkg = catdir + "/" + y_ebuild
-
- inherited_java_eclass = "java-pkg-2" in inherited or \
- "java-pkg-opt-2" in inherited
- inherited_wxwidgets_eclass = "wxwidgets" in inherited
- # operator_tokens = set(["||", "(", ")"])
- type_list, badsyntax = [], []
- for mytype in Package._dep_keys + ("LICENSE", "PROPERTIES", "PROVIDE"):
- mydepstr = myaux[mytype]
-
- buildtime = mytype in Package._buildtime_keys
- runtime = mytype in Package._runtime_keys
- token_class = None
- if mytype.endswith("DEPEND"):
- token_class = portage.dep.Atom
+ # Perform the main checks
+ scanner = Scanner(repo_settings, myreporoot, config_root, options,
+ vcs_settings, mydir, env)
+ qatracker, can_force = scanner.scan_pkgs(can_force)
- try:
- atoms = portage.dep.use_reduce(
- mydepstr, matchall=1, flat=True,
- is_valid_flag=pkg.iuse.is_valid_flag, token_class=token_class)
- except portage.exception.InvalidDependString as e:
- atoms = None
- badsyntax.append(str(e))
-
- if atoms and mytype.endswith("DEPEND"):
- if runtime and \
- "test?" in mydepstr.split():
- qatracker.add_error(
- mytype + '.suspect',
- "%s: 'test?' USE conditional in %s" %
- (ebuild.relative_path, mytype))
-
- for atom in atoms:
- if atom == "||":
- continue
-
- is_blocker = atom.blocker
-
- # Skip dependency.unknown for blockers, so that we
- # don't encourage people to remove necessary blockers,
- # as discussed in bug 382407. We use atom.without_use
- # due to bug 525376.
- if not is_blocker and \
- not portdb.xmatch("match-all", atom.without_use) and \
- not atom.cp.startswith("virtual/"):
- unknown_pkgs.add((mytype, atom.unevaluated_atom))
-
- if catdir != "virtual":
- if not is_blocker and \
- atom.cp in suspect_virtual:
- qatracker.add_error(
- 'virtual.suspect', ebuild.relative_path +
- ": %s: consider using '%s' instead of '%s'" %
- (mytype, suspect_virtual[atom.cp], atom))
- if not is_blocker and \
- atom.cp.startswith("perl-core/"):
- qatracker.add_error('dependency.perlcore',
- ebuild.relative_path +
- ": %s: please use '%s' instead of '%s'" %
- (mytype,
- atom.replace("perl-core/","virtual/perl-"),
- atom))
-
- if buildtime and \
- not is_blocker and \
- not inherited_java_eclass and \
- atom.cp == "virtual/jdk":
- qatracker.add_error(
- 'java.eclassesnotused', ebuild.relative_path)
- elif buildtime and \
- not is_blocker and \
- not inherited_wxwidgets_eclass and \
- atom.cp == "x11-libs/wxGTK":
- qatracker.add_error(
- 'wxwidgets.eclassnotused',
- "%s: %ss on x11-libs/wxGTK without inheriting"
- " wxwidgets.eclass" % (ebuild.relative_path, mytype))
- elif runtime:
- if not is_blocker and \
- atom.cp in suspect_rdepend:
- qatracker.add_error(
- mytype + '.suspect',
- ebuild.relative_path + ": '%s'" % atom)
-
- if atom.operator == "~" and \
- portage.versions.catpkgsplit(atom.cpv)[3] != "r0":
- qacat = 'dependency.badtilde'
- qatracker.add_error(
- qacat, "%s: %s uses the ~ operator"
- " with a non-zero revision: '%s'" %
- (ebuild.relative_path, mytype, atom))
-
- check_missingslot(atom, mytype, eapi, portdb, qatracker,
- ebuild.relative_path, myaux)
-
- type_list.extend([mytype] * (len(badsyntax) - len(type_list)))
-
- for m, b in zip(type_list, badsyntax):
- if m.endswith("DEPEND"):
- qacat = "dependency.syntax"
- else:
- qacat = m + ".syntax"
- qatracker.add_error(
- qacat, "%s: %s: %s" % (ebuild.relative_path, m, b))
-
- badlicsyntax = len([z for z in type_list if z == "LICENSE"])
- badprovsyntax = len([z for z in type_list if z == "PROVIDE"])
- baddepsyntax = len(type_list) != badlicsyntax + badprovsyntax
- badlicsyntax = badlicsyntax > 0
- badprovsyntax = badprovsyntax > 0
-
- #################
- use_flag_checks.check(pkg, xpkg, ebuild, y_ebuild, muselist)
-
- ebuild_used_useflags = use_flag_checks.getUsedUseFlags()
- used_useflags = used_useflags.union(ebuild_used_useflags)
- #################
- rubyeclasscheck.check(pkg, ebuild)
- #################
-
- # license checks
- if not badlicsyntax:
- #################
- licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
- #################
-
- #################
- restrictcheck.check(pkg, xpkg, ebuild, y_ebuild)
- #################
-
- # Syntax Checks
-
- if not vcs_settings.vcs_preserves_mtime:
- if ebuild.ebuild_path not in changed.new_ebuilds and \
- ebuild.ebuild_path not in changed.ebuilds:
- pkg.mtime = None
- try:
- # All ebuilds should have utf_8 encoding.
- f = io.open(
- _unicode_encode(
- ebuild.full_path, encoding=_encodings['fs'], errors='strict'),
- mode='r', encoding=_encodings['repo.content'])
- try:
- for check_name, e in run_checks(f, pkg):
- qatracker.add_error(
- check_name, ebuild.relative_path + ': %s' % e)
- finally:
- f.close()
- except UnicodeDecodeError:
- # A file.UTF8 failure will have already been recorded above.
- pass
-
- if options.force:
- # The dep_check() calls are the most expensive QA test. If --force
- # is enabled, there's no point in wasting time on these since the
- # user is intent on forcing the commit anyway.
- continue
-
- relevant_profiles = []
- for keyword, arch, groups in arches:
- if arch not in profiles:
- # A missing profile will create an error further down
- # during the KEYWORDS verification.
- continue
-
- if include_arches is not None:
- if arch not in include_arches:
- continue
-
- relevant_profiles.extend(
- (keyword, groups, prof) for prof in profiles[arch])
-
- relevant_profiles.sort(key=sort_key)
-
- for keyword, groups, prof in relevant_profiles:
-
- is_stable_profile = prof.status == "stable"
- is_dev_profile = prof.status == "dev" and \
- options.include_dev
- is_exp_profile = prof.status == "exp" and \
- options.include_exp_profiles == 'y'
- if not (is_stable_profile or is_dev_profile or is_exp_profile):
- continue
+ commitmessage = None
- dep_settings = arch_caches.get(prof.sub_path)
- if dep_settings is None:
- dep_settings = portage.config(
- config_profile_path=prof.abs_path,
- config_incrementals=repoman_incrementals,
- config_root=config_root,
- local_config=False,
- _unmatched_removal=options.unmatched_removal,
- env=env, repositories=repoman_settings.repositories)
- dep_settings.categories = repoman_settings.categories
- if options.without_mask:
- dep_settings._mask_manager_obj = \
- copy.deepcopy(dep_settings._mask_manager)
- dep_settings._mask_manager._pmaskdict.clear()
- arch_caches[prof.sub_path] = dep_settings
-
- xmatch_cache_key = (prof.sub_path, tuple(groups))
- xcache = arch_xmatch_caches.get(xmatch_cache_key)
- if xcache is None:
- portdb.melt()
- portdb.freeze()
- xcache = portdb.xcache
- xcache.update(shared_xmatch_caches)
- arch_xmatch_caches[xmatch_cache_key] = xcache
-
- repo_settings.trees[repo_settings.root]["porttree"].settings = dep_settings
- portdb.settings = dep_settings
- portdb.xcache = xcache
-
- dep_settings["ACCEPT_KEYWORDS"] = " ".join(groups)
- # just in case, prevent config.reset() from nuking these.
- dep_settings.backup_changes("ACCEPT_KEYWORDS")
-
- # This attribute is used in dbapi._match_use() to apply
- # use.stable.{mask,force} settings based on the stable
- # status of the parent package. This is required in order
- # for USE deps of unstable packages to be resolved correctly,
- # since otherwise use.stable.{mask,force} settings of
- # dependencies may conflict (see bug #456342).
- dep_settings._parent_stable = dep_settings._isStable(pkg)
-
- # Handle package.use*.{force,mask) calculation, for use
- # in dep_check.
- dep_settings.useforce = dep_settings._use_manager.getUseForce(
- pkg, stable=dep_settings._parent_stable)
- dep_settings.usemask = dep_settings._use_manager.getUseMask(
- pkg, stable=dep_settings._parent_stable)
-
- if not baddepsyntax:
- ismasked = not ebuild_archs or \
- pkg.cpv not in portdb.xmatch("match-visible",
- Atom("%s::%s" % (pkg.cp, repo_settings.repo_config.name)))
- if ismasked:
- if not have_pmasked:
- have_pmasked = bool(dep_settings._getMaskAtom(
- pkg.cpv, pkg._metadata))
- if options.ignore_masked:
- continue
- # we are testing deps for a masked package; give it some lee-way
- suffix = "masked"
- matchmode = "minimum-all"
- else:
- suffix = ""
- matchmode = "minimum-visible"
-
- if not have_dev_keywords:
- have_dev_keywords = \
- bool(dev_keywords.intersection(keywords))
-
- if prof.status == "dev":
- suffix = suffix + "indev"
-
- for mytype in Package._dep_keys:
-
- mykey = "dependency.bad" + suffix
- myvalue = myaux[mytype]
- if not myvalue:
- continue
-
- success, atoms = portage.dep_check(
- myvalue, portdb, dep_settings,
- use="all", mode=matchmode, trees=repo_settings.trees)
-
- if success:
- if atoms:
-
- # Don't bother with dependency.unknown for
- # cases in which *DEPEND.bad is triggered.
- for atom in atoms:
- # dep_check returns all blockers and they
- # aren't counted for *DEPEND.bad, so we
- # ignore them here.
- if not atom.blocker:
- unknown_pkgs.discard(
- (mytype, atom.unevaluated_atom))
-
- if not prof.sub_path:
- # old-style virtuals currently aren't
- # resolvable with empty profile, since
- # 'virtuals' mappings are unavailable
- # (it would be expensive to search
- # for PROVIDE in all ebuilds)
- atoms = [
- atom for atom in atoms if not (
- atom.cp.startswith('virtual/')
- and not portdb.cp_list(atom.cp))]
-
- # we have some unsolvable deps
- # remove ! deps, which always show up as unsatisfiable
- atoms = [
- str(atom.unevaluated_atom)
- for atom in atoms if not atom.blocker]
-
- # if we emptied out our list, continue:
- if not atoms:
- continue
- qatracker.add_error(mykey,
- "%s: %s: %s(%s)\n%s"
- % (ebuild.relative_path, mytype, keyword, prof,
- pformat(atoms, indent=6)))
- else:
- qatracker.add_error(mykey,
- "%s: %s: %s(%s)\n%s"
- % (ebuild.relative_path, mytype, keyword, prof,
- pformat(atoms, indent=6)))
-
- if not baddepsyntax and unknown_pkgs:
- type_map = {}
- for mytype, atom in unknown_pkgs:
- type_map.setdefault(mytype, set()).add(atom)
- for mytype, atoms in type_map.items():
- qatracker.add_error(
- "dependency.unknown", "%s: %s: %s"
- % (ebuild.relative_path, mytype, ", ".join(sorted(atoms))))
-
- # check if there are unused local USE-descriptions in metadata.xml
- # (unless there are any invalids, to avoid noise)
- if allvalid:
- for myflag in muselist.difference(used_useflags):
- qatracker.add_error(
- "metadata.warning",
- "%s/metadata.xml: unused local USE-description: '%s'"
- % (xpkg, myflag))
-
-
- if options.if_modified == "y" and len(effective_scanlist) < 1:
+ if options.if_modified == "y" and len(scanner.effective_scanlist) < 1:
logging.warning("--if-modified is enabled, but no modified packages were found!")
- if options.mode == "manifest":
- sys.exit(dofail)
-
# dofail will be true if we have failed in at least one non-warning category
dofail = 0
# dowarn will be true if we tripped any warnings
@@ -842,6 +138,10 @@ def repoman_main(argv):
# dofull will be true if we should print a "repoman full" informational message
dofull = options.mode != 'full'
+ # early out for manifest generation
+ if options.mode == "manifest":
+ sys.exit(dofail)
+
for x in qacats:
if x not in qatracker.fails:
continue
@@ -884,9 +184,9 @@ def repoman_main(argv):
suggest_ignore_masked = False
suggest_include_dev = False
- if have_pmasked and not (options.without_mask or options.ignore_masked):
+ if scanner.have['pmasked'] and not (options.without_mask or options.ignore_masked):
suggest_ignore_masked = True
- if have_dev_keywords and not options.include_dev:
+ if scanner.have['dev_keywords'] and not options.include_dev:
suggest_include_dev = True
if suggest_ignore_masked or suggest_include_dev:
@@ -1164,8 +464,8 @@ def repoman_main(argv):
commitmessagefile = None
if not commitmessage or not commitmessage.strip():
msg_prefix = ""
- if repolevel > 1:
- msg_prefix = "/".join(reposplit[1:]) + ": "
+ if scanner.repolevel > 1:
+ msg_prefix = "/".join(scanner.reposplit[1:]) + ": "
try:
editor = os.environ.get("EDITOR")
@@ -1196,10 +496,10 @@ def repoman_main(argv):
report_options.append("--force")
if options.ignore_arches:
report_options.append("--ignore-arches")
- if include_arches is not None:
+ if scanner.include_arches is not None:
report_options.append(
"--include-arches=\"%s\"" %
- " ".join(sorted(include_arches)))
+ " ".join(sorted(scanner.include_arches)))
if vcs_settings.vcs == "git":
# Use new footer only for git (see bug #438364).
@@ -1238,18 +538,18 @@ def repoman_main(argv):
committer_name = utilities.get_committer_name(env=repoman_settings)
for x in sorted(vcs_files_to_cps(
chain(myupdates, mymanifests, myremoved),
- repolevel, reposplit, categories)):
+ scanner.repolevel, scanner.reposplit, scanner.categories)):
catdir, pkgdir = x.split("/")
checkdir = repo_settings.repodir + "/" + x
checkdir_relative = ""
- if repolevel < 3:
+ if scanner.repolevel < 3:
checkdir_relative = os.path.join(pkgdir, checkdir_relative)
- if repolevel < 2:
+ if scanner.repolevel < 2:
checkdir_relative = os.path.join(catdir, checkdir_relative)
checkdir_relative = os.path.join(".", checkdir_relative)
changelog_path = os.path.join(checkdir_relative, "ChangeLog")
- changelog_modified = changelog_path in changed.changelogs
+ changelog_modified = changelog_path in scanner.changed.changelogs
if changelog_modified and options.echangelog != 'force':
continue
@@ -1459,7 +759,7 @@ def repoman_main(argv):
if modified:
portage.util.write_atomic(x, b''.join(mylines), mode='wb')
- if repolevel == 1:
+ if scanner.repolevel == 1:
utilities.repoman_sez(
"\"You're rather crazy... "
"doing the entire repository.\"\n")
@@ -1467,7 +767,7 @@ def repoman_main(argv):
if vcs_settings.vcs in ('cvs', 'svn') and (myupdates or myremoved):
for x in sorted(vcs_files_to_cps(
chain(myupdates, myremoved, mymanifests),
- repolevel, reposplit, categories)):
+ scanner.repolevel, scanner.reposplit, scanner.categories)):
repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
digestgen(mysettings=repoman_settings, myportdb=portdb)
@@ -1480,7 +780,7 @@ def repoman_main(argv):
try:
for x in sorted(vcs_files_to_cps(
chain(myupdates, myremoved, mymanifests),
- repolevel, reposplit, categories)):
+ scanner.repolevel, scanner.reposplit, scanner.categories)):
repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
manifest_path = os.path.join(repoman_settings["O"], "Manifest")
if not need_signature(manifest_path):
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
new file mode 100644
index 0000000..44ff33b
--- /dev/null
+++ b/pym/repoman/scanner.py
@@ -0,0 +1,715 @@
+
+import copy
+import io
+import logging
+import re
+import sys
+from itertools import chain
+from pprint import pformat
+
+from _emerge.Package import Package
+
+import portage
+from portage import normalize_path
+from portage import os
+from portage import _encodings
+from portage import _unicode_encode
+from portage.dep import Atom
+from portage.output import green
+from repoman.checks.directories.files import FileChecks
+from repoman.checks.ebuilds.checks import run_checks
+from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
+from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
+from repoman.checks.ebuilds.fetches import FetchChecks
+from repoman.checks.ebuilds.keywords import KeywordChecks
+from repoman.checks.ebuilds.isebuild import IsEbuild
+from repoman.checks.ebuilds.thirdpartymirrors import ThirdPartyMirrors
+from repoman.checks.ebuilds.manifests import Manifests
+from repoman.check_missingslot import check_missingslot
+from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
+from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
+from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.description import DescriptionChecks
+from repoman.checks.ebuilds.variables.eapi import EAPIChecks
+from repoman.checks.ebuilds.variables.license import LicenseChecks
+from repoman.checks.ebuilds.variables.restrict import RestrictChecks
+from repoman.ebuild import Ebuild
+from repoman.modules.commit import repochecks
+from repoman.profile import check_profiles, dev_profile_keywords, setup_profile
+from repoman.qa_data import missingvars, suspect_virtual, suspect_rdepend
+from repoman.qa_tracker import QATracker
+from repoman.repos import repo_metadata
+from repoman.scan import Changes, scan
+from repoman.vcs.vcsstatus import VCSStatus
+from repoman.vcs.vcs import vcs_files_to_cps
+
+if sys.hexversion >= 0x3000000:
+ basestring = str
+
+NON_ASCII_RE = re.compile(r'[^\x00-\x7f]')
+
+
+def sort_key(item):
+ return item[2].sub_path
+
+
+
+class Scanner(object):
+ '''Primary scan class. Operates all the small Q/A tests and checks'''
+
+ def __init__(self, repo_settings, myreporoot, config_root, options,
+ vcs_settings, mydir, env):
+ '''Class __init__'''
+ self.repo_settings = repo_settings
+ self.config_root = config_root
+ self.options = options
+ self.vcs_settings = vcs_settings
+ self.env = env
+
+ # Repoman sets it's own ACCEPT_KEYWORDS and we don't want it to
+ # behave incrementally.
+ self.repoman_incrementals = tuple(
+ x for x in portage.const.INCREMENTALS if x != 'ACCEPT_KEYWORDS')
+
+ self.categories = []
+ for path in self.repo_settings.repo_config.eclass_db.porttrees:
+ self.categories.extend(portage.util.grabfile(
+ os.path.join(path, 'profiles', 'categories')))
+ self.repo_settings.repoman_settings.categories = frozenset(
+ portage.util.stack_lists([self.categories], incremental=1))
+ self.categories = self.repo_settings.repoman_settings.categories
+
+ self.portdb = repo_settings.portdb
+ self.portdb.settings = self.repo_settings.repoman_settings
+ # We really only need to cache the metadata that's necessary for visibility
+ # filtering. Anything else can be discarded to reduce memory consumption.
+ self.portdb._aux_cache_keys.clear()
+ self.portdb._aux_cache_keys.update(
+ ["EAPI", "IUSE", "KEYWORDS", "repository", "SLOT"])
+
+ self.reposplit = myreporoot.split(os.path.sep)
+ self.repolevel = len(self.reposplit)
+
+ if self.options.mode == 'commit':
+ repochecks.commit_check(self.repolevel, self.reposplit)
+ repochecks.conflict_check(self.vcs_settings, self.options)
+
+ # Make startdir relative to the canonical repodir, so that we can pass
+ # it to digestgen and it won't have to be canonicalized again.
+ if self.repolevel == 1:
+ startdir = self.repo_settings.repodir
+ else:
+ startdir = normalize_path(mydir)
+ startdir = os.path.join(
+ self.repo_settings.repodir, *startdir.split(os.sep)[-2 - self.repolevel + 3:])
+
+ # get lists of valid keywords, licenses, and use
+ new_data = repo_metadata(self.portdb, self.repo_settings.repoman_settings)
+ kwlist, liclist, uselist, profile_list, \
+ global_pmaskdict, liclist_deprecated = new_data
+ self.repo_metadata = {
+ 'kwlist': kwlist,
+ 'liclist': liclist,
+ 'uselist': uselist,
+ 'profile_list': profile_list,
+ 'pmaskdict': global_pmaskdict,
+ 'lic_deprecated': liclist_deprecated,
+ }
+
+ self.repo_settings.repoman_settings['PORTAGE_ARCHLIST'] = ' '.join(sorted(kwlist))
+ self.repo_settings.repoman_settings.backup_changes('PORTAGE_ARCHLIST')
+
+ self.profiles = setup_profile(profile_list)
+
+ check_profiles(self.profiles, self.repo_settings.repoman_settings.archlist())
+
+ scanlist = scan(self.repolevel, self.reposplit, startdir, self.categories, self.repo_settings)
+
+ self.dev_keywords = dev_profile_keywords(self.profiles)
+
+ self.qatracker = QATracker()
+
+ if self.options.echangelog is None and self.repo_settings.repo_config.update_changelog:
+ self.options.echangelog = 'y'
+
+ if self.vcs_settings.vcs is None:
+ self.options.echangelog = 'n'
+
+ self.check = {}
+ # The --echangelog option causes automatic ChangeLog generation,
+ # which invalidates changelog.ebuildadded and changelog.missing
+ # checks.
+ # Note: Some don't use ChangeLogs in distributed SCMs.
+ # It will be generated on server side from scm log,
+ # before package moves to the rsync server.
+ # This is needed because they try to avoid merge collisions.
+ # Gentoo's Council decided to always use the ChangeLog file.
+ # TODO: shouldn't this just be switched on the repo, iso the VCS?
+ is_echangelog_enabled = self.options.echangelog in ('y', 'force')
+ self.vcs_settings.vcs_is_cvs_or_svn = self.vcs_settings.vcs in ('cvs', 'svn')
+ self.check['changelog'] = not is_echangelog_enabled and self.vcs_settings.vcs_is_cvs_or_svn
+
+ if self.options.mode == "manifest":
+ pass
+ elif self.options.pretend:
+ print(green("\nRepoMan does a once-over of the neighborhood..."))
+ else:
+ print(green("\nRepoMan scours the neighborhood..."))
+
+ self.changed = Changes(self.options)
+ self.changed.scan(self.vcs_settings)
+
+ self.have = {
+ 'pmasked': False,
+ 'dev_keywords': False,
+ }
+
+ # NOTE: match-all caches are not shared due to potential
+ # differences between profiles in _get_implicit_iuse.
+ self.caches = {
+ 'arch': {},
+ 'arch_xmatch': {},
+ 'shared_xmatch': {"cp-list": {}},
+ }
+
+ self.include_arches = None
+ if self.options.include_arches:
+ self.include_arches = set()
+ self.include_arches.update(*[x.split() for x in self.options.include_arches])
+
+ # Disable the "ebuild.notadded" check when not in commit mode and
+ # running `svn status` in every package dir will be too expensive.
+ self.check['ebuild_notadded'] = not \
+ (self.vcs_settings.vcs == "svn" and self.repolevel < 3 and self.options.mode != "commit")
+
+ self.effective_scanlist = scanlist
+ if self.options.if_modified == "y":
+ self.effective_scanlist = sorted(vcs_files_to_cps(
+ chain(self.changed.changed, self.changed.new, self.changed.removed),
+ self.repolevel, self.reposplit, self.categories))
+
+ self.live_eclasses = portage.const.LIVE_ECLASSES
+
+ # initialize our checks classes here before the big xpkg loop
+ self.manifester = Manifests(self.options, self.qatracker, self.repo_settings.repoman_settings)
+ self.is_ebuild = IsEbuild(self.repo_settings.repoman_settings, self.repo_settings, self.portdb, self.qatracker)
+ self.filescheck = FileChecks(
+ self.qatracker, self.repo_settings.repoman_settings, self.repo_settings, self.portdb, self.vcs_settings)
+ self.status_check = VCSStatus(self.vcs_settings, self.qatracker)
+ self.fetchcheck = FetchChecks(
+ self.qatracker, self.repo_settings.repoman_settings, self.repo_settings, self.portdb, self.vcs_settings)
+ self.pkgmeta = PkgMetadata(self.options, self.qatracker, self.repo_settings.repoman_settings)
+ self.thirdparty = ThirdPartyMirrors(self.repo_settings.repoman_settings, self.qatracker)
+ self.use_flag_checks = USEFlagChecks(self.qatracker, uselist)
+ self.keywordcheck = KeywordChecks(self.qatracker, self.options)
+ self.liveeclasscheck = LiveEclassChecks(self.qatracker)
+ self.rubyeclasscheck = RubyEclassChecks(self.qatracker)
+ self.eapicheck = EAPIChecks(self.qatracker, self.repo_settings)
+ self.descriptioncheck = DescriptionChecks(self.qatracker)
+ self.licensecheck = LicenseChecks(self.qatracker, liclist, liclist_deprecated)
+ self.restrictcheck = RestrictChecks(self.qatracker)
+
+
+ def scan_pkgs(self, can_force):
+ for xpkg in self.effective_scanlist:
+ # ebuilds and digests added to cvs respectively.
+ logging.info("checking package %s" % xpkg)
+ # save memory by discarding xmatch caches from previous package(s)
+ self.caches['arch_xmatch'].clear()
+ self.eadded = []
+ catdir, pkgdir = xpkg.split("/")
+ checkdir = self.repo_settings.repodir + "/" + xpkg
+ checkdir_relative = ""
+ if self.repolevel < 3:
+ checkdir_relative = os.path.join(pkgdir, checkdir_relative)
+ if self.repolevel < 2:
+ checkdir_relative = os.path.join(catdir, checkdir_relative)
+ checkdir_relative = os.path.join(".", checkdir_relative)
+
+ if self.manifester.run(checkdir, self.portdb):
+ continue
+ if not self.manifester.generated_manifest:
+ self.manifester.digest_check(xpkg, checkdir)
+ if self.options.mode == 'manifest-check':
+ continue
+
+ checkdirlist = os.listdir(checkdir)
+
+ self.pkgs, self.allvalid = self.is_ebuild.check(checkdirlist, checkdir, xpkg)
+ if self.is_ebuild.continue_:
+ # If we can't access all the metadata then it's totally unsafe to
+ # commit since there's no way to generate a correct Manifest.
+ # 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.
+ can_force = False
+ continue
+
+ self.keywordcheck.prepare()
+
+ # Sort ebuilds in ascending order for the KEYWORDS.dropped check.
+ ebuildlist = sorted(self.pkgs.values())
+ ebuildlist = [pkg.pf for pkg in ebuildlist]
+
+ self.filescheck.check(
+ checkdir, checkdirlist, checkdir_relative, self.changed.changed, self.changed.new)
+
+ self.status_check.check(self.check['ebuild_notadded'], checkdir, checkdir_relative, xpkg)
+ self.eadded.extend(self.status_check.eadded)
+
+ self.fetchcheck.check(
+ xpkg, checkdir, checkdir_relative, self.changed.changed, self.changed.new)
+
+ if self.check['changelog'] and "ChangeLog" not in checkdirlist:
+ self.qatracker.add_error("changelog.missing", xpkg + "/ChangeLog")
+
+ self.pkgmeta.check(xpkg, checkdir, checkdirlist, self.repolevel)
+ self.muselist = frozenset(self.pkgmeta.musedict)
+
+ changelog_path = os.path.join(checkdir_relative, "ChangeLog")
+ self.changelog_modified = changelog_path in self.changed.changelogs
+
+ self._scan_ebuilds(ebuildlist, xpkg, catdir, pkgdir)
+ return self.qatracker, can_force
+
+
+ def _scan_ebuilds(self, ebuildlist, xpkg, catdir, pkgdir):
+ # detect unused local USE-descriptions
+ used_useflags = set()
+
+ for y_ebuild in ebuildlist:
+
+ ebuild = Ebuild(
+ self.repo_settings, self.repolevel, pkgdir, catdir, self.vcs_settings,
+ xpkg, y_ebuild)
+
+ if self.check['changelog'] and not self.changelog_modified \
+ and ebuild.ebuild_path in self.changed.new_ebuilds:
+ self.qatracker.add_error('changelog.ebuildadded', ebuild.relative_path)
+
+ if ebuild.untracked(self.check['ebuild_notadded'], y_ebuild, self.eadded):
+ # ebuild not added to vcs
+ self.qatracker.add_error(
+ "ebuild.notadded", xpkg + "/" + y_ebuild + ".ebuild")
+
+ if bad_split_check(xpkg, y_ebuild, pkgdir, self.qatracker):
+ continue
+
+ pkg = self.pkgs[y_ebuild]
+ if pkg_invalid(pkg, self.qatracker, ebuild):
+ self.allvalid = False
+ continue
+
+ myaux = pkg._metadata
+ eapi = myaux["EAPI"]
+ inherited = pkg.inherited
+ live_ebuild = self.live_eclasses.intersection(inherited)
+
+ self.eapicheck.check(pkg, ebuild)
+
+ for k, v in myaux.items():
+ if not isinstance(v, basestring):
+ continue
+ m = NON_ASCII_RE.search(v)
+ if m is not None:
+ self.qatracker.add_error(
+ "variable.invalidchar",
+ "%s: %s variable contains non-ASCII "
+ "character at position %s" %
+ (ebuild.relative_path, k, m.start() + 1))
+
+ if not self.fetchcheck.src_uri_error:
+ self.thirdparty.check(myaux, ebuild.relative_path)
+
+ if myaux.get("PROVIDE"):
+ self.qatracker.add_error("virtual.oldstyle", ebuild.relative_path)
+
+ for pos, missing_var in enumerate(missingvars):
+ if not myaux.get(missing_var):
+ if catdir == "virtual" and \
+ missing_var in ("HOMEPAGE", "LICENSE"):
+ continue
+ if live_ebuild and missing_var == "KEYWORDS":
+ continue
+ myqakey = missingvars[pos] + ".missing"
+ self.qatracker.add_error(myqakey, xpkg + "/" + y_ebuild + ".ebuild")
+
+ if catdir == "virtual":
+ for var in ("HOMEPAGE", "LICENSE"):
+ if myaux.get(var):
+ myqakey = var + ".virtual"
+ self.qatracker.add_error(myqakey, ebuild.relative_path)
+
+ self.descriptioncheck.check(pkg, ebuild)
+
+ keywords = myaux["KEYWORDS"].split()
+
+ ebuild_archs = set(
+ kw.lstrip("~") for kw in keywords if not kw.startswith("-"))
+
+ self.keywordcheck.check(
+ pkg, xpkg, ebuild, y_ebuild, keywords, ebuild_archs, self.changed,
+ live_ebuild, self.repo_metadata['kwlist'], self.profiles)
+
+ if live_ebuild and self.repo_settings.repo_config.name == "gentoo":
+ self.liveeclasscheck.check(
+ pkg, xpkg, ebuild, y_ebuild, keywords, self.repo_metadata['pmaskdict'])
+
+ if self.options.ignore_arches:
+ arches = [[
+ self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
+ self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
+ else:
+ arches = set()
+ for keyword in keywords:
+ if keyword[0] == "-":
+ continue
+ elif keyword[0] == "~":
+ arch = keyword[1:]
+ if arch == "*":
+ for expanded_arch in self.profiles:
+ if expanded_arch == "**":
+ continue
+ arches.add(
+ (keyword, expanded_arch, (
+ expanded_arch, "~" + expanded_arch)))
+ else:
+ arches.add((keyword, arch, (arch, keyword)))
+ else:
+ if keyword == "*":
+ for expanded_arch in self.profiles:
+ if expanded_arch == "**":
+ continue
+ arches.add(
+ (keyword, expanded_arch, (expanded_arch,)))
+ else:
+ arches.add((keyword, keyword, (keyword,)))
+ if not arches:
+ # Use an empty profile for checking dependencies of
+ # packages that have empty KEYWORDS.
+ arches.add(('**', '**', ('**',)))
+
+ unknown_pkgs = set()
+ baddepsyntax = False
+ badlicsyntax = False
+ badprovsyntax = False
+ # catpkg = catdir + "/" + y_ebuild
+
+ inherited_java_eclass = "java-pkg-2" in inherited or \
+ "java-pkg-opt-2" in inherited
+ inherited_wxwidgets_eclass = "wxwidgets" in inherited
+ # operator_tokens = set(["||", "(", ")"])
+ type_list, badsyntax = [], []
+ for mytype in Package._dep_keys + ("LICENSE", "PROPERTIES", "PROVIDE"):
+ mydepstr = myaux[mytype]
+
+ buildtime = mytype in Package._buildtime_keys
+ runtime = mytype in Package._runtime_keys
+ token_class = None
+ if mytype.endswith("DEPEND"):
+ token_class = portage.dep.Atom
+
+ try:
+ atoms = portage.dep.use_reduce(
+ mydepstr, matchall=1, flat=True,
+ is_valid_flag=pkg.iuse.is_valid_flag, token_class=token_class)
+ except portage.exception.InvalidDependString as e:
+ atoms = None
+ badsyntax.append(str(e))
+
+ if atoms and mytype.endswith("DEPEND"):
+ if runtime and \
+ "test?" in mydepstr.split():
+ self.qatracker.add_error(
+ mytype + '.suspect',
+ "%s: 'test?' USE conditional in %s" %
+ (ebuild.relative_path, mytype))
+
+ for atom in atoms:
+ if atom == "||":
+ continue
+
+ is_blocker = atom.blocker
+
+ # Skip dependency.unknown for blockers, so that we
+ # don't encourage people to remove necessary blockers,
+ # as discussed in bug 382407. We use atom.without_use
+ # due to bug 525376.
+ if not is_blocker and \
+ not self.portdb.xmatch("match-all", atom.without_use) and \
+ not atom.cp.startswith("virtual/"):
+ unknown_pkgs.add((mytype, atom.unevaluated_atom))
+
+ if catdir != "virtual":
+ if not is_blocker and \
+ atom.cp in suspect_virtual:
+ self.qatracker.add_error(
+ 'virtual.suspect', ebuild.relative_path +
+ ": %s: consider using '%s' instead of '%s'" %
+ (mytype, suspect_virtual[atom.cp], atom))
+ if not is_blocker and \
+ atom.cp.startswith("perl-core/"):
+ self.qatracker.add_error('dependency.perlcore',
+ ebuild.relative_path +
+ ": %s: please use '%s' instead of '%s'" %
+ (mytype,
+ atom.replace("perl-core/","virtual/perl-"),
+ atom))
+
+ if buildtime and \
+ not is_blocker and \
+ not inherited_java_eclass and \
+ atom.cp == "virtual/jdk":
+ self.qatracker.add_error(
+ 'java.eclassesnotused', ebuild.relative_path)
+ elif buildtime and \
+ not is_blocker and \
+ not inherited_wxwidgets_eclass and \
+ atom.cp == "x11-libs/wxGTK":
+ self.qatracker.add_error(
+ 'wxwidgets.eclassnotused',
+ "%s: %ss on x11-libs/wxGTK without inheriting"
+ " wxwidgets.eclass" % (ebuild.relative_path, mytype))
+ elif runtime:
+ if not is_blocker and \
+ atom.cp in suspect_rdepend:
+ self.qatracker.add_error(
+ mytype + '.suspect',
+ ebuild.relative_path + ": '%s'" % atom)
+
+ if atom.operator == "~" and \
+ portage.versions.catpkgsplit(atom.cpv)[3] != "r0":
+ qacat = 'dependency.badtilde'
+ self.qatracker.add_error(
+ qacat, "%s: %s uses the ~ operator"
+ " with a non-zero revision: '%s'" %
+ (ebuild.relative_path, mytype, atom))
+
+ check_missingslot(atom, mytype, eapi, self.portdb, self.qatracker,
+ ebuild.relative_path, myaux)
+
+ type_list.extend([mytype] * (len(badsyntax) - len(type_list)))
+
+ for m, b in zip(type_list, badsyntax):
+ if m.endswith("DEPEND"):
+ qacat = "dependency.syntax"
+ else:
+ qacat = m + ".syntax"
+ self.qatracker.add_error(
+ qacat, "%s: %s: %s" % (ebuild.relative_path, m, b))
+
+ badlicsyntax = len([z for z in type_list if z == "LICENSE"])
+ badprovsyntax = len([z for z in type_list if z == "PROVIDE"])
+ baddepsyntax = len(type_list) != badlicsyntax + badprovsyntax
+ badlicsyntax = badlicsyntax > 0
+ badprovsyntax = badprovsyntax > 0
+
+ self.use_flag_checks.check(pkg, xpkg, ebuild, y_ebuild, self.muselist)
+
+ ebuild_used_useflags = self.use_flag_checks.getUsedUseFlags()
+ used_useflags = used_useflags.union(ebuild_used_useflags)
+
+ self.rubyeclasscheck.check(pkg, ebuild)
+
+ # license checks
+ if not badlicsyntax:
+ self.licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
+
+ self.restrictcheck.check(pkg, xpkg, ebuild, y_ebuild)
+
+ # Syntax Checks
+ if not self.vcs_settings.vcs_preserves_mtime:
+ if ebuild.ebuild_path not in self.changed.new_ebuilds and \
+ ebuild.ebuild_path not in self.changed.ebuilds:
+ pkg.mtime = None
+ try:
+ # All ebuilds should have utf_8 encoding.
+ f = io.open(
+ _unicode_encode(
+ ebuild.full_path, encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['repo.content'])
+ try:
+ for check_name, e in run_checks(f, pkg):
+ self.qatracker.add_error(
+ check_name, ebuild.relative_path + ': %s' % e)
+ finally:
+ f.close()
+ except UnicodeDecodeError:
+ # A file.UTF8 failure will have already been recorded above.
+ pass
+
+ if self.options.force:
+ # The dep_check() calls are the most expensive QA test. If --force
+ # is enabled, there's no point in wasting time on these since the
+ # user is intent on forcing the commit anyway.
+ continue
+
+ relevant_profiles = []
+ for keyword, arch, groups in arches:
+ if arch not in self.profiles:
+ # A missing profile will create an error further down
+ # during the KEYWORDS verification.
+ continue
+
+ if self.include_arches is not None:
+ if arch not in self.include_arches:
+ continue
+
+ relevant_profiles.extend(
+ (keyword, groups, prof) for prof in self.profiles[arch])
+
+ relevant_profiles.sort(key=sort_key)
+
+ for keyword, groups, prof in relevant_profiles:
+
+ is_stable_profile = prof.status == "stable"
+ is_dev_profile = prof.status == "dev" and \
+ self.options.include_dev
+ is_exp_profile = prof.status == "exp" and \
+ self.options.include_exp_profiles == 'y'
+ if not (is_stable_profile or is_dev_profile or is_exp_profile):
+ continue
+
+ dep_settings = self.caches['arch'].get(prof.sub_path)
+ if dep_settings is None:
+ dep_settings = portage.config(
+ config_profile_path=prof.abs_path,
+ config_incrementals=self.repoman_incrementals,
+ config_root=self.config_root,
+ local_config=False,
+ _unmatched_removal=self.options.unmatched_removal,
+ env=self.env, repositories=self.repo_settings.repoman_settings.repositories)
+ dep_settings.categories = self.repo_settings.repoman_settings.categories
+ if self.options.without_mask:
+ dep_settings._mask_manager_obj = \
+ copy.deepcopy(dep_settings._mask_manager)
+ dep_settings._mask_manager._pmaskdict.clear()
+ self.caches['arch'][prof.sub_path] = dep_settings
+
+ xmatch_cache_key = (prof.sub_path, tuple(groups))
+ xcache = self.caches['arch_xmatch'].get(xmatch_cache_key)
+ if xcache is None:
+ self.portdb.melt()
+ self.portdb.freeze()
+ xcache = self.portdb.xcache
+ xcache.update(self.caches['shared_xmatch'])
+ self.caches['arch_xmatch'][xmatch_cache_key] = xcache
+
+ self.repo_settings.trees[self.repo_settings.root]["porttree"].settings = dep_settings
+ self.portdb.settings = dep_settings
+ self.portdb.xcache = xcache
+
+ dep_settings["ACCEPT_KEYWORDS"] = " ".join(groups)
+ # just in case, prevent config.reset() from nuking these.
+ dep_settings.backup_changes("ACCEPT_KEYWORDS")
+
+ # This attribute is used in dbapi._match_use() to apply
+ # use.stable.{mask,force} settings based on the stable
+ # status of the parent package. This is required in order
+ # for USE deps of unstable packages to be resolved correctly,
+ # since otherwise use.stable.{mask,force} settings of
+ # dependencies may conflict (see bug #456342).
+ dep_settings._parent_stable = dep_settings._isStable(pkg)
+
+ # Handle package.use*.{force,mask) calculation, for use
+ # in dep_check.
+ dep_settings.useforce = dep_settings._use_manager.getUseForce(
+ pkg, stable=dep_settings._parent_stable)
+ dep_settings.usemask = dep_settings._use_manager.getUseMask(
+ pkg, stable=dep_settings._parent_stable)
+
+ if not baddepsyntax:
+ ismasked = not ebuild_archs or \
+ pkg.cpv not in self.portdb.xmatch("match-visible",
+ Atom("%s::%s" % (pkg.cp, self.repo_settings.repo_config.name)))
+ if ismasked:
+ if not self.have['pmasked']:
+ self.have['pmasked'] = bool(dep_settings._getMaskAtom(
+ pkg.cpv, pkg._metadata))
+ if self.options.ignore_masked:
+ continue
+ # we are testing deps for a masked package; give it some lee-way
+ suffix = "masked"
+ matchmode = "minimum-all"
+ else:
+ suffix = ""
+ matchmode = "minimum-visible"
+
+ if not self.have['dev_keywords']:
+ self.have['dev_keywords'] = \
+ bool(self.dev_keywords.intersection(keywords))
+
+ if prof.status == "dev":
+ suffix = suffix + "indev"
+
+ for mytype in Package._dep_keys:
+
+ mykey = "dependency.bad" + suffix
+ myvalue = myaux[mytype]
+ if not myvalue:
+ continue
+
+ success, atoms = portage.dep_check(
+ myvalue, self.portdb, dep_settings,
+ use="all", mode=matchmode, trees=self.repo_settings.trees)
+
+ if success:
+ if atoms:
+
+ # Don't bother with dependency.unknown for
+ # cases in which *DEPEND.bad is triggered.
+ for atom in atoms:
+ # dep_check returns all blockers and they
+ # aren't counted for *DEPEND.bad, so we
+ # ignore them here.
+ if not atom.blocker:
+ unknown_pkgs.discard(
+ (mytype, atom.unevaluated_atom))
+
+ if not prof.sub_path:
+ # old-style virtuals currently aren't
+ # resolvable with empty profile, since
+ # 'virtuals' mappings are unavailable
+ # (it would be expensive to search
+ # for PROVIDE in all ebuilds)
+ atoms = [
+ atom for atom in atoms if not (
+ atom.cp.startswith('virtual/')
+ and not self.portdb.cp_list(atom.cp))]
+
+ # we have some unsolvable deps
+ # remove ! deps, which always show up as unsatisfiable
+ atoms = [
+ str(atom.unevaluated_atom)
+ for atom in atoms if not atom.blocker]
+
+ # if we emptied out our list, continue:
+ if not atoms:
+ continue
+ self.qatracker.add_error(mykey,
+ "%s: %s: %s(%s)\n%s"
+ % (ebuild.relative_path, mytype, keyword, prof,
+ pformat(atoms, indent=6)))
+ else:
+ self.qatracker.add_error(mykey,
+ "%s: %s: %s(%s)\n%s"
+ % (ebuild.relative_path, mytype, keyword, prof,
+ pformat(atoms, indent=6)))
+
+ if not baddepsyntax and unknown_pkgs:
+ type_map = {}
+ for mytype, atom in unknown_pkgs:
+ type_map.setdefault(mytype, set()).add(atom)
+ for mytype, atoms in type_map.items():
+ self.qatracker.add_error(
+ "dependency.unknown", "%s: %s: %s"
+ % (ebuild.relative_path, mytype, ", ".join(sorted(atoms))))
+
+ # check if there are unused local USE-descriptions in metadata.xml
+ # (unless there are any invalids, to avoid noise)
+ if self.allvalid:
+ for myflag in self.muselist.difference(used_useflags):
+ self.qatracker.add_error(
+ "metadata.warning",
+ "%s/metadata.xml: unused local USE-description: '%s'"
+ % (xpkg, myflag))
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
@ 2015-09-21 23:47 Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
0 siblings, 1 reply; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:47 UTC (permalink / raw
To: gentoo-commits
commit: 8553e18d54009d5fb804a7a9d65ae0d8f7de2cba
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 00:48:05 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=8553e18d
repoman: Move the remaining actions to an Actions class
Fix regression from which always runs commit mode.
Error found by Mike Gilbert
actions.py: Assign repoman_settings from the repo_settings variable
Add a return to the end perform(), it just didn't seem right to leave it hanging.
pym/repoman/{main.py => actions.py} | 662 +++++++++++++------------------
pym/repoman/main.py | 756 ++----------------------------------
2 files changed, 302 insertions(+), 1116 deletions(-)
diff --git a/pym/repoman/main.py b/pym/repoman/actions.py
old mode 100755
new mode 100644
similarity index 66%
copy from pym/repoman/main.py
copy to pym/repoman/actions.py
index 2b2f91d..611c0dd
--- a/pym/repoman/main.py
+++ b/pym/repoman/actions.py
@@ -1,337 +1,80 @@
-#!/usr/bin/python -bO
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-from __future__ import print_function, unicode_literals
import errno
import io
import logging
+import platform
import re
import signal
import subprocess
import sys
import tempfile
-import platform
from itertools import chain
-from os import path as osp
-if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
- pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__)))) #, "pym")
- sys.path.insert(0, pym_path)
-# import our centrally initialized portage instance
-from repoman._portage import portage
-portage._internal_caller = True
-portage._disable_legacy_globals()
-
+from _emerge.UserQuery import UserQuery
+import portage
+from portage import cvstree
from portage import os
from portage import _encodings
from portage import _unicode_encode
-from _emerge.UserQuery import UserQuery
-import portage.checksum
-import portage.const
-import portage.repository.config
-from portage import cvstree
-from portage import util
-from portage.process import find_binary, spawn
from portage.output import (
- bold, create_color_func, green, nocolor, red)
-from portage.output import ConsoleStyleFile, StyleWriter
-from portage.util import formatter
-from portage.util import writemsg_level
+ bold, create_color_func, green, red)
from portage.package.ebuild.digestgen import digestgen
+from portage.process import find_binary, spawn
+from portage.util import writemsg_level
-from repoman.argparser import parse_args
-from repoman.checks.ebuilds.checks import checks_init
+from repoman._subprocess import repoman_popen, repoman_getstatusoutput
from repoman.errors import err
from repoman.gpg import gpgsign, need_signature
-from repoman.qa_data import (
- format_qa_output, format_qa_output_column, qahelp,
- qawarnings, qacats)
-from repoman.repos import RepoSettings
-from repoman.scanner import Scanner
-from repoman._subprocess import repoman_popen, repoman_getstatusoutput
from repoman import utilities
-from repoman.vcs.vcs import (
- git_supports_gpg_sign, vcs_files_to_cps, VCSSettings)
-
-
-if sys.hexversion >= 0x3000000:
- basestring = str
-
-util.initialize_logger()
+from repoman.vcs.vcs import git_supports_gpg_sign, vcs_files_to_cps
bad = create_color_func("BAD")
-# A sane umask is needed for files that portage creates.
-os.umask(0o22)
-
-
-def repoman_main(argv):
- config_root = os.environ.get("PORTAGE_CONFIGROOT")
- repoman_settings = portage.config(config_root=config_root, local_config=False)
-
- if repoman_settings.get("NOCOLOR", "").lower() in ("yes", "true") or \
- repoman_settings.get('TERM') == 'dumb' or \
- not sys.stdout.isatty():
- nocolor()
-
- options, arguments = parse_args(
- sys.argv, qahelp, repoman_settings.get("REPOMAN_DEFAULT_OPTS", ""))
-
- if options.version:
- print("Portage", portage.VERSION)
- sys.exit(0)
-
- if options.experimental_inherit == 'y':
- # This is experimental, so it's non-fatal.
- qawarnings.add("inherit.missing")
- checks_init(experimental_inherit=True)
-
- # Set this to False when an extraordinary issue (generally
- # something other than a QA issue) makes it impossible to
- # commit (like if Manifest generation fails).
- can_force = True
-
- portdir, portdir_overlay, mydir = utilities.FindPortdir(repoman_settings)
- if portdir is None:
- sys.exit(1)
-
- myreporoot = os.path.basename(portdir_overlay)
- myreporoot += mydir[len(portdir_overlay):]
-
- vcs_settings = VCSSettings(options, repoman_settings)
-
- repo_settings = RepoSettings(
- config_root, portdir, portdir_overlay,
- repoman_settings, vcs_settings, options, qawarnings)
- repoman_settings = repo_settings.repoman_settings
- portdb = repo_settings.portdb
-
- if 'digest' in repoman_settings.features and options.digest != 'n':
- options.digest = 'y'
-
- logging.debug("vcs: %s" % (vcs_settings.vcs,))
- logging.debug("repo config: %s" % (repo_settings.repo_config,))
- logging.debug("options: %s" % (options,))
-
- # It's confusing if these warnings are displayed without the user
- # being told which profile they come from, so disable them.
- env = os.environ.copy()
- env['FEATURES'] = env.get('FEATURES', '') + ' -unknown-features-warn'
-
- # Perform the main checks
- scanner = Scanner(repo_settings, myreporoot, config_root, options,
- vcs_settings, mydir, env)
- qatracker, can_force = scanner.scan_pkgs(can_force)
-
- commitmessage = None
-
- if options.if_modified == "y" and len(scanner.effective_scanlist) < 1:
- logging.warning("--if-modified is enabled, but no modified packages were found!")
-
- # dofail will be true if we have failed in at least one non-warning category
- dofail = 0
- # dowarn will be true if we tripped any warnings
- dowarn = 0
- # dofull will be true if we should print a "repoman full" informational message
- dofull = options.mode != 'full'
-
- # early out for manifest generation
- if options.mode == "manifest":
- sys.exit(dofail)
-
- for x in qacats:
- if x not in qatracker.fails:
- continue
- dowarn = 1
- if x not in qawarnings:
- dofail = 1
-
- if dofail or \
- (dowarn and not (options.quiet or options.mode == "scan")):
- dofull = 0
-
- # Save QA output so that it can be conveniently displayed
- # in $EDITOR while the user creates a commit message.
- # Otherwise, the user would not be able to see this output
- # once the editor has taken over the screen.
- qa_output = io.StringIO()
- style_file = ConsoleStyleFile(sys.stdout)
- if options.mode == 'commit' and \
- (not commitmessage or not commitmessage.strip()):
- style_file.write_listener = qa_output
- console_writer = StyleWriter(file=style_file, maxcol=9999)
- console_writer.style_listener = style_file.new_styles
-
- f = formatter.AbstractFormatter(console_writer)
-
- format_outputs = {
- 'column': format_qa_output_column,
- 'default': format_qa_output
- }
-
- format_output = format_outputs.get(
- options.output_style, format_outputs['default'])
- format_output(f, qatracker.fails, dofull, dofail, options, qawarnings)
-
- style_file.flush()
- del console_writer, f, style_file
- qa_output = qa_output.getvalue()
- qa_output = qa_output.splitlines(True)
-
- suggest_ignore_masked = False
- suggest_include_dev = False
-
- if scanner.have['pmasked'] and not (options.without_mask or options.ignore_masked):
- suggest_ignore_masked = True
- if scanner.have['dev_keywords'] and not options.include_dev:
- suggest_include_dev = True
-
- if suggest_ignore_masked or suggest_include_dev:
- print()
- if suggest_ignore_masked:
- print(bold(
- "Note: use --without-mask to check "
- "KEYWORDS on dependencies of masked packages"))
- if suggest_include_dev:
- print(bold(
- "Note: use --include-dev (-d) to check "
- "dependencies for 'dev' profiles"))
- print()
+class Actions(object):
+ '''Handles post check result output and performs
+ the various vcs activities for committing the results'''
+
+ def __init__(self, repo_settings, options, scanner, vcs_settings):
+ self.repo_settings = repo_settings
+ self.options = options
+ self.scanner = scanner
+ self.vcs_settings = vcs_settings
+ self.repoman_settings = repo_settings.repoman_settings
+ self.suggest = {
+ 'ignore_masked': False,
+ 'include_dev': False,
+ }
+ if scanner.have['pmasked'] and not (options.without_mask or options.ignore_masked):
+ self.suggest['ignore_masked'] = True
+ if scanner.have['dev_keywords'] and not options.include_dev:
+ self.suggest['include_dev'] = True
+
+
+ def inform(self, can_force, result):
+ '''Inform the user of all the problems found'''
+ if self.suggest['ignore_masked'] or self.suggest['include_dev']:
+ self._suggest()
+ if self.options.mode != 'commit':
+ self._non_commit(result)
+ return False
+ else:
+ self._fail(result, can_force)
+ if self.options.pretend:
+ utilities.repoman_sez(
+ "\"So, you want to play it safe. Good call.\"\n")
+ return True
- if options.mode != 'commit':
- if dofull:
- print(bold("Note: type \"repoman full\" for a complete listing."))
- if dowarn and not dofail:
- utilities.repoman_sez(
- "\"You're only giving me a partial QA payment?\n"
- " I'll take it this time, but I'm not happy.\"")
- elif not dofail:
- utilities.repoman_sez(
- "\"If everyone were like you, I'd be out of business!\"")
- elif dofail:
- print(bad("Please fix these important QA issues first."))
- utilities.repoman_sez(
- "\"Make your QA payment on time"
- " and you'll never see the likes of me.\"\n")
- sys.exit(1)
- else:
- if dofail and can_force and options.force and not options.pretend:
- utilities.repoman_sez(
- " \"You want to commit even with these QA issues?\n"
- " I'll take it this time, but I'm not happy.\"\n")
- elif dofail:
- if options.force and not can_force:
- print(bad(
- "The --force option has been disabled"
- " due to extraordinary issues."))
- print(bad("Please fix these important QA issues first."))
- utilities.repoman_sez(
- "\"Make your QA payment on time"
- " and you'll never see the likes of me.\"\n")
- sys.exit(1)
- if options.pretend:
- utilities.repoman_sez(
- "\"So, you want to play it safe. Good call.\"\n")
+ def perform(self, qa_output):
+ myunadded, mydeleted = self._vcs_unadded()
- myunadded = []
- if vcs_settings.vcs == "cvs":
- try:
- myvcstree = portage.cvstree.getentries("./", recursive=1)
- myunadded = portage.cvstree.findunadded(
- myvcstree, recursive=1, basedir="./")
- except SystemExit as e:
- raise # TODO propagate this
- except:
- err("Error retrieving CVS tree; exiting.")
- if vcs_settings.vcs == "svn":
- try:
- with repoman_popen("svn status --no-ignore") as f:
- svnstatus = f.readlines()
- myunadded = [
- "./" + elem.rstrip().split()[1]
- for elem in svnstatus
- if elem.startswith("?") or elem.startswith("I")]
- except SystemExit as e:
- raise # TODO propagate this
- except:
- err("Error retrieving SVN info; exiting.")
- if vcs_settings.vcs == "git":
- # get list of files not under version control or missing
- myf = repoman_popen("git ls-files --others")
- myunadded = ["./" + elem[:-1] for elem in myf]
- myf.close()
- if vcs_settings.vcs == "bzr":
- try:
- with repoman_popen("bzr status -S .") as f:
- bzrstatus = f.readlines()
- myunadded = [
- "./" + elem.rstrip().split()[1].split('/')[-1:][0]
- for elem in bzrstatus
- if elem.startswith("?") or elem[0:2] == " D"]
- except SystemExit as e:
- raise # TODO propagate this
- except:
- err("Error retrieving bzr info; exiting.")
- if vcs_settings.vcs == "hg":
- with repoman_popen("hg status --no-status --unknown .") as f:
- myunadded = f.readlines()
- myunadded = ["./" + elem.rstrip() for elem in myunadded]
+ myautoadd = self._vcs_autoadd(myunadded)
- # Mercurial doesn't handle manually deleted files as removed from
- # the repository, so the user need to remove them before commit,
- # using "hg remove [FILES]"
- with repoman_popen("hg status --no-status --deleted .") as f:
- mydeleted = f.readlines()
- mydeleted = ["./" + elem.rstrip() for elem in mydeleted]
+ self._vcs_deleted(mydeleted)
- myautoadd = []
- if myunadded:
- for x in range(len(myunadded) - 1, -1, -1):
- xs = myunadded[x].split("/")
- if 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]
- elif xs[-1] == "files":
- print("!!! files dir is not added! Please correct this.")
- sys.exit(-1)
- elif xs[-1] == "Manifest":
- # It's a manifest... auto add
- myautoadd += [myunadded[x]]
- del myunadded[x]
-
- if myunadded:
- print(red(
- "!!! The following files are in your local tree"
- " but are not added to the master"))
- print(red(
- "!!! tree. Please remove them from the local tree"
- " or add them to the master tree."))
- for x in myunadded:
- print(" ", x)
- print()
- print()
- sys.exit(1)
-
- if vcs_settings.vcs == "hg" and mydeleted:
- print(red(
- "!!! The following files are removed manually"
- " from your local tree but are not"))
- print(red(
- "!!! removed from the repository."
- " Please remove them, using \"hg remove [FILES]\"."))
- for x in mydeleted:
- print(" ", x)
- print()
- print()
- sys.exit(1)
-
- if vcs_settings.vcs == "cvs":
+ if self.vcs_settings.vcs == "cvs":
mycvstree = cvstree.getentries("./", recursive=1)
mychanged = cvstree.findchanged(mycvstree, recursive=1, basedir="./")
mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./")
@@ -340,7 +83,7 @@ def repoman_main(argv):
no_expansion = set(portage.cvstree.findoption(
mycvstree, bin_blob_pattern, recursive=1, basedir="./"))
- if vcs_settings.vcs == "svn":
+ if self.vcs_settings.vcs == "svn":
with repoman_popen("svn status") as f:
svnstatus = f.readlines()
mychanged = [
@@ -363,7 +106,7 @@ def repoman_main(argv):
("./" + prop.split(" - ")[0], prop.split(" - ")[1].split())
for prop in props if " - " in prop)
- elif vcs_settings.vcs == "git":
+ elif self.vcs_settings.vcs == "git":
with repoman_popen(
"git diff-index --name-only "
"--relative --diff-filter=M HEAD") as f:
@@ -382,7 +125,7 @@ def repoman_main(argv):
myremoved = f.readlines()
myremoved = ["./" + elem[:-1] for elem in myremoved]
- if vcs_settings.vcs == "bzr":
+ if self.vcs_settings.vcs == "bzr":
with repoman_popen("bzr status -S .") as f:
bzrstatus = f.readlines()
mychanged = [
@@ -403,7 +146,7 @@ def repoman_main(argv):
if elem and (elem[1:2] == "K" or elem[0:1] == "R")]
# Bazaar expands nothing.
- if vcs_settings.vcs == "hg":
+ if self.vcs_settings.vcs == "hg":
with repoman_popen("hg status --no-status --modified .") as f:
mychanged = f.readlines()
mychanged = ["./" + elem.rstrip() for elem in mychanged]
@@ -416,9 +159,9 @@ def repoman_main(argv):
myremoved = f.readlines()
myremoved = ["./" + elem.rstrip() for elem in myremoved]
- if vcs_settings.vcs:
+ if self.vcs_settings.vcs:
a_file_is_changed = mychanged or mynew or myremoved
- a_file_is_deleted_hg = vcs_settings.vcs == "hg" and mydeleted
+ a_file_is_deleted_hg = self.vcs_settings.vcs == "hg" and mydeleted
if not (a_file_is_changed or a_file_is_deleted_hg):
utilities.repoman_sez(
@@ -442,12 +185,12 @@ def repoman_main(argv):
mymanifests = list(mymanifests)
myheaders = []
- commitmessage = options.commitmsg
- if options.commitmsgfile:
+ commitmessage = self.options.commitmsg
+ if self.options.commitmsgfile:
try:
f = io.open(
_unicode_encode(
- options.commitmsgfile,
+ self.options.commitmsgfile,
encoding=_encodings['fs'], errors='strict'),
mode='r', encoding=_encodings['content'], errors='replace')
commitmessage = f.read()
@@ -457,15 +200,15 @@ def repoman_main(argv):
if e.errno == errno.ENOENT:
portage.writemsg(
"!!! File Not Found:"
- " --commitmsgfile='%s'\n" % options.commitmsgfile)
+ " --commitmsgfile='%s'\n" % self.options.commitmsgfile)
else:
raise
# We've read the content so the file is no longer needed.
commitmessagefile = None
if not commitmessage or not commitmessage.strip():
msg_prefix = ""
- if scanner.repolevel > 1:
- msg_prefix = "/".join(scanner.reposplit[1:]) + ": "
+ if self.scanner.repolevel > 1:
+ msg_prefix = "/".join(self.scanner.reposplit[1:]) + ": "
try:
editor = os.environ.get("EDITOR")
@@ -484,29 +227,29 @@ def repoman_main(argv):
commitmessage = commitmessage.rstrip()
changelog_msg = commitmessage
portage_version = getattr(portage, "VERSION", None)
- gpg_key = repoman_settings.get("PORTAGE_GPG_KEY", "")
- dco_sob = repoman_settings.get("DCO_SIGNED_OFF_BY", "")
+ gpg_key = self.repoman_settings.get("PORTAGE_GPG_KEY", "")
+ dco_sob = self.repoman_settings.get("DCO_SIGNED_OFF_BY", "")
if portage_version is None:
sys.stderr.write("Failed to insert portage version in message!\n")
sys.stderr.flush()
portage_version = "Unknown"
report_options = []
- if options.force:
+ if self.options.force:
report_options.append("--force")
- if options.ignore_arches:
+ if self.options.ignore_arches:
report_options.append("--ignore-arches")
- if scanner.include_arches is not None:
+ if self.scanner.include_arches is not None:
report_options.append(
"--include-arches=\"%s\"" %
- " ".join(sorted(scanner.include_arches)))
+ " ".join(sorted(self.scanner.include_arches)))
- if vcs_settings.vcs == "git":
+ if self.vcs_settings.vcs == "git":
# Use new footer only for git (see bug #438364).
commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version
if report_options:
commit_footer += "\nRepoMan-Options: " + " ".join(report_options)
- if repo_settings.sign_manifests:
+ if self.repo_settings.sign_manifests:
commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, )
if dco_sob:
commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
@@ -520,10 +263,10 @@ def repoman_main(argv):
if dco_sob:
commit_footer += "Signed-off-by: %s\n" % (dco_sob, )
commit_footer += "(Portage version: %s/%s/%s" % \
- (portage_version, vcs_settings.vcs, unameout)
+ (portage_version, self.vcs_settings.vcs, unameout)
if report_options:
commit_footer += ", RepoMan options: " + " ".join(report_options)
- if repo_settings.sign_manifests:
+ if self.repo_settings.sign_manifests:
commit_footer += ", signed Manifest commit with key %s" % \
(gpg_key, )
else:
@@ -533,24 +276,24 @@ def repoman_main(argv):
commitmessage += commit_footer
broken_changelog_manifests = []
- if options.echangelog in ('y', 'force'):
+ if self.options.echangelog in ('y', 'force'):
logging.info("checking for unmodified ChangeLog files")
- committer_name = utilities.get_committer_name(env=repoman_settings)
+ committer_name = utilities.get_committer_name(env=self.repoman_settings)
for x in sorted(vcs_files_to_cps(
chain(myupdates, mymanifests, myremoved),
- scanner.repolevel, scanner.reposplit, scanner.categories)):
+ self.scanner.repolevel, self.scanner.reposplit, self.scanner.categories)):
catdir, pkgdir = x.split("/")
- checkdir = repo_settings.repodir + "/" + x
+ checkdir = self.repo_settings.repodir + "/" + x
checkdir_relative = ""
- if scanner.repolevel < 3:
+ if self.scanner.repolevel < 3:
checkdir_relative = os.path.join(pkgdir, checkdir_relative)
- if scanner.repolevel < 2:
+ if self.scanner.repolevel < 2:
checkdir_relative = os.path.join(catdir, checkdir_relative)
checkdir_relative = os.path.join(".", checkdir_relative)
changelog_path = os.path.join(checkdir_relative, "ChangeLog")
- changelog_modified = changelog_path in scanner.changed.changelogs
- if changelog_modified and options.echangelog != 'force':
+ changelog_modified = changelog_path in self.scanner.changed.changelogs
+ if changelog_modified and self.options.echangelog != 'force':
continue
# get changes for this package
@@ -566,15 +309,15 @@ def repoman_main(argv):
nontrivial_cl_files = set()
nontrivial_cl_files.update(clnew, clremoved, clchanged)
nontrivial_cl_files.difference_update(['Manifest'])
- if not nontrivial_cl_files and options.echangelog != 'force':
+ if not nontrivial_cl_files and self.options.echangelog != 'force':
continue
new_changelog = utilities.UpdateChangeLog(
checkdir_relative, committer_name, changelog_msg,
- os.path.join(repo_settings.repodir, 'skel.ChangeLog'),
+ os.path.join(self.repo_settings.repodir, 'skel.ChangeLog'),
catdir, pkgdir,
new=clnew, removed=clremoved, changed=clchanged,
- pretend=options.pretend)
+ pretend=self.options.pretend)
if new_changelog is None:
writemsg_level(
"!!! Updating the ChangeLog failed\n",
@@ -588,18 +331,18 @@ def repoman_main(argv):
else:
myupdates.append(changelog_path)
- if options.ask and not options.pretend:
+ if self.options.ask and not self.options.pretend:
# regenerate Manifest for modified ChangeLog (bug #420735)
- repoman_settings["O"] = checkdir
- digestgen(mysettings=repoman_settings, myportdb=portdb)
+ self.repoman_settings["O"] = checkdir
+ digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
else:
broken_changelog_manifests.append(x)
if myautoadd:
print(">>> Auto-Adding missing Manifest/ChangeLog file(s)...")
- add_cmd = [vcs_settings.vcs, "add"]
+ add_cmd = [self.vcs_settings.vcs, "add"]
add_cmd += myautoadd
- if options.pretend:
+ if self.options.pretend:
portage.writemsg_stdout(
"(%s)\n" % " ".join(add_cmd),
noiselevel=-1)
@@ -618,22 +361,22 @@ def repoman_main(argv):
retcode = subprocess.call(add_cmd)
if retcode != os.EX_OK:
logging.error(
- "Exiting on %s error code: %s\n" % (vcs_settings.vcs, retcode))
+ "Exiting on %s error code: %s\n" % (self.vcs_settings.vcs, retcode))
sys.exit(retcode)
myupdates += myautoadd
print("* %s files being committed..." % green(str(len(myupdates))), end=' ')
- if vcs_settings.vcs not in ('cvs', 'svn'):
+ if self.vcs_settings.vcs not in ('cvs', 'svn'):
# With git, bzr and hg, there's never any keyword expansion, so
# there's no need to regenerate manifests and all files will be
# committed in one big commit at the end.
print()
- elif not repo_settings.repo_config.thin_manifest:
- if vcs_settings.vcs == 'cvs':
+ elif not self.repo_settings.repo_config.thin_manifest:
+ if self.vcs_settings.vcs == 'cvs':
headerstring = "'\$(Header|Id).*\$'"
- elif vcs_settings.vcs == "svn":
+ elif self.vcs_settings.vcs == "svn":
svn_keywords = dict((k.lower(), k) for k in [
"Rev",
"Revision",
@@ -651,12 +394,12 @@ def repoman_main(argv):
for myfile in myupdates:
# for CVS, no_expansion contains files that are excluded from expansion
- if vcs_settings.vcs == "cvs":
+ if self.vcs_settings.vcs == "cvs":
if myfile in no_expansion:
continue
# for SVN, expansion contains files that are included in expansion
- elif vcs_settings.vcs == "svn":
+ elif self.vcs_settings.vcs == "svn":
if myfile not in expansion:
continue
@@ -684,8 +427,8 @@ def repoman_main(argv):
logging.info("myupdates: %s", myupdates)
logging.info("myheaders: %s", myheaders)
- uq = UserQuery(options)
- if options.ask and uq.query('Commit changes?', True) != 'Yes':
+ uq = UserQuery(self.options)
+ if self.options.ask and uq.query('Commit changes?', True) != 'Yes':
print("* aborting commit.")
sys.exit(128 + signal.SIGINT)
@@ -713,22 +456,22 @@ def repoman_main(argv):
# so strip the prefix.
myfiles = [f.lstrip("./") for f in myfiles]
- commit_cmd = [vcs_settings.vcs]
- commit_cmd.extend(vcs_settings.vcs_global_opts)
+ commit_cmd = [self.vcs_settings.vcs]
+ commit_cmd.extend(self.vcs_settings.vcs_global_opts)
commit_cmd.append("commit")
- commit_cmd.extend(vcs_settings.vcs_local_opts)
+ commit_cmd.extend(self.vcs_settings.vcs_local_opts)
commit_cmd.extend(["-F", commitmessagefile])
commit_cmd.extend(myfiles)
try:
- if options.pretend:
+ if self.options.pretend:
print("(%s)" % (" ".join(commit_cmd),))
else:
- retval = spawn(commit_cmd, env=repo_settings.commit_env)
+ retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
if retval != os.EX_OK:
writemsg_level(
"!!! Exiting on %s (shell) "
- "error code: %s\n" % (vcs_settings.vcs, retval),
+ "error code: %s\n" % (self.vcs_settings.vcs, retval),
level=logging.ERROR, noiselevel=-1)
sys.exit(retval)
finally:
@@ -759,39 +502,39 @@ def repoman_main(argv):
if modified:
portage.util.write_atomic(x, b''.join(mylines), mode='wb')
- if scanner.repolevel == 1:
+ if self.scanner.repolevel == 1:
utilities.repoman_sez(
"\"You're rather crazy... "
"doing the entire repository.\"\n")
- if vcs_settings.vcs in ('cvs', 'svn') and (myupdates or myremoved):
+ if self.vcs_settings.vcs in ('cvs', 'svn') and (myupdates or myremoved):
for x in sorted(vcs_files_to_cps(
chain(myupdates, myremoved, mymanifests),
- scanner.repolevel, scanner.reposplit, scanner.categories)):
- repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
- digestgen(mysettings=repoman_settings, myportdb=portdb)
+ self.scanner.repolevel, self.scanner.reposplit, self.scanner.categories)):
+ self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
+ digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
elif broken_changelog_manifests:
for x in broken_changelog_manifests:
- repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
- digestgen(mysettings=repoman_settings, myportdb=portdb)
+ self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
+ digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
- if repo_settings.sign_manifests:
+ if self.repo_settings.sign_manifests:
try:
for x in sorted(vcs_files_to_cps(
chain(myupdates, myremoved, mymanifests),
- scanner.repolevel, scanner.reposplit, scanner.categories)):
- repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
- manifest_path = os.path.join(repoman_settings["O"], "Manifest")
+ self.scanner.repolevel, self.scanner.reposplit, self.scanner.categories)):
+ self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
+ manifest_path = os.path.join(self.repoman_settings["O"], "Manifest")
if not need_signature(manifest_path):
continue
- gpgsign(manifest_path, repoman_settings, options)
+ gpgsign(manifest_path, self.repoman_settings, self.options)
except portage.exception.PortageException as e:
portage.writemsg("!!! %s\n" % str(e))
portage.writemsg("!!! Disabled FEATURES='sign'\n")
- repo_settings.sign_manifests = False
+ self.repo_settings.sign_manifests = False
- if vcs_settings.vcs == 'git':
+ if self.vcs_settings.vcs == 'git':
# It's not safe to use the git commit -a option since there might
# be some modified files elsewhere in the working tree that the
# user doesn't want to commit. Therefore, call git update-index
@@ -802,14 +545,14 @@ def repoman_main(argv):
myfiles.sort()
update_index_cmd = ["git", "update-index"]
update_index_cmd.extend(f.lstrip("./") for f in myfiles)
- if options.pretend:
+ if self.options.pretend:
print("(%s)" % (" ".join(update_index_cmd),))
else:
retval = spawn(update_index_cmd, env=os.environ)
if retval != os.EX_OK:
writemsg_level(
"!!! Exiting on %s (shell) "
- "error code: %s\n" % (vcs_settings.vcs, retval),
+ "error code: %s\n" % (self.vcs_settings.vcs, retval),
level=logging.ERROR, noiselevel=-1)
sys.exit(retval)
@@ -829,15 +572,15 @@ def repoman_main(argv):
mymsg.close()
commit_cmd = []
- if options.pretend and vcs_settings.vcs is None:
+ if self.options.pretend and self.vcs_settings.vcs is None:
# substitute a bogus value for pretend output
commit_cmd.append("cvs")
else:
- commit_cmd.append(vcs_settings.vcs)
- commit_cmd.extend(vcs_settings.vcs_global_opts)
+ commit_cmd.append(self.vcs_settings.vcs)
+ commit_cmd.extend(self.vcs_settings.vcs_global_opts)
commit_cmd.append("commit")
- commit_cmd.extend(vcs_settings.vcs_local_opts)
- if vcs_settings.vcs == "hg":
+ commit_cmd.extend(self.vcs_settings.vcs_local_opts)
+ if self.vcs_settings.vcs == "hg":
commit_cmd.extend(["--logfile", commitmessagefile])
commit_cmd.extend(myfiles)
else:
@@ -845,12 +588,12 @@ def repoman_main(argv):
commit_cmd.extend(f.lstrip("./") for f in myfiles)
try:
- if options.pretend:
+ if self.options.pretend:
print("(%s)" % (" ".join(commit_cmd),))
else:
- retval = spawn(commit_cmd, env=repo_settings.commit_env)
+ retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
if retval != os.EX_OK:
- if repo_settings.repo_config.sign_commit and vcs_settings.vcs == 'git' and \
+ if self.repo_settings.repo_config.sign_commit and self.vcs_settings.vcs == 'git' and \
not git_supports_gpg_sign():
# Inform user that newer git is needed (bug #403323).
logging.error(
@@ -858,7 +601,7 @@ def repoman_main(argv):
writemsg_level(
"!!! Exiting on %s (shell) "
- "error code: %s\n" % (vcs_settings.vcs, retval),
+ "error code: %s\n" % (self.vcs_settings.vcs, retval),
level=logging.ERROR, noiselevel=-1)
sys.exit(retval)
finally:
@@ -868,7 +611,7 @@ def repoman_main(argv):
pass
print()
- if vcs_settings.vcs:
+ if self.vcs_settings.vcs:
print("Commit complete.")
else:
print(
@@ -877,4 +620,155 @@ def repoman_main(argv):
" that he forgot to commit anything")
utilities.repoman_sez(
"\"If everyone were like you, I'd be out of business!\"\n")
- sys.exit(0)
+ return
+
+
+ def _suggest(self):
+ print()
+ if self.suggest['ignore_masked']:
+ print(bold(
+ "Note: use --without-mask to check "
+ "KEYWORDS on dependencies of masked packages"))
+
+ if self.suggest['include_dev']:
+ print(bold(
+ "Note: use --include-dev (-d) to check "
+ "dependencies for 'dev' profiles"))
+ print()
+
+
+ def _non_commit(self, result):
+ if result['full']:
+ print(bold("Note: type \"repoman full\" for a complete listing."))
+ if result['warn'] and not result['fail']:
+ utilities.repoman_sez(
+ "\"You're only giving me a partial QA payment?\n"
+ " I'll take it this time, but I'm not happy.\"")
+ elif not result['fail']:
+ utilities.repoman_sez(
+ "\"If everyone were like you, I'd be out of business!\"")
+ elif result['fail']:
+ print(bad("Please fix these important QA issues first."))
+ 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):
+ if result['fail'] and can_force and self.options.force and not self.options.pretend:
+ utilities.repoman_sez(
+ " \"You want to commit even with these QA issues?\n"
+ " I'll take it this time, but I'm not happy.\"\n")
+ elif result['fail']:
+ if self.options.force and not can_force:
+ print(bad(
+ "The --force option has been disabled"
+ " due to extraordinary issues."))
+ print(bad("Please fix these important QA issues first."))
+ utilities.repoman_sez(
+ "\"Make your QA payment on time"
+ " and you'll never see the likes of me.\"\n")
+ sys.exit(1)
+
+
+ def _vcs_unadded(self):
+ myunadded = []
+ mydeleted = []
+ if self.vcs_settings.vcs == "cvs":
+ try:
+ myvcstree = portage.cvstree.getentries("./", recursive=1)
+ myunadded = portage.cvstree.findunadded(
+ myvcstree, recursive=1, basedir="./")
+ except SystemExit:
+ raise # TODO propagate this
+ except:
+ err("Error retrieving CVS tree; exiting.")
+ if self.vcs_settings.vcs == "svn":
+ try:
+ with repoman_popen("svn status --no-ignore") as f:
+ svnstatus = f.readlines()
+ myunadded = [
+ "./" + elem.rstrip().split()[1]
+ for elem in svnstatus
+ if elem.startswith("?") or elem.startswith("I")]
+ except SystemExit:
+ raise # TODO propagate this
+ except:
+ err("Error retrieving SVN info; exiting.")
+ if self.vcs_settings.vcs == "git":
+ # get list of files not under version control or missing
+ myf = repoman_popen("git ls-files --others")
+ myunadded = ["./" + elem[:-1] for elem in myf]
+ myf.close()
+ if self.vcs_settings.vcs == "bzr":
+ try:
+ with repoman_popen("bzr status -S .") as f:
+ bzrstatus = f.readlines()
+ myunadded = [
+ "./" + elem.rstrip().split()[1].split('/')[-1:][0]
+ for elem in bzrstatus
+ if elem.startswith("?") or elem[0:2] == " D"]
+ except SystemExit:
+ raise # TODO propagate this
+ except:
+ err("Error retrieving bzr info; exiting.")
+ if self.vcs_settings.vcs == "hg":
+ with repoman_popen("hg status --no-status --unknown .") as f:
+ myunadded = f.readlines()
+ myunadded = ["./" + elem.rstrip() for elem in myunadded]
+
+ # Mercurial doesn't handle manually deleted files as removed from
+ # the repository, so the user need to remove them before commit,
+ # using "hg remove [FILES]"
+ with repoman_popen("hg status --no-status --deleted .") as f:
+ mydeleted = f.readlines()
+ mydeleted = ["./" + elem.rstrip() for elem in mydeleted]
+ return myunadded, mydeleted
+
+
+ def _vcs_autoadd(self, myunadded):
+ myautoadd = []
+ 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:
+ # The Manifest excludes this file,
+ # so it's safe to ignore.
+ del myunadded[x]
+ elif xs[-1] == "files":
+ print("!!! files dir is not added! Please correct this.")
+ sys.exit(-1)
+ elif xs[-1] == "Manifest":
+ # It's a manifest... auto add
+ myautoadd += [myunadded[x]]
+ del myunadded[x]
+
+ if myunadded:
+ print(red(
+ "!!! The following files are in your local tree"
+ " but are not added to the master"))
+ print(red(
+ "!!! tree. Please remove them from the local tree"
+ " or add them to the master tree."))
+ for x in myunadded:
+ print(" ", x)
+ print()
+ print()
+ sys.exit(1)
+ return myautoadd
+
+
+ def _vcs_deleted(self, mydeleted):
+ if self.vcs_settings.vcs == "hg" and mydeleted:
+ print(red(
+ "!!! The following files are removed manually"
+ " from your local tree but are not"))
+ print(red(
+ "!!! removed from the repository."
+ " Please remove them, using \"hg remove [FILES]\"."))
+ for x in mydeleted:
+ print(" ", x)
+ print()
+ print()
+ sys.exit(1)
diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 2b2f91d..808c55e 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -4,16 +4,9 @@
from __future__ import print_function, unicode_literals
-import errno
import io
import logging
-import re
-import signal
-import subprocess
import sys
-import tempfile
-import platform
-from itertools import chain
from os import path as osp
if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
@@ -26,36 +19,24 @@ portage._disable_legacy_globals()
from portage import os
-from portage import _encodings
-from portage import _unicode_encode
-from _emerge.UserQuery import UserQuery
import portage.checksum
import portage.const
import portage.repository.config
-from portage import cvstree
from portage import util
-from portage.process import find_binary, spawn
-from portage.output import (
- bold, create_color_func, green, nocolor, red)
+from portage.output import create_color_func, nocolor
from portage.output import ConsoleStyleFile, StyleWriter
from portage.util import formatter
-from portage.util import writemsg_level
-from portage.package.ebuild.digestgen import digestgen
+from repoman.actions import Actions
from repoman.argparser import parse_args
from repoman.checks.ebuilds.checks import checks_init
-from repoman.errors import err
-from repoman.gpg import gpgsign, need_signature
from repoman.qa_data import (
format_qa_output, format_qa_output_column, qahelp,
qawarnings, qacats)
from repoman.repos import RepoSettings
from repoman.scanner import Scanner
-from repoman._subprocess import repoman_popen, repoman_getstatusoutput
from repoman import utilities
-from repoman.vcs.vcs import (
- git_supports_gpg_sign, vcs_files_to_cps, VCSSettings)
-
+from repoman.vcs.vcs import VCSSettings
if sys.hexversion >= 0x3000000:
basestring = str
@@ -107,7 +88,6 @@ def repoman_main(argv):
config_root, portdir, portdir_overlay,
repoman_settings, vcs_settings, options, qawarnings)
repoman_settings = repo_settings.repoman_settings
- portdb = repo_settings.portdb
if 'digest' in repoman_settings.features and options.digest != 'n':
options.digest = 'y'
@@ -131,27 +111,29 @@ def repoman_main(argv):
if options.if_modified == "y" and len(scanner.effective_scanlist) < 1:
logging.warning("--if-modified is enabled, but no modified packages were found!")
- # dofail will be true if we have failed in at least one non-warning category
- dofail = 0
- # dowarn will be true if we tripped any warnings
- dowarn = 0
- # dofull will be true if we should print a "repoman full" informational message
- dofull = options.mode != 'full'
+ result = {
+ # fail will be true if we have failed in at least one non-warning category
+ 'fail': 0,
+ # warn will be true if we tripped any warnings
+ 'warn': 0,
+ # full will be true if we should print a "repoman full" informational message
+ 'full': options.mode != 'full',
+ }
# early out for manifest generation
if options.mode == "manifest":
- sys.exit(dofail)
+ sys.exit(result['fail'])
for x in qacats:
if x not in qatracker.fails:
continue
- dowarn = 1
+ result['warn'] = 1
if x not in qawarnings:
- dofail = 1
+ result['fail'] = 1
- if dofail or \
- (dowarn and not (options.quiet or options.mode == "scan")):
- dofull = 0
+ if result['fail'] or \
+ (result['warn'] and not (options.quiet or options.mode == "scan")):
+ result['full'] = 0
# Save QA output so that it can be conveniently displayed
# in $EDITOR while the user creates a commit message.
@@ -174,707 +156,17 @@ def repoman_main(argv):
format_output = format_outputs.get(
options.output_style, format_outputs['default'])
- format_output(f, qatracker.fails, dofull, dofail, options, qawarnings)
+ format_output(f, qatracker.fails, result['full'], result['fail'], options, qawarnings)
style_file.flush()
del console_writer, f, style_file
qa_output = qa_output.getvalue()
qa_output = qa_output.splitlines(True)
- suggest_ignore_masked = False
- suggest_include_dev = False
-
- if scanner.have['pmasked'] and not (options.without_mask or options.ignore_masked):
- suggest_ignore_masked = True
- if scanner.have['dev_keywords'] and not options.include_dev:
- suggest_include_dev = True
-
- if suggest_ignore_masked or suggest_include_dev:
- print()
- if suggest_ignore_masked:
- print(bold(
- "Note: use --without-mask to check "
- "KEYWORDS on dependencies of masked packages"))
-
- if suggest_include_dev:
- print(bold(
- "Note: use --include-dev (-d) to check "
- "dependencies for 'dev' profiles"))
- print()
-
- if options.mode != 'commit':
- if dofull:
- print(bold("Note: type \"repoman full\" for a complete listing."))
- if dowarn and not dofail:
- utilities.repoman_sez(
- "\"You're only giving me a partial QA payment?\n"
- " I'll take it this time, but I'm not happy.\"")
- elif not dofail:
- utilities.repoman_sez(
- "\"If everyone were like you, I'd be out of business!\"")
- elif dofail:
- print(bad("Please fix these important QA issues first."))
- utilities.repoman_sez(
- "\"Make your QA payment on time"
- " and you'll never see the likes of me.\"\n")
- sys.exit(1)
- else:
- if dofail and can_force and options.force and not options.pretend:
- utilities.repoman_sez(
- " \"You want to commit even with these QA issues?\n"
- " I'll take it this time, but I'm not happy.\"\n")
- elif dofail:
- if options.force and not can_force:
- print(bad(
- "The --force option has been disabled"
- " due to extraordinary issues."))
- print(bad("Please fix these important QA issues first."))
- utilities.repoman_sez(
- "\"Make your QA payment on time"
- " and you'll never see the likes of me.\"\n")
- sys.exit(1)
-
- if options.pretend:
- utilities.repoman_sez(
- "\"So, you want to play it safe. Good call.\"\n")
-
- myunadded = []
- if vcs_settings.vcs == "cvs":
- try:
- myvcstree = portage.cvstree.getentries("./", recursive=1)
- myunadded = portage.cvstree.findunadded(
- myvcstree, recursive=1, basedir="./")
- except SystemExit as e:
- raise # TODO propagate this
- except:
- err("Error retrieving CVS tree; exiting.")
- if vcs_settings.vcs == "svn":
- try:
- with repoman_popen("svn status --no-ignore") as f:
- svnstatus = f.readlines()
- myunadded = [
- "./" + elem.rstrip().split()[1]
- for elem in svnstatus
- if elem.startswith("?") or elem.startswith("I")]
- except SystemExit as e:
- raise # TODO propagate this
- except:
- err("Error retrieving SVN info; exiting.")
- if vcs_settings.vcs == "git":
- # get list of files not under version control or missing
- myf = repoman_popen("git ls-files --others")
- myunadded = ["./" + elem[:-1] for elem in myf]
- myf.close()
- if vcs_settings.vcs == "bzr":
- try:
- with repoman_popen("bzr status -S .") as f:
- bzrstatus = f.readlines()
- myunadded = [
- "./" + elem.rstrip().split()[1].split('/')[-1:][0]
- for elem in bzrstatus
- if elem.startswith("?") or elem[0:2] == " D"]
- except SystemExit as e:
- raise # TODO propagate this
- except:
- err("Error retrieving bzr info; exiting.")
- if vcs_settings.vcs == "hg":
- with repoman_popen("hg status --no-status --unknown .") as f:
- myunadded = f.readlines()
- myunadded = ["./" + elem.rstrip() for elem in myunadded]
-
- # Mercurial doesn't handle manually deleted files as removed from
- # the repository, so the user need to remove them before commit,
- # using "hg remove [FILES]"
- with repoman_popen("hg status --no-status --deleted .") as f:
- mydeleted = f.readlines()
- mydeleted = ["./" + elem.rstrip() for elem in mydeleted]
-
- myautoadd = []
- if myunadded:
- for x in range(len(myunadded) - 1, -1, -1):
- xs = myunadded[x].split("/")
- if 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]
- elif xs[-1] == "files":
- print("!!! files dir is not added! Please correct this.")
- sys.exit(-1)
- elif xs[-1] == "Manifest":
- # It's a manifest... auto add
- myautoadd += [myunadded[x]]
- del myunadded[x]
-
- if myunadded:
- print(red(
- "!!! The following files are in your local tree"
- " but are not added to the master"))
- print(red(
- "!!! tree. Please remove them from the local tree"
- " or add them to the master tree."))
- for x in myunadded:
- print(" ", x)
- print()
- print()
- sys.exit(1)
-
- if vcs_settings.vcs == "hg" and mydeleted:
- print(red(
- "!!! The following files are removed manually"
- " from your local tree but are not"))
- print(red(
- "!!! removed from the repository."
- " Please remove them, using \"hg remove [FILES]\"."))
- for x in mydeleted:
- print(" ", x)
- print()
- print()
- sys.exit(1)
-
- if vcs_settings.vcs == "cvs":
- mycvstree = cvstree.getentries("./", recursive=1)
- mychanged = cvstree.findchanged(mycvstree, recursive=1, basedir="./")
- mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./")
- myremoved = portage.cvstree.findremoved(mycvstree, recursive=1, basedir="./")
- bin_blob_pattern = re.compile("^-kb$")
- no_expansion = set(portage.cvstree.findoption(
- mycvstree, bin_blob_pattern, recursive=1, basedir="./"))
-
- if vcs_settings.vcs == "svn":
- with repoman_popen("svn status") as f:
- svnstatus = f.readlines()
- mychanged = [
- "./" + elem.split()[-1:][0]
- for elem in svnstatus
- if (elem[:1] in "MR" or elem[1:2] in "M")]
- mynew = [
- "./" + elem.split()[-1:][0]
- for elem in svnstatus
- if elem.startswith("A")]
- myremoved = [
- "./" + elem.split()[-1:][0]
- for elem in svnstatus
- if elem.startswith("D")]
-
- # Subversion expands keywords specified in svn:keywords properties.
- with repoman_popen("svn propget -R svn:keywords") as f:
- props = f.readlines()
- expansion = dict(
- ("./" + prop.split(" - ")[0], prop.split(" - ")[1].split())
- for prop in props if " - " in prop)
-
- elif vcs_settings.vcs == "git":
- with repoman_popen(
- "git diff-index --name-only "
- "--relative --diff-filter=M HEAD") as f:
- mychanged = f.readlines()
- mychanged = ["./" + elem[:-1] for elem in mychanged]
-
- with repoman_popen(
- "git diff-index --name-only "
- "--relative --diff-filter=A HEAD") as f:
- mynew = f.readlines()
- mynew = ["./" + elem[:-1] for elem in mynew]
-
- with repoman_popen(
- "git diff-index --name-only "
- "--relative --diff-filter=D HEAD") as f:
- myremoved = f.readlines()
- myremoved = ["./" + elem[:-1] for elem in myremoved]
-
- if vcs_settings.vcs == "bzr":
- with repoman_popen("bzr status -S .") as f:
- bzrstatus = f.readlines()
- mychanged = [
- "./" + elem.split()[-1:][0].split('/')[-1:][0]
- for elem in bzrstatus
- if elem and elem[1:2] == "M"]
- mynew = [
- "./" + elem.split()[-1:][0].split('/')[-1:][0]
- for elem in bzrstatus
- if elem and (elem[1:2] in "NK" or elem[0:1] == "R")]
- myremoved = [
- "./" + elem.split()[-1:][0].split('/')[-1:][0]
- for elem in bzrstatus
- if elem.startswith("-")]
- myremoved = [
- "./" + elem.split()[-3:-2][0].split('/')[-1:][0]
- for elem in bzrstatus
- if elem and (elem[1:2] == "K" or elem[0:1] == "R")]
- # Bazaar expands nothing.
-
- if vcs_settings.vcs == "hg":
- with repoman_popen("hg status --no-status --modified .") as f:
- mychanged = f.readlines()
- mychanged = ["./" + elem.rstrip() for elem in mychanged]
-
- with repoman_popen("hg status --no-status --added .") as f:
- mynew = f.readlines()
- mynew = ["./" + elem.rstrip() for elem in mynew]
-
- with repoman_popen("hg status --no-status --removed .") as f:
- myremoved = f.readlines()
- myremoved = ["./" + elem.rstrip() for elem in myremoved]
-
- if vcs_settings.vcs:
- a_file_is_changed = mychanged or mynew or myremoved
- a_file_is_deleted_hg = vcs_settings.vcs == "hg" and mydeleted
-
- if not (a_file_is_changed or a_file_is_deleted_hg):
- utilities.repoman_sez(
- "\"Doing nothing is not always good for QA.\"")
- print()
- print("(Didn't find any changed files...)")
- print()
- sys.exit(1)
-
- # Manifests need to be regenerated after all other commits, so don't commit
- # them now even if they have changed.
- mymanifests = set()
- myupdates = set()
- for f in mychanged + mynew:
- if "Manifest" == os.path.basename(f):
- mymanifests.add(f)
- else:
- myupdates.add(f)
- myupdates.difference_update(myremoved)
- myupdates = list(myupdates)
- mymanifests = list(mymanifests)
- myheaders = []
-
- commitmessage = options.commitmsg
- if options.commitmsgfile:
- try:
- f = io.open(
- _unicode_encode(
- options.commitmsgfile,
- encoding=_encodings['fs'], errors='strict'),
- mode='r', encoding=_encodings['content'], errors='replace')
- commitmessage = f.read()
- f.close()
- del f
- except (IOError, OSError) as e:
- if e.errno == errno.ENOENT:
- portage.writemsg(
- "!!! File Not Found:"
- " --commitmsgfile='%s'\n" % options.commitmsgfile)
- else:
- raise
- # We've read the content so the file is no longer needed.
- commitmessagefile = None
- if not commitmessage or not commitmessage.strip():
- msg_prefix = ""
- if scanner.repolevel > 1:
- msg_prefix = "/".join(scanner.reposplit[1:]) + ": "
-
- try:
- editor = os.environ.get("EDITOR")
- if editor and utilities.editor_is_executable(editor):
- commitmessage = utilities.get_commit_message_with_editor(
- editor, message=qa_output, prefix=msg_prefix)
- else:
- commitmessage = utilities.get_commit_message_with_stdin()
- except KeyboardInterrupt:
- logging.fatal("Interrupted; exiting...")
- sys.exit(1)
- if (not commitmessage or not commitmessage.strip()
- or commitmessage.strip() == msg_prefix):
- print("* no commit message? aborting commit.")
- sys.exit(1)
- commitmessage = commitmessage.rstrip()
- changelog_msg = commitmessage
- portage_version = getattr(portage, "VERSION", None)
- gpg_key = repoman_settings.get("PORTAGE_GPG_KEY", "")
- dco_sob = repoman_settings.get("DCO_SIGNED_OFF_BY", "")
- if portage_version is None:
- sys.stderr.write("Failed to insert portage version in message!\n")
- sys.stderr.flush()
- portage_version = "Unknown"
-
- report_options = []
- if options.force:
- report_options.append("--force")
- if options.ignore_arches:
- report_options.append("--ignore-arches")
- if scanner.include_arches is not None:
- report_options.append(
- "--include-arches=\"%s\"" %
- " ".join(sorted(scanner.include_arches)))
-
- if vcs_settings.vcs == "git":
- # Use new footer only for git (see bug #438364).
- commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version
- if report_options:
- commit_footer += "\nRepoMan-Options: " + " ".join(report_options)
- if repo_settings.sign_manifests:
- commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, )
- if dco_sob:
- commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
- else:
- unameout = platform.system() + " "
- if platform.system() in ["Darwin", "SunOS"]:
- unameout += platform.processor()
- else:
- unameout += platform.machine()
- commit_footer = "\n\n"
- if dco_sob:
- commit_footer += "Signed-off-by: %s\n" % (dco_sob, )
- commit_footer += "(Portage version: %s/%s/%s" % \
- (portage_version, vcs_settings.vcs, unameout)
- if report_options:
- commit_footer += ", RepoMan options: " + " ".join(report_options)
- if repo_settings.sign_manifests:
- commit_footer += ", signed Manifest commit with key %s" % \
- (gpg_key, )
- else:
- commit_footer += ", unsigned Manifest commit"
- commit_footer += ")"
-
- commitmessage += commit_footer
-
- broken_changelog_manifests = []
- if options.echangelog in ('y', 'force'):
- logging.info("checking for unmodified ChangeLog files")
- committer_name = utilities.get_committer_name(env=repoman_settings)
- for x in sorted(vcs_files_to_cps(
- chain(myupdates, mymanifests, myremoved),
- scanner.repolevel, scanner.reposplit, scanner.categories)):
- catdir, pkgdir = x.split("/")
- checkdir = repo_settings.repodir + "/" + x
- checkdir_relative = ""
- if scanner.repolevel < 3:
- checkdir_relative = os.path.join(pkgdir, checkdir_relative)
- if scanner.repolevel < 2:
- checkdir_relative = os.path.join(catdir, checkdir_relative)
- checkdir_relative = os.path.join(".", checkdir_relative)
-
- changelog_path = os.path.join(checkdir_relative, "ChangeLog")
- changelog_modified = changelog_path in scanner.changed.changelogs
- if changelog_modified and options.echangelog != 'force':
- continue
-
- # get changes for this package
- cdrlen = len(checkdir_relative)
- check_relative = lambda e: e.startswith(checkdir_relative)
- split_relative = lambda e: e[cdrlen:]
- clnew = list(map(split_relative, filter(check_relative, mynew)))
- clremoved = list(map(split_relative, filter(check_relative, myremoved)))
- clchanged = list(map(split_relative, filter(check_relative, mychanged)))
-
- # Skip ChangeLog generation if only the Manifest was modified,
- # as discussed in bug #398009.
- nontrivial_cl_files = set()
- nontrivial_cl_files.update(clnew, clremoved, clchanged)
- nontrivial_cl_files.difference_update(['Manifest'])
- if not nontrivial_cl_files and options.echangelog != 'force':
- continue
-
- new_changelog = utilities.UpdateChangeLog(
- checkdir_relative, committer_name, changelog_msg,
- os.path.join(repo_settings.repodir, 'skel.ChangeLog'),
- catdir, pkgdir,
- new=clnew, removed=clremoved, changed=clchanged,
- pretend=options.pretend)
- if new_changelog is None:
- writemsg_level(
- "!!! Updating the ChangeLog failed\n",
- level=logging.ERROR, noiselevel=-1)
- sys.exit(1)
-
- # if the ChangeLog was just created, add it to vcs
- if new_changelog:
- myautoadd.append(changelog_path)
- # myautoadd is appended to myupdates below
- else:
- myupdates.append(changelog_path)
-
- if options.ask and not options.pretend:
- # regenerate Manifest for modified ChangeLog (bug #420735)
- repoman_settings["O"] = checkdir
- digestgen(mysettings=repoman_settings, myportdb=portdb)
- else:
- broken_changelog_manifests.append(x)
-
- if myautoadd:
- print(">>> Auto-Adding missing Manifest/ChangeLog file(s)...")
- add_cmd = [vcs_settings.vcs, "add"]
- add_cmd += myautoadd
- if options.pretend:
- portage.writemsg_stdout(
- "(%s)\n" % " ".join(add_cmd),
- noiselevel=-1)
- else:
-
- if sys.hexversion < 0x3020000 and sys.hexversion >= 0x3000000 and \
- not os.path.isabs(add_cmd[0]):
- # Python 3.1 _execvp throws TypeError for non-absolute executable
- # path passed as bytes (see http://bugs.python.org/issue8513).
- fullname = find_binary(add_cmd[0])
- if fullname is None:
- raise portage.exception.CommandNotFound(add_cmd[0])
- add_cmd[0] = fullname
-
- add_cmd = [_unicode_encode(arg) for arg in add_cmd]
- retcode = subprocess.call(add_cmd)
- if retcode != os.EX_OK:
- logging.error(
- "Exiting on %s error code: %s\n" % (vcs_settings.vcs, retcode))
- sys.exit(retcode)
-
- myupdates += myautoadd
-
- print("* %s files being committed..." % green(str(len(myupdates))), end=' ')
-
- if vcs_settings.vcs not in ('cvs', 'svn'):
- # With git, bzr and hg, there's never any keyword expansion, so
- # there's no need to regenerate manifests and all files will be
- # committed in one big commit at the end.
- print()
- elif not repo_settings.repo_config.thin_manifest:
- if vcs_settings.vcs == 'cvs':
- headerstring = "'\$(Header|Id).*\$'"
- elif vcs_settings.vcs == "svn":
- svn_keywords = dict((k.lower(), k) for k in [
- "Rev",
- "Revision",
- "LastChangedRevision",
- "Date",
- "LastChangedDate",
- "Author",
- "LastChangedBy",
- "URL",
- "HeadURL",
- "Id",
- "Header",
- ])
-
- for myfile in myupdates:
-
- # for CVS, no_expansion contains files that are excluded from expansion
- if vcs_settings.vcs == "cvs":
- if myfile in no_expansion:
- continue
-
- # for SVN, expansion contains files that are included in expansion
- elif vcs_settings.vcs == "svn":
- if myfile not in expansion:
- continue
-
- # Subversion keywords are case-insensitive
- # in svn:keywords properties,
- # but case-sensitive in contents of files.
- enabled_keywords = []
- for k in expansion[myfile]:
- keyword = svn_keywords.get(k.lower())
- if keyword is not None:
- enabled_keywords.append(keyword)
-
- headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords)
-
- myout = repoman_getstatusoutput(
- "egrep -q %s %s" % (headerstring, portage._shell_quote(myfile)))
- if myout[0] == 0:
- myheaders.append(myfile)
-
- print("%s have headers that will change." % green(str(len(myheaders))))
- print(
- "* Files with headers will"
- " cause the manifests to be changed and committed separately.")
-
- logging.info("myupdates: %s", myupdates)
- logging.info("myheaders: %s", myheaders)
-
- uq = UserQuery(options)
- if options.ask and uq.query('Commit changes?', True) != 'Yes':
- print("* aborting commit.")
- sys.exit(128 + signal.SIGINT)
-
- # Handle the case where committed files have keywords which
- # will change and need a priming commit before the Manifest
- # can be committed.
- if (myupdates or myremoved) and myheaders:
- myfiles = myupdates + myremoved
- fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
- mymsg = os.fdopen(fd, "wb")
- mymsg.write(_unicode_encode(commitmessage))
- mymsg.close()
-
- separator = '-' * 78
-
- print()
- print(green("Using commit message:"))
- print(green(separator))
- print(commitmessage)
- print(green(separator))
- print()
-
- # Having a leading ./ prefix on file paths can trigger a bug in
- # the cvs server when committing files to multiple directories,
- # so strip the prefix.
- myfiles = [f.lstrip("./") for f in myfiles]
-
- commit_cmd = [vcs_settings.vcs]
- commit_cmd.extend(vcs_settings.vcs_global_opts)
- commit_cmd.append("commit")
- commit_cmd.extend(vcs_settings.vcs_local_opts)
- commit_cmd.extend(["-F", commitmessagefile])
- commit_cmd.extend(myfiles)
-
- try:
- if options.pretend:
- print("(%s)" % (" ".join(commit_cmd),))
- else:
- retval = spawn(commit_cmd, env=repo_settings.commit_env)
- if retval != os.EX_OK:
- writemsg_level(
- "!!! Exiting on %s (shell) "
- "error code: %s\n" % (vcs_settings.vcs, retval),
- level=logging.ERROR, noiselevel=-1)
- sys.exit(retval)
- finally:
- try:
- os.unlink(commitmessagefile)
- except OSError:
- pass
-
- # When files are removed and re-added, the cvs server will put /Attic/
- # inside the $Header path. This code detects the problem and corrects it
- # so that the Manifest will generate correctly. See bug #169500.
- # Use binary mode in order to avoid potential character encoding issues.
- cvs_header_re = re.compile(br'^#\s*\$Header.*\$$')
- attic_str = b'/Attic/'
- attic_replace = b'/'
- for x in myheaders:
- f = open(
- _unicode_encode(x, encoding=_encodings['fs'], errors='strict'),
- mode='rb')
- mylines = f.readlines()
- f.close()
- modified = False
- for i, line in enumerate(mylines):
- if cvs_header_re.match(line) is not None and \
- attic_str in line:
- mylines[i] = line.replace(attic_str, attic_replace)
- modified = True
- if modified:
- portage.util.write_atomic(x, b''.join(mylines), mode='wb')
-
- if scanner.repolevel == 1:
- utilities.repoman_sez(
- "\"You're rather crazy... "
- "doing the entire repository.\"\n")
-
- if vcs_settings.vcs in ('cvs', 'svn') and (myupdates or myremoved):
- for x in sorted(vcs_files_to_cps(
- chain(myupdates, myremoved, mymanifests),
- scanner.repolevel, scanner.reposplit, scanner.categories)):
- repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
- digestgen(mysettings=repoman_settings, myportdb=portdb)
-
- elif broken_changelog_manifests:
- for x in broken_changelog_manifests:
- repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
- digestgen(mysettings=repoman_settings, myportdb=portdb)
-
- if repo_settings.sign_manifests:
- try:
- for x in sorted(vcs_files_to_cps(
- chain(myupdates, myremoved, mymanifests),
- scanner.repolevel, scanner.reposplit, scanner.categories)):
- repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
- manifest_path = os.path.join(repoman_settings["O"], "Manifest")
- if not need_signature(manifest_path):
- continue
- gpgsign(manifest_path, repoman_settings, options)
- except portage.exception.PortageException as e:
- portage.writemsg("!!! %s\n" % str(e))
- portage.writemsg("!!! Disabled FEATURES='sign'\n")
- repo_settings.sign_manifests = False
-
- if vcs_settings.vcs == 'git':
- # It's not safe to use the git commit -a option since there might
- # be some modified files elsewhere in the working tree that the
- # user doesn't want to commit. Therefore, call git update-index
- # in order to ensure that the index is updated with the latest
- # versions of all new and modified files in the relevant portion
- # of the working tree.
- myfiles = mymanifests + myupdates
- myfiles.sort()
- update_index_cmd = ["git", "update-index"]
- update_index_cmd.extend(f.lstrip("./") for f in myfiles)
- if options.pretend:
- print("(%s)" % (" ".join(update_index_cmd),))
- else:
- retval = spawn(update_index_cmd, env=os.environ)
- if retval != os.EX_OK:
- writemsg_level(
- "!!! Exiting on %s (shell) "
- "error code: %s\n" % (vcs_settings.vcs, retval),
- level=logging.ERROR, noiselevel=-1)
- sys.exit(retval)
-
- if True:
- myfiles = mymanifests[:]
- # If there are no header (SVN/CVS keywords) changes in
- # the files, this Manifest commit must include the
- # other (yet uncommitted) files.
- if not myheaders:
- myfiles += myupdates
- myfiles += myremoved
- myfiles.sort()
-
- fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
- mymsg = os.fdopen(fd, "wb")
- mymsg.write(_unicode_encode(commitmessage))
- mymsg.close()
-
- commit_cmd = []
- if options.pretend and vcs_settings.vcs is None:
- # substitute a bogus value for pretend output
- commit_cmd.append("cvs")
- else:
- commit_cmd.append(vcs_settings.vcs)
- commit_cmd.extend(vcs_settings.vcs_global_opts)
- commit_cmd.append("commit")
- commit_cmd.extend(vcs_settings.vcs_local_opts)
- if vcs_settings.vcs == "hg":
- commit_cmd.extend(["--logfile", commitmessagefile])
- commit_cmd.extend(myfiles)
- else:
- commit_cmd.extend(["-F", commitmessagefile])
- commit_cmd.extend(f.lstrip("./") for f in myfiles)
-
- try:
- if options.pretend:
- print("(%s)" % (" ".join(commit_cmd),))
- else:
- retval = spawn(commit_cmd, env=repo_settings.commit_env)
- if retval != os.EX_OK:
- if repo_settings.repo_config.sign_commit and vcs_settings.vcs == 'git' and \
- not git_supports_gpg_sign():
- # Inform user that newer git is needed (bug #403323).
- logging.error(
- "Git >=1.7.9 is required for signed commits!")
-
- writemsg_level(
- "!!! Exiting on %s (shell) "
- "error code: %s\n" % (vcs_settings.vcs, retval),
- level=logging.ERROR, noiselevel=-1)
- sys.exit(retval)
- finally:
- try:
- os.unlink(commitmessagefile)
- except OSError:
- pass
-
- print()
- if vcs_settings.vcs:
- print("Commit complete.")
- else:
- print(
- "repoman was too scared"
- " by not seeing any familiar version control file"
- " that he forgot to commit anything")
- utilities.repoman_sez(
- "\"If everyone were like you, I'd be out of business!\"\n")
+ # output the results
+ actions = Actions(repo_settings, options, scanner, vcs_settings)
+ if actions.inform(can_force, result):
+ # perform any other actions
+ actions.perform(qa_output)
+
sys.exit(0)
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
@ 2015-09-21 23:51 ` Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: 8553e18d54009d5fb804a7a9d65ae0d8f7de2cba
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 19 00:48:05 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:46 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=8553e18d
repoman: Move the remaining actions to an Actions class
Fix regression from which always runs commit mode.
Error found by Mike Gilbert
actions.py: Assign repoman_settings from the repo_settings variable
Add a return to the end perform(), it just didn't seem right to leave it hanging.
pym/repoman/{main.py => actions.py} | 662 +++++++++++++------------------
pym/repoman/main.py | 756 ++----------------------------------
2 files changed, 302 insertions(+), 1116 deletions(-)
diff --git a/pym/repoman/main.py b/pym/repoman/actions.py
old mode 100755
new mode 100644
similarity index 66%
copy from pym/repoman/main.py
copy to pym/repoman/actions.py
index 2b2f91d..611c0dd
--- a/pym/repoman/main.py
+++ b/pym/repoman/actions.py
@@ -1,337 +1,80 @@
-#!/usr/bin/python -bO
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-from __future__ import print_function, unicode_literals
import errno
import io
import logging
+import platform
import re
import signal
import subprocess
import sys
import tempfile
-import platform
from itertools import chain
-from os import path as osp
-if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
- pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__)))) #, "pym")
- sys.path.insert(0, pym_path)
-# import our centrally initialized portage instance
-from repoman._portage import portage
-portage._internal_caller = True
-portage._disable_legacy_globals()
-
+from _emerge.UserQuery import UserQuery
+import portage
+from portage import cvstree
from portage import os
from portage import _encodings
from portage import _unicode_encode
-from _emerge.UserQuery import UserQuery
-import portage.checksum
-import portage.const
-import portage.repository.config
-from portage import cvstree
-from portage import util
-from portage.process import find_binary, spawn
from portage.output import (
- bold, create_color_func, green, nocolor, red)
-from portage.output import ConsoleStyleFile, StyleWriter
-from portage.util import formatter
-from portage.util import writemsg_level
+ bold, create_color_func, green, red)
from portage.package.ebuild.digestgen import digestgen
+from portage.process import find_binary, spawn
+from portage.util import writemsg_level
-from repoman.argparser import parse_args
-from repoman.checks.ebuilds.checks import checks_init
+from repoman._subprocess import repoman_popen, repoman_getstatusoutput
from repoman.errors import err
from repoman.gpg import gpgsign, need_signature
-from repoman.qa_data import (
- format_qa_output, format_qa_output_column, qahelp,
- qawarnings, qacats)
-from repoman.repos import RepoSettings
-from repoman.scanner import Scanner
-from repoman._subprocess import repoman_popen, repoman_getstatusoutput
from repoman import utilities
-from repoman.vcs.vcs import (
- git_supports_gpg_sign, vcs_files_to_cps, VCSSettings)
-
-
-if sys.hexversion >= 0x3000000:
- basestring = str
-
-util.initialize_logger()
+from repoman.vcs.vcs import git_supports_gpg_sign, vcs_files_to_cps
bad = create_color_func("BAD")
-# A sane umask is needed for files that portage creates.
-os.umask(0o22)
-
-
-def repoman_main(argv):
- config_root = os.environ.get("PORTAGE_CONFIGROOT")
- repoman_settings = portage.config(config_root=config_root, local_config=False)
-
- if repoman_settings.get("NOCOLOR", "").lower() in ("yes", "true") or \
- repoman_settings.get('TERM') == 'dumb' or \
- not sys.stdout.isatty():
- nocolor()
-
- options, arguments = parse_args(
- sys.argv, qahelp, repoman_settings.get("REPOMAN_DEFAULT_OPTS", ""))
-
- if options.version:
- print("Portage", portage.VERSION)
- sys.exit(0)
-
- if options.experimental_inherit == 'y':
- # This is experimental, so it's non-fatal.
- qawarnings.add("inherit.missing")
- checks_init(experimental_inherit=True)
-
- # Set this to False when an extraordinary issue (generally
- # something other than a QA issue) makes it impossible to
- # commit (like if Manifest generation fails).
- can_force = True
-
- portdir, portdir_overlay, mydir = utilities.FindPortdir(repoman_settings)
- if portdir is None:
- sys.exit(1)
-
- myreporoot = os.path.basename(portdir_overlay)
- myreporoot += mydir[len(portdir_overlay):]
-
- vcs_settings = VCSSettings(options, repoman_settings)
-
- repo_settings = RepoSettings(
- config_root, portdir, portdir_overlay,
- repoman_settings, vcs_settings, options, qawarnings)
- repoman_settings = repo_settings.repoman_settings
- portdb = repo_settings.portdb
-
- if 'digest' in repoman_settings.features and options.digest != 'n':
- options.digest = 'y'
-
- logging.debug("vcs: %s" % (vcs_settings.vcs,))
- logging.debug("repo config: %s" % (repo_settings.repo_config,))
- logging.debug("options: %s" % (options,))
-
- # It's confusing if these warnings are displayed without the user
- # being told which profile they come from, so disable them.
- env = os.environ.copy()
- env['FEATURES'] = env.get('FEATURES', '') + ' -unknown-features-warn'
-
- # Perform the main checks
- scanner = Scanner(repo_settings, myreporoot, config_root, options,
- vcs_settings, mydir, env)
- qatracker, can_force = scanner.scan_pkgs(can_force)
-
- commitmessage = None
-
- if options.if_modified == "y" and len(scanner.effective_scanlist) < 1:
- logging.warning("--if-modified is enabled, but no modified packages were found!")
-
- # dofail will be true if we have failed in at least one non-warning category
- dofail = 0
- # dowarn will be true if we tripped any warnings
- dowarn = 0
- # dofull will be true if we should print a "repoman full" informational message
- dofull = options.mode != 'full'
-
- # early out for manifest generation
- if options.mode == "manifest":
- sys.exit(dofail)
-
- for x in qacats:
- if x not in qatracker.fails:
- continue
- dowarn = 1
- if x not in qawarnings:
- dofail = 1
-
- if dofail or \
- (dowarn and not (options.quiet or options.mode == "scan")):
- dofull = 0
-
- # Save QA output so that it can be conveniently displayed
- # in $EDITOR while the user creates a commit message.
- # Otherwise, the user would not be able to see this output
- # once the editor has taken over the screen.
- qa_output = io.StringIO()
- style_file = ConsoleStyleFile(sys.stdout)
- if options.mode == 'commit' and \
- (not commitmessage or not commitmessage.strip()):
- style_file.write_listener = qa_output
- console_writer = StyleWriter(file=style_file, maxcol=9999)
- console_writer.style_listener = style_file.new_styles
-
- f = formatter.AbstractFormatter(console_writer)
-
- format_outputs = {
- 'column': format_qa_output_column,
- 'default': format_qa_output
- }
-
- format_output = format_outputs.get(
- options.output_style, format_outputs['default'])
- format_output(f, qatracker.fails, dofull, dofail, options, qawarnings)
-
- style_file.flush()
- del console_writer, f, style_file
- qa_output = qa_output.getvalue()
- qa_output = qa_output.splitlines(True)
-
- suggest_ignore_masked = False
- suggest_include_dev = False
-
- if scanner.have['pmasked'] and not (options.without_mask or options.ignore_masked):
- suggest_ignore_masked = True
- if scanner.have['dev_keywords'] and not options.include_dev:
- suggest_include_dev = True
-
- if suggest_ignore_masked or suggest_include_dev:
- print()
- if suggest_ignore_masked:
- print(bold(
- "Note: use --without-mask to check "
- "KEYWORDS on dependencies of masked packages"))
- if suggest_include_dev:
- print(bold(
- "Note: use --include-dev (-d) to check "
- "dependencies for 'dev' profiles"))
- print()
+class Actions(object):
+ '''Handles post check result output and performs
+ the various vcs activities for committing the results'''
+
+ def __init__(self, repo_settings, options, scanner, vcs_settings):
+ self.repo_settings = repo_settings
+ self.options = options
+ self.scanner = scanner
+ self.vcs_settings = vcs_settings
+ self.repoman_settings = repo_settings.repoman_settings
+ self.suggest = {
+ 'ignore_masked': False,
+ 'include_dev': False,
+ }
+ if scanner.have['pmasked'] and not (options.without_mask or options.ignore_masked):
+ self.suggest['ignore_masked'] = True
+ if scanner.have['dev_keywords'] and not options.include_dev:
+ self.suggest['include_dev'] = True
+
+
+ def inform(self, can_force, result):
+ '''Inform the user of all the problems found'''
+ if self.suggest['ignore_masked'] or self.suggest['include_dev']:
+ self._suggest()
+ if self.options.mode != 'commit':
+ self._non_commit(result)
+ return False
+ else:
+ self._fail(result, can_force)
+ if self.options.pretend:
+ utilities.repoman_sez(
+ "\"So, you want to play it safe. Good call.\"\n")
+ return True
- if options.mode != 'commit':
- if dofull:
- print(bold("Note: type \"repoman full\" for a complete listing."))
- if dowarn and not dofail:
- utilities.repoman_sez(
- "\"You're only giving me a partial QA payment?\n"
- " I'll take it this time, but I'm not happy.\"")
- elif not dofail:
- utilities.repoman_sez(
- "\"If everyone were like you, I'd be out of business!\"")
- elif dofail:
- print(bad("Please fix these important QA issues first."))
- utilities.repoman_sez(
- "\"Make your QA payment on time"
- " and you'll never see the likes of me.\"\n")
- sys.exit(1)
- else:
- if dofail and can_force and options.force and not options.pretend:
- utilities.repoman_sez(
- " \"You want to commit even with these QA issues?\n"
- " I'll take it this time, but I'm not happy.\"\n")
- elif dofail:
- if options.force and not can_force:
- print(bad(
- "The --force option has been disabled"
- " due to extraordinary issues."))
- print(bad("Please fix these important QA issues first."))
- utilities.repoman_sez(
- "\"Make your QA payment on time"
- " and you'll never see the likes of me.\"\n")
- sys.exit(1)
- if options.pretend:
- utilities.repoman_sez(
- "\"So, you want to play it safe. Good call.\"\n")
+ def perform(self, qa_output):
+ myunadded, mydeleted = self._vcs_unadded()
- myunadded = []
- if vcs_settings.vcs == "cvs":
- try:
- myvcstree = portage.cvstree.getentries("./", recursive=1)
- myunadded = portage.cvstree.findunadded(
- myvcstree, recursive=1, basedir="./")
- except SystemExit as e:
- raise # TODO propagate this
- except:
- err("Error retrieving CVS tree; exiting.")
- if vcs_settings.vcs == "svn":
- try:
- with repoman_popen("svn status --no-ignore") as f:
- svnstatus = f.readlines()
- myunadded = [
- "./" + elem.rstrip().split()[1]
- for elem in svnstatus
- if elem.startswith("?") or elem.startswith("I")]
- except SystemExit as e:
- raise # TODO propagate this
- except:
- err("Error retrieving SVN info; exiting.")
- if vcs_settings.vcs == "git":
- # get list of files not under version control or missing
- myf = repoman_popen("git ls-files --others")
- myunadded = ["./" + elem[:-1] for elem in myf]
- myf.close()
- if vcs_settings.vcs == "bzr":
- try:
- with repoman_popen("bzr status -S .") as f:
- bzrstatus = f.readlines()
- myunadded = [
- "./" + elem.rstrip().split()[1].split('/')[-1:][0]
- for elem in bzrstatus
- if elem.startswith("?") or elem[0:2] == " D"]
- except SystemExit as e:
- raise # TODO propagate this
- except:
- err("Error retrieving bzr info; exiting.")
- if vcs_settings.vcs == "hg":
- with repoman_popen("hg status --no-status --unknown .") as f:
- myunadded = f.readlines()
- myunadded = ["./" + elem.rstrip() for elem in myunadded]
+ myautoadd = self._vcs_autoadd(myunadded)
- # Mercurial doesn't handle manually deleted files as removed from
- # the repository, so the user need to remove them before commit,
- # using "hg remove [FILES]"
- with repoman_popen("hg status --no-status --deleted .") as f:
- mydeleted = f.readlines()
- mydeleted = ["./" + elem.rstrip() for elem in mydeleted]
+ self._vcs_deleted(mydeleted)
- myautoadd = []
- if myunadded:
- for x in range(len(myunadded) - 1, -1, -1):
- xs = myunadded[x].split("/")
- if 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]
- elif xs[-1] == "files":
- print("!!! files dir is not added! Please correct this.")
- sys.exit(-1)
- elif xs[-1] == "Manifest":
- # It's a manifest... auto add
- myautoadd += [myunadded[x]]
- del myunadded[x]
-
- if myunadded:
- print(red(
- "!!! The following files are in your local tree"
- " but are not added to the master"))
- print(red(
- "!!! tree. Please remove them from the local tree"
- " or add them to the master tree."))
- for x in myunadded:
- print(" ", x)
- print()
- print()
- sys.exit(1)
-
- if vcs_settings.vcs == "hg" and mydeleted:
- print(red(
- "!!! The following files are removed manually"
- " from your local tree but are not"))
- print(red(
- "!!! removed from the repository."
- " Please remove them, using \"hg remove [FILES]\"."))
- for x in mydeleted:
- print(" ", x)
- print()
- print()
- sys.exit(1)
-
- if vcs_settings.vcs == "cvs":
+ if self.vcs_settings.vcs == "cvs":
mycvstree = cvstree.getentries("./", recursive=1)
mychanged = cvstree.findchanged(mycvstree, recursive=1, basedir="./")
mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./")
@@ -340,7 +83,7 @@ def repoman_main(argv):
no_expansion = set(portage.cvstree.findoption(
mycvstree, bin_blob_pattern, recursive=1, basedir="./"))
- if vcs_settings.vcs == "svn":
+ if self.vcs_settings.vcs == "svn":
with repoman_popen("svn status") as f:
svnstatus = f.readlines()
mychanged = [
@@ -363,7 +106,7 @@ def repoman_main(argv):
("./" + prop.split(" - ")[0], prop.split(" - ")[1].split())
for prop in props if " - " in prop)
- elif vcs_settings.vcs == "git":
+ elif self.vcs_settings.vcs == "git":
with repoman_popen(
"git diff-index --name-only "
"--relative --diff-filter=M HEAD") as f:
@@ -382,7 +125,7 @@ def repoman_main(argv):
myremoved = f.readlines()
myremoved = ["./" + elem[:-1] for elem in myremoved]
- if vcs_settings.vcs == "bzr":
+ if self.vcs_settings.vcs == "bzr":
with repoman_popen("bzr status -S .") as f:
bzrstatus = f.readlines()
mychanged = [
@@ -403,7 +146,7 @@ def repoman_main(argv):
if elem and (elem[1:2] == "K" or elem[0:1] == "R")]
# Bazaar expands nothing.
- if vcs_settings.vcs == "hg":
+ if self.vcs_settings.vcs == "hg":
with repoman_popen("hg status --no-status --modified .") as f:
mychanged = f.readlines()
mychanged = ["./" + elem.rstrip() for elem in mychanged]
@@ -416,9 +159,9 @@ def repoman_main(argv):
myremoved = f.readlines()
myremoved = ["./" + elem.rstrip() for elem in myremoved]
- if vcs_settings.vcs:
+ if self.vcs_settings.vcs:
a_file_is_changed = mychanged or mynew or myremoved
- a_file_is_deleted_hg = vcs_settings.vcs == "hg" and mydeleted
+ a_file_is_deleted_hg = self.vcs_settings.vcs == "hg" and mydeleted
if not (a_file_is_changed or a_file_is_deleted_hg):
utilities.repoman_sez(
@@ -442,12 +185,12 @@ def repoman_main(argv):
mymanifests = list(mymanifests)
myheaders = []
- commitmessage = options.commitmsg
- if options.commitmsgfile:
+ commitmessage = self.options.commitmsg
+ if self.options.commitmsgfile:
try:
f = io.open(
_unicode_encode(
- options.commitmsgfile,
+ self.options.commitmsgfile,
encoding=_encodings['fs'], errors='strict'),
mode='r', encoding=_encodings['content'], errors='replace')
commitmessage = f.read()
@@ -457,15 +200,15 @@ def repoman_main(argv):
if e.errno == errno.ENOENT:
portage.writemsg(
"!!! File Not Found:"
- " --commitmsgfile='%s'\n" % options.commitmsgfile)
+ " --commitmsgfile='%s'\n" % self.options.commitmsgfile)
else:
raise
# We've read the content so the file is no longer needed.
commitmessagefile = None
if not commitmessage or not commitmessage.strip():
msg_prefix = ""
- if scanner.repolevel > 1:
- msg_prefix = "/".join(scanner.reposplit[1:]) + ": "
+ if self.scanner.repolevel > 1:
+ msg_prefix = "/".join(self.scanner.reposplit[1:]) + ": "
try:
editor = os.environ.get("EDITOR")
@@ -484,29 +227,29 @@ def repoman_main(argv):
commitmessage = commitmessage.rstrip()
changelog_msg = commitmessage
portage_version = getattr(portage, "VERSION", None)
- gpg_key = repoman_settings.get("PORTAGE_GPG_KEY", "")
- dco_sob = repoman_settings.get("DCO_SIGNED_OFF_BY", "")
+ gpg_key = self.repoman_settings.get("PORTAGE_GPG_KEY", "")
+ dco_sob = self.repoman_settings.get("DCO_SIGNED_OFF_BY", "")
if portage_version is None:
sys.stderr.write("Failed to insert portage version in message!\n")
sys.stderr.flush()
portage_version = "Unknown"
report_options = []
- if options.force:
+ if self.options.force:
report_options.append("--force")
- if options.ignore_arches:
+ if self.options.ignore_arches:
report_options.append("--ignore-arches")
- if scanner.include_arches is not None:
+ if self.scanner.include_arches is not None:
report_options.append(
"--include-arches=\"%s\"" %
- " ".join(sorted(scanner.include_arches)))
+ " ".join(sorted(self.scanner.include_arches)))
- if vcs_settings.vcs == "git":
+ if self.vcs_settings.vcs == "git":
# Use new footer only for git (see bug #438364).
commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version
if report_options:
commit_footer += "\nRepoMan-Options: " + " ".join(report_options)
- if repo_settings.sign_manifests:
+ if self.repo_settings.sign_manifests:
commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, )
if dco_sob:
commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
@@ -520,10 +263,10 @@ def repoman_main(argv):
if dco_sob:
commit_footer += "Signed-off-by: %s\n" % (dco_sob, )
commit_footer += "(Portage version: %s/%s/%s" % \
- (portage_version, vcs_settings.vcs, unameout)
+ (portage_version, self.vcs_settings.vcs, unameout)
if report_options:
commit_footer += ", RepoMan options: " + " ".join(report_options)
- if repo_settings.sign_manifests:
+ if self.repo_settings.sign_manifests:
commit_footer += ", signed Manifest commit with key %s" % \
(gpg_key, )
else:
@@ -533,24 +276,24 @@ def repoman_main(argv):
commitmessage += commit_footer
broken_changelog_manifests = []
- if options.echangelog in ('y', 'force'):
+ if self.options.echangelog in ('y', 'force'):
logging.info("checking for unmodified ChangeLog files")
- committer_name = utilities.get_committer_name(env=repoman_settings)
+ committer_name = utilities.get_committer_name(env=self.repoman_settings)
for x in sorted(vcs_files_to_cps(
chain(myupdates, mymanifests, myremoved),
- scanner.repolevel, scanner.reposplit, scanner.categories)):
+ self.scanner.repolevel, self.scanner.reposplit, self.scanner.categories)):
catdir, pkgdir = x.split("/")
- checkdir = repo_settings.repodir + "/" + x
+ checkdir = self.repo_settings.repodir + "/" + x
checkdir_relative = ""
- if scanner.repolevel < 3:
+ if self.scanner.repolevel < 3:
checkdir_relative = os.path.join(pkgdir, checkdir_relative)
- if scanner.repolevel < 2:
+ if self.scanner.repolevel < 2:
checkdir_relative = os.path.join(catdir, checkdir_relative)
checkdir_relative = os.path.join(".", checkdir_relative)
changelog_path = os.path.join(checkdir_relative, "ChangeLog")
- changelog_modified = changelog_path in scanner.changed.changelogs
- if changelog_modified and options.echangelog != 'force':
+ changelog_modified = changelog_path in self.scanner.changed.changelogs
+ if changelog_modified and self.options.echangelog != 'force':
continue
# get changes for this package
@@ -566,15 +309,15 @@ def repoman_main(argv):
nontrivial_cl_files = set()
nontrivial_cl_files.update(clnew, clremoved, clchanged)
nontrivial_cl_files.difference_update(['Manifest'])
- if not nontrivial_cl_files and options.echangelog != 'force':
+ if not nontrivial_cl_files and self.options.echangelog != 'force':
continue
new_changelog = utilities.UpdateChangeLog(
checkdir_relative, committer_name, changelog_msg,
- os.path.join(repo_settings.repodir, 'skel.ChangeLog'),
+ os.path.join(self.repo_settings.repodir, 'skel.ChangeLog'),
catdir, pkgdir,
new=clnew, removed=clremoved, changed=clchanged,
- pretend=options.pretend)
+ pretend=self.options.pretend)
if new_changelog is None:
writemsg_level(
"!!! Updating the ChangeLog failed\n",
@@ -588,18 +331,18 @@ def repoman_main(argv):
else:
myupdates.append(changelog_path)
- if options.ask and not options.pretend:
+ if self.options.ask and not self.options.pretend:
# regenerate Manifest for modified ChangeLog (bug #420735)
- repoman_settings["O"] = checkdir
- digestgen(mysettings=repoman_settings, myportdb=portdb)
+ self.repoman_settings["O"] = checkdir
+ digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
else:
broken_changelog_manifests.append(x)
if myautoadd:
print(">>> Auto-Adding missing Manifest/ChangeLog file(s)...")
- add_cmd = [vcs_settings.vcs, "add"]
+ add_cmd = [self.vcs_settings.vcs, "add"]
add_cmd += myautoadd
- if options.pretend:
+ if self.options.pretend:
portage.writemsg_stdout(
"(%s)\n" % " ".join(add_cmd),
noiselevel=-1)
@@ -618,22 +361,22 @@ def repoman_main(argv):
retcode = subprocess.call(add_cmd)
if retcode != os.EX_OK:
logging.error(
- "Exiting on %s error code: %s\n" % (vcs_settings.vcs, retcode))
+ "Exiting on %s error code: %s\n" % (self.vcs_settings.vcs, retcode))
sys.exit(retcode)
myupdates += myautoadd
print("* %s files being committed..." % green(str(len(myupdates))), end=' ')
- if vcs_settings.vcs not in ('cvs', 'svn'):
+ if self.vcs_settings.vcs not in ('cvs', 'svn'):
# With git, bzr and hg, there's never any keyword expansion, so
# there's no need to regenerate manifests and all files will be
# committed in one big commit at the end.
print()
- elif not repo_settings.repo_config.thin_manifest:
- if vcs_settings.vcs == 'cvs':
+ elif not self.repo_settings.repo_config.thin_manifest:
+ if self.vcs_settings.vcs == 'cvs':
headerstring = "'\$(Header|Id).*\$'"
- elif vcs_settings.vcs == "svn":
+ elif self.vcs_settings.vcs == "svn":
svn_keywords = dict((k.lower(), k) for k in [
"Rev",
"Revision",
@@ -651,12 +394,12 @@ def repoman_main(argv):
for myfile in myupdates:
# for CVS, no_expansion contains files that are excluded from expansion
- if vcs_settings.vcs == "cvs":
+ if self.vcs_settings.vcs == "cvs":
if myfile in no_expansion:
continue
# for SVN, expansion contains files that are included in expansion
- elif vcs_settings.vcs == "svn":
+ elif self.vcs_settings.vcs == "svn":
if myfile not in expansion:
continue
@@ -684,8 +427,8 @@ def repoman_main(argv):
logging.info("myupdates: %s", myupdates)
logging.info("myheaders: %s", myheaders)
- uq = UserQuery(options)
- if options.ask and uq.query('Commit changes?', True) != 'Yes':
+ uq = UserQuery(self.options)
+ if self.options.ask and uq.query('Commit changes?', True) != 'Yes':
print("* aborting commit.")
sys.exit(128 + signal.SIGINT)
@@ -713,22 +456,22 @@ def repoman_main(argv):
# so strip the prefix.
myfiles = [f.lstrip("./") for f in myfiles]
- commit_cmd = [vcs_settings.vcs]
- commit_cmd.extend(vcs_settings.vcs_global_opts)
+ commit_cmd = [self.vcs_settings.vcs]
+ commit_cmd.extend(self.vcs_settings.vcs_global_opts)
commit_cmd.append("commit")
- commit_cmd.extend(vcs_settings.vcs_local_opts)
+ commit_cmd.extend(self.vcs_settings.vcs_local_opts)
commit_cmd.extend(["-F", commitmessagefile])
commit_cmd.extend(myfiles)
try:
- if options.pretend:
+ if self.options.pretend:
print("(%s)" % (" ".join(commit_cmd),))
else:
- retval = spawn(commit_cmd, env=repo_settings.commit_env)
+ retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
if retval != os.EX_OK:
writemsg_level(
"!!! Exiting on %s (shell) "
- "error code: %s\n" % (vcs_settings.vcs, retval),
+ "error code: %s\n" % (self.vcs_settings.vcs, retval),
level=logging.ERROR, noiselevel=-1)
sys.exit(retval)
finally:
@@ -759,39 +502,39 @@ def repoman_main(argv):
if modified:
portage.util.write_atomic(x, b''.join(mylines), mode='wb')
- if scanner.repolevel == 1:
+ if self.scanner.repolevel == 1:
utilities.repoman_sez(
"\"You're rather crazy... "
"doing the entire repository.\"\n")
- if vcs_settings.vcs in ('cvs', 'svn') and (myupdates or myremoved):
+ if self.vcs_settings.vcs in ('cvs', 'svn') and (myupdates or myremoved):
for x in sorted(vcs_files_to_cps(
chain(myupdates, myremoved, mymanifests),
- scanner.repolevel, scanner.reposplit, scanner.categories)):
- repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
- digestgen(mysettings=repoman_settings, myportdb=portdb)
+ self.scanner.repolevel, self.scanner.reposplit, self.scanner.categories)):
+ self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
+ digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
elif broken_changelog_manifests:
for x in broken_changelog_manifests:
- repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
- digestgen(mysettings=repoman_settings, myportdb=portdb)
+ self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
+ digestgen(mysettings=self.repoman_settings, myportdb=self.repo_settings.portdb)
- if repo_settings.sign_manifests:
+ if self.repo_settings.sign_manifests:
try:
for x in sorted(vcs_files_to_cps(
chain(myupdates, myremoved, mymanifests),
- scanner.repolevel, scanner.reposplit, scanner.categories)):
- repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
- manifest_path = os.path.join(repoman_settings["O"], "Manifest")
+ self.scanner.repolevel, self.scanner.reposplit, self.scanner.categories)):
+ self.repoman_settings["O"] = os.path.join(self.repo_settings.repodir, x)
+ manifest_path = os.path.join(self.repoman_settings["O"], "Manifest")
if not need_signature(manifest_path):
continue
- gpgsign(manifest_path, repoman_settings, options)
+ gpgsign(manifest_path, self.repoman_settings, self.options)
except portage.exception.PortageException as e:
portage.writemsg("!!! %s\n" % str(e))
portage.writemsg("!!! Disabled FEATURES='sign'\n")
- repo_settings.sign_manifests = False
+ self.repo_settings.sign_manifests = False
- if vcs_settings.vcs == 'git':
+ if self.vcs_settings.vcs == 'git':
# It's not safe to use the git commit -a option since there might
# be some modified files elsewhere in the working tree that the
# user doesn't want to commit. Therefore, call git update-index
@@ -802,14 +545,14 @@ def repoman_main(argv):
myfiles.sort()
update_index_cmd = ["git", "update-index"]
update_index_cmd.extend(f.lstrip("./") for f in myfiles)
- if options.pretend:
+ if self.options.pretend:
print("(%s)" % (" ".join(update_index_cmd),))
else:
retval = spawn(update_index_cmd, env=os.environ)
if retval != os.EX_OK:
writemsg_level(
"!!! Exiting on %s (shell) "
- "error code: %s\n" % (vcs_settings.vcs, retval),
+ "error code: %s\n" % (self.vcs_settings.vcs, retval),
level=logging.ERROR, noiselevel=-1)
sys.exit(retval)
@@ -829,15 +572,15 @@ def repoman_main(argv):
mymsg.close()
commit_cmd = []
- if options.pretend and vcs_settings.vcs is None:
+ if self.options.pretend and self.vcs_settings.vcs is None:
# substitute a bogus value for pretend output
commit_cmd.append("cvs")
else:
- commit_cmd.append(vcs_settings.vcs)
- commit_cmd.extend(vcs_settings.vcs_global_opts)
+ commit_cmd.append(self.vcs_settings.vcs)
+ commit_cmd.extend(self.vcs_settings.vcs_global_opts)
commit_cmd.append("commit")
- commit_cmd.extend(vcs_settings.vcs_local_opts)
- if vcs_settings.vcs == "hg":
+ commit_cmd.extend(self.vcs_settings.vcs_local_opts)
+ if self.vcs_settings.vcs == "hg":
commit_cmd.extend(["--logfile", commitmessagefile])
commit_cmd.extend(myfiles)
else:
@@ -845,12 +588,12 @@ def repoman_main(argv):
commit_cmd.extend(f.lstrip("./") for f in myfiles)
try:
- if options.pretend:
+ if self.options.pretend:
print("(%s)" % (" ".join(commit_cmd),))
else:
- retval = spawn(commit_cmd, env=repo_settings.commit_env)
+ retval = spawn(commit_cmd, env=self.repo_settings.commit_env)
if retval != os.EX_OK:
- if repo_settings.repo_config.sign_commit and vcs_settings.vcs == 'git' and \
+ if self.repo_settings.repo_config.sign_commit and self.vcs_settings.vcs == 'git' and \
not git_supports_gpg_sign():
# Inform user that newer git is needed (bug #403323).
logging.error(
@@ -858,7 +601,7 @@ def repoman_main(argv):
writemsg_level(
"!!! Exiting on %s (shell) "
- "error code: %s\n" % (vcs_settings.vcs, retval),
+ "error code: %s\n" % (self.vcs_settings.vcs, retval),
level=logging.ERROR, noiselevel=-1)
sys.exit(retval)
finally:
@@ -868,7 +611,7 @@ def repoman_main(argv):
pass
print()
- if vcs_settings.vcs:
+ if self.vcs_settings.vcs:
print("Commit complete.")
else:
print(
@@ -877,4 +620,155 @@ def repoman_main(argv):
" that he forgot to commit anything")
utilities.repoman_sez(
"\"If everyone were like you, I'd be out of business!\"\n")
- sys.exit(0)
+ return
+
+
+ def _suggest(self):
+ print()
+ if self.suggest['ignore_masked']:
+ print(bold(
+ "Note: use --without-mask to check "
+ "KEYWORDS on dependencies of masked packages"))
+
+ if self.suggest['include_dev']:
+ print(bold(
+ "Note: use --include-dev (-d) to check "
+ "dependencies for 'dev' profiles"))
+ print()
+
+
+ def _non_commit(self, result):
+ if result['full']:
+ print(bold("Note: type \"repoman full\" for a complete listing."))
+ if result['warn'] and not result['fail']:
+ utilities.repoman_sez(
+ "\"You're only giving me a partial QA payment?\n"
+ " I'll take it this time, but I'm not happy.\"")
+ elif not result['fail']:
+ utilities.repoman_sez(
+ "\"If everyone were like you, I'd be out of business!\"")
+ elif result['fail']:
+ print(bad("Please fix these important QA issues first."))
+ 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):
+ if result['fail'] and can_force and self.options.force and not self.options.pretend:
+ utilities.repoman_sez(
+ " \"You want to commit even with these QA issues?\n"
+ " I'll take it this time, but I'm not happy.\"\n")
+ elif result['fail']:
+ if self.options.force and not can_force:
+ print(bad(
+ "The --force option has been disabled"
+ " due to extraordinary issues."))
+ print(bad("Please fix these important QA issues first."))
+ utilities.repoman_sez(
+ "\"Make your QA payment on time"
+ " and you'll never see the likes of me.\"\n")
+ sys.exit(1)
+
+
+ def _vcs_unadded(self):
+ myunadded = []
+ mydeleted = []
+ if self.vcs_settings.vcs == "cvs":
+ try:
+ myvcstree = portage.cvstree.getentries("./", recursive=1)
+ myunadded = portage.cvstree.findunadded(
+ myvcstree, recursive=1, basedir="./")
+ except SystemExit:
+ raise # TODO propagate this
+ except:
+ err("Error retrieving CVS tree; exiting.")
+ if self.vcs_settings.vcs == "svn":
+ try:
+ with repoman_popen("svn status --no-ignore") as f:
+ svnstatus = f.readlines()
+ myunadded = [
+ "./" + elem.rstrip().split()[1]
+ for elem in svnstatus
+ if elem.startswith("?") or elem.startswith("I")]
+ except SystemExit:
+ raise # TODO propagate this
+ except:
+ err("Error retrieving SVN info; exiting.")
+ if self.vcs_settings.vcs == "git":
+ # get list of files not under version control or missing
+ myf = repoman_popen("git ls-files --others")
+ myunadded = ["./" + elem[:-1] for elem in myf]
+ myf.close()
+ if self.vcs_settings.vcs == "bzr":
+ try:
+ with repoman_popen("bzr status -S .") as f:
+ bzrstatus = f.readlines()
+ myunadded = [
+ "./" + elem.rstrip().split()[1].split('/')[-1:][0]
+ for elem in bzrstatus
+ if elem.startswith("?") or elem[0:2] == " D"]
+ except SystemExit:
+ raise # TODO propagate this
+ except:
+ err("Error retrieving bzr info; exiting.")
+ if self.vcs_settings.vcs == "hg":
+ with repoman_popen("hg status --no-status --unknown .") as f:
+ myunadded = f.readlines()
+ myunadded = ["./" + elem.rstrip() for elem in myunadded]
+
+ # Mercurial doesn't handle manually deleted files as removed from
+ # the repository, so the user need to remove them before commit,
+ # using "hg remove [FILES]"
+ with repoman_popen("hg status --no-status --deleted .") as f:
+ mydeleted = f.readlines()
+ mydeleted = ["./" + elem.rstrip() for elem in mydeleted]
+ return myunadded, mydeleted
+
+
+ def _vcs_autoadd(self, myunadded):
+ myautoadd = []
+ 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:
+ # The Manifest excludes this file,
+ # so it's safe to ignore.
+ del myunadded[x]
+ elif xs[-1] == "files":
+ print("!!! files dir is not added! Please correct this.")
+ sys.exit(-1)
+ elif xs[-1] == "Manifest":
+ # It's a manifest... auto add
+ myautoadd += [myunadded[x]]
+ del myunadded[x]
+
+ if myunadded:
+ print(red(
+ "!!! The following files are in your local tree"
+ " but are not added to the master"))
+ print(red(
+ "!!! tree. Please remove them from the local tree"
+ " or add them to the master tree."))
+ for x in myunadded:
+ print(" ", x)
+ print()
+ print()
+ sys.exit(1)
+ return myautoadd
+
+
+ def _vcs_deleted(self, mydeleted):
+ if self.vcs_settings.vcs == "hg" and mydeleted:
+ print(red(
+ "!!! The following files are removed manually"
+ " from your local tree but are not"))
+ print(red(
+ "!!! removed from the repository."
+ " Please remove them, using \"hg remove [FILES]\"."))
+ for x in mydeleted:
+ print(" ", x)
+ print()
+ print()
+ sys.exit(1)
diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 2b2f91d..808c55e 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -4,16 +4,9 @@
from __future__ import print_function, unicode_literals
-import errno
import io
import logging
-import re
-import signal
-import subprocess
import sys
-import tempfile
-import platform
-from itertools import chain
from os import path as osp
if osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".portage_not_installed")):
@@ -26,36 +19,24 @@ portage._disable_legacy_globals()
from portage import os
-from portage import _encodings
-from portage import _unicode_encode
-from _emerge.UserQuery import UserQuery
import portage.checksum
import portage.const
import portage.repository.config
-from portage import cvstree
from portage import util
-from portage.process import find_binary, spawn
-from portage.output import (
- bold, create_color_func, green, nocolor, red)
+from portage.output import create_color_func, nocolor
from portage.output import ConsoleStyleFile, StyleWriter
from portage.util import formatter
-from portage.util import writemsg_level
-from portage.package.ebuild.digestgen import digestgen
+from repoman.actions import Actions
from repoman.argparser import parse_args
from repoman.checks.ebuilds.checks import checks_init
-from repoman.errors import err
-from repoman.gpg import gpgsign, need_signature
from repoman.qa_data import (
format_qa_output, format_qa_output_column, qahelp,
qawarnings, qacats)
from repoman.repos import RepoSettings
from repoman.scanner import Scanner
-from repoman._subprocess import repoman_popen, repoman_getstatusoutput
from repoman import utilities
-from repoman.vcs.vcs import (
- git_supports_gpg_sign, vcs_files_to_cps, VCSSettings)
-
+from repoman.vcs.vcs import VCSSettings
if sys.hexversion >= 0x3000000:
basestring = str
@@ -107,7 +88,6 @@ def repoman_main(argv):
config_root, portdir, portdir_overlay,
repoman_settings, vcs_settings, options, qawarnings)
repoman_settings = repo_settings.repoman_settings
- portdb = repo_settings.portdb
if 'digest' in repoman_settings.features and options.digest != 'n':
options.digest = 'y'
@@ -131,27 +111,29 @@ def repoman_main(argv):
if options.if_modified == "y" and len(scanner.effective_scanlist) < 1:
logging.warning("--if-modified is enabled, but no modified packages were found!")
- # dofail will be true if we have failed in at least one non-warning category
- dofail = 0
- # dowarn will be true if we tripped any warnings
- dowarn = 0
- # dofull will be true if we should print a "repoman full" informational message
- dofull = options.mode != 'full'
+ result = {
+ # fail will be true if we have failed in at least one non-warning category
+ 'fail': 0,
+ # warn will be true if we tripped any warnings
+ 'warn': 0,
+ # full will be true if we should print a "repoman full" informational message
+ 'full': options.mode != 'full',
+ }
# early out for manifest generation
if options.mode == "manifest":
- sys.exit(dofail)
+ sys.exit(result['fail'])
for x in qacats:
if x not in qatracker.fails:
continue
- dowarn = 1
+ result['warn'] = 1
if x not in qawarnings:
- dofail = 1
+ result['fail'] = 1
- if dofail or \
- (dowarn and not (options.quiet or options.mode == "scan")):
- dofull = 0
+ if result['fail'] or \
+ (result['warn'] and not (options.quiet or options.mode == "scan")):
+ result['full'] = 0
# Save QA output so that it can be conveniently displayed
# in $EDITOR while the user creates a commit message.
@@ -174,707 +156,17 @@ def repoman_main(argv):
format_output = format_outputs.get(
options.output_style, format_outputs['default'])
- format_output(f, qatracker.fails, dofull, dofail, options, qawarnings)
+ format_output(f, qatracker.fails, result['full'], result['fail'], options, qawarnings)
style_file.flush()
del console_writer, f, style_file
qa_output = qa_output.getvalue()
qa_output = qa_output.splitlines(True)
- suggest_ignore_masked = False
- suggest_include_dev = False
-
- if scanner.have['pmasked'] and not (options.without_mask or options.ignore_masked):
- suggest_ignore_masked = True
- if scanner.have['dev_keywords'] and not options.include_dev:
- suggest_include_dev = True
-
- if suggest_ignore_masked or suggest_include_dev:
- print()
- if suggest_ignore_masked:
- print(bold(
- "Note: use --without-mask to check "
- "KEYWORDS on dependencies of masked packages"))
-
- if suggest_include_dev:
- print(bold(
- "Note: use --include-dev (-d) to check "
- "dependencies for 'dev' profiles"))
- print()
-
- if options.mode != 'commit':
- if dofull:
- print(bold("Note: type \"repoman full\" for a complete listing."))
- if dowarn and not dofail:
- utilities.repoman_sez(
- "\"You're only giving me a partial QA payment?\n"
- " I'll take it this time, but I'm not happy.\"")
- elif not dofail:
- utilities.repoman_sez(
- "\"If everyone were like you, I'd be out of business!\"")
- elif dofail:
- print(bad("Please fix these important QA issues first."))
- utilities.repoman_sez(
- "\"Make your QA payment on time"
- " and you'll never see the likes of me.\"\n")
- sys.exit(1)
- else:
- if dofail and can_force and options.force and not options.pretend:
- utilities.repoman_sez(
- " \"You want to commit even with these QA issues?\n"
- " I'll take it this time, but I'm not happy.\"\n")
- elif dofail:
- if options.force and not can_force:
- print(bad(
- "The --force option has been disabled"
- " due to extraordinary issues."))
- print(bad("Please fix these important QA issues first."))
- utilities.repoman_sez(
- "\"Make your QA payment on time"
- " and you'll never see the likes of me.\"\n")
- sys.exit(1)
-
- if options.pretend:
- utilities.repoman_sez(
- "\"So, you want to play it safe. Good call.\"\n")
-
- myunadded = []
- if vcs_settings.vcs == "cvs":
- try:
- myvcstree = portage.cvstree.getentries("./", recursive=1)
- myunadded = portage.cvstree.findunadded(
- myvcstree, recursive=1, basedir="./")
- except SystemExit as e:
- raise # TODO propagate this
- except:
- err("Error retrieving CVS tree; exiting.")
- if vcs_settings.vcs == "svn":
- try:
- with repoman_popen("svn status --no-ignore") as f:
- svnstatus = f.readlines()
- myunadded = [
- "./" + elem.rstrip().split()[1]
- for elem in svnstatus
- if elem.startswith("?") or elem.startswith("I")]
- except SystemExit as e:
- raise # TODO propagate this
- except:
- err("Error retrieving SVN info; exiting.")
- if vcs_settings.vcs == "git":
- # get list of files not under version control or missing
- myf = repoman_popen("git ls-files --others")
- myunadded = ["./" + elem[:-1] for elem in myf]
- myf.close()
- if vcs_settings.vcs == "bzr":
- try:
- with repoman_popen("bzr status -S .") as f:
- bzrstatus = f.readlines()
- myunadded = [
- "./" + elem.rstrip().split()[1].split('/')[-1:][0]
- for elem in bzrstatus
- if elem.startswith("?") or elem[0:2] == " D"]
- except SystemExit as e:
- raise # TODO propagate this
- except:
- err("Error retrieving bzr info; exiting.")
- if vcs_settings.vcs == "hg":
- with repoman_popen("hg status --no-status --unknown .") as f:
- myunadded = f.readlines()
- myunadded = ["./" + elem.rstrip() for elem in myunadded]
-
- # Mercurial doesn't handle manually deleted files as removed from
- # the repository, so the user need to remove them before commit,
- # using "hg remove [FILES]"
- with repoman_popen("hg status --no-status --deleted .") as f:
- mydeleted = f.readlines()
- mydeleted = ["./" + elem.rstrip() for elem in mydeleted]
-
- myautoadd = []
- if myunadded:
- for x in range(len(myunadded) - 1, -1, -1):
- xs = myunadded[x].split("/")
- if 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]
- elif xs[-1] == "files":
- print("!!! files dir is not added! Please correct this.")
- sys.exit(-1)
- elif xs[-1] == "Manifest":
- # It's a manifest... auto add
- myautoadd += [myunadded[x]]
- del myunadded[x]
-
- if myunadded:
- print(red(
- "!!! The following files are in your local tree"
- " but are not added to the master"))
- print(red(
- "!!! tree. Please remove them from the local tree"
- " or add them to the master tree."))
- for x in myunadded:
- print(" ", x)
- print()
- print()
- sys.exit(1)
-
- if vcs_settings.vcs == "hg" and mydeleted:
- print(red(
- "!!! The following files are removed manually"
- " from your local tree but are not"))
- print(red(
- "!!! removed from the repository."
- " Please remove them, using \"hg remove [FILES]\"."))
- for x in mydeleted:
- print(" ", x)
- print()
- print()
- sys.exit(1)
-
- if vcs_settings.vcs == "cvs":
- mycvstree = cvstree.getentries("./", recursive=1)
- mychanged = cvstree.findchanged(mycvstree, recursive=1, basedir="./")
- mynew = cvstree.findnew(mycvstree, recursive=1, basedir="./")
- myremoved = portage.cvstree.findremoved(mycvstree, recursive=1, basedir="./")
- bin_blob_pattern = re.compile("^-kb$")
- no_expansion = set(portage.cvstree.findoption(
- mycvstree, bin_blob_pattern, recursive=1, basedir="./"))
-
- if vcs_settings.vcs == "svn":
- with repoman_popen("svn status") as f:
- svnstatus = f.readlines()
- mychanged = [
- "./" + elem.split()[-1:][0]
- for elem in svnstatus
- if (elem[:1] in "MR" or elem[1:2] in "M")]
- mynew = [
- "./" + elem.split()[-1:][0]
- for elem in svnstatus
- if elem.startswith("A")]
- myremoved = [
- "./" + elem.split()[-1:][0]
- for elem in svnstatus
- if elem.startswith("D")]
-
- # Subversion expands keywords specified in svn:keywords properties.
- with repoman_popen("svn propget -R svn:keywords") as f:
- props = f.readlines()
- expansion = dict(
- ("./" + prop.split(" - ")[0], prop.split(" - ")[1].split())
- for prop in props if " - " in prop)
-
- elif vcs_settings.vcs == "git":
- with repoman_popen(
- "git diff-index --name-only "
- "--relative --diff-filter=M HEAD") as f:
- mychanged = f.readlines()
- mychanged = ["./" + elem[:-1] for elem in mychanged]
-
- with repoman_popen(
- "git diff-index --name-only "
- "--relative --diff-filter=A HEAD") as f:
- mynew = f.readlines()
- mynew = ["./" + elem[:-1] for elem in mynew]
-
- with repoman_popen(
- "git diff-index --name-only "
- "--relative --diff-filter=D HEAD") as f:
- myremoved = f.readlines()
- myremoved = ["./" + elem[:-1] for elem in myremoved]
-
- if vcs_settings.vcs == "bzr":
- with repoman_popen("bzr status -S .") as f:
- bzrstatus = f.readlines()
- mychanged = [
- "./" + elem.split()[-1:][0].split('/')[-1:][0]
- for elem in bzrstatus
- if elem and elem[1:2] == "M"]
- mynew = [
- "./" + elem.split()[-1:][0].split('/')[-1:][0]
- for elem in bzrstatus
- if elem and (elem[1:2] in "NK" or elem[0:1] == "R")]
- myremoved = [
- "./" + elem.split()[-1:][0].split('/')[-1:][0]
- for elem in bzrstatus
- if elem.startswith("-")]
- myremoved = [
- "./" + elem.split()[-3:-2][0].split('/')[-1:][0]
- for elem in bzrstatus
- if elem and (elem[1:2] == "K" or elem[0:1] == "R")]
- # Bazaar expands nothing.
-
- if vcs_settings.vcs == "hg":
- with repoman_popen("hg status --no-status --modified .") as f:
- mychanged = f.readlines()
- mychanged = ["./" + elem.rstrip() for elem in mychanged]
-
- with repoman_popen("hg status --no-status --added .") as f:
- mynew = f.readlines()
- mynew = ["./" + elem.rstrip() for elem in mynew]
-
- with repoman_popen("hg status --no-status --removed .") as f:
- myremoved = f.readlines()
- myremoved = ["./" + elem.rstrip() for elem in myremoved]
-
- if vcs_settings.vcs:
- a_file_is_changed = mychanged or mynew or myremoved
- a_file_is_deleted_hg = vcs_settings.vcs == "hg" and mydeleted
-
- if not (a_file_is_changed or a_file_is_deleted_hg):
- utilities.repoman_sez(
- "\"Doing nothing is not always good for QA.\"")
- print()
- print("(Didn't find any changed files...)")
- print()
- sys.exit(1)
-
- # Manifests need to be regenerated after all other commits, so don't commit
- # them now even if they have changed.
- mymanifests = set()
- myupdates = set()
- for f in mychanged + mynew:
- if "Manifest" == os.path.basename(f):
- mymanifests.add(f)
- else:
- myupdates.add(f)
- myupdates.difference_update(myremoved)
- myupdates = list(myupdates)
- mymanifests = list(mymanifests)
- myheaders = []
-
- commitmessage = options.commitmsg
- if options.commitmsgfile:
- try:
- f = io.open(
- _unicode_encode(
- options.commitmsgfile,
- encoding=_encodings['fs'], errors='strict'),
- mode='r', encoding=_encodings['content'], errors='replace')
- commitmessage = f.read()
- f.close()
- del f
- except (IOError, OSError) as e:
- if e.errno == errno.ENOENT:
- portage.writemsg(
- "!!! File Not Found:"
- " --commitmsgfile='%s'\n" % options.commitmsgfile)
- else:
- raise
- # We've read the content so the file is no longer needed.
- commitmessagefile = None
- if not commitmessage or not commitmessage.strip():
- msg_prefix = ""
- if scanner.repolevel > 1:
- msg_prefix = "/".join(scanner.reposplit[1:]) + ": "
-
- try:
- editor = os.environ.get("EDITOR")
- if editor and utilities.editor_is_executable(editor):
- commitmessage = utilities.get_commit_message_with_editor(
- editor, message=qa_output, prefix=msg_prefix)
- else:
- commitmessage = utilities.get_commit_message_with_stdin()
- except KeyboardInterrupt:
- logging.fatal("Interrupted; exiting...")
- sys.exit(1)
- if (not commitmessage or not commitmessage.strip()
- or commitmessage.strip() == msg_prefix):
- print("* no commit message? aborting commit.")
- sys.exit(1)
- commitmessage = commitmessage.rstrip()
- changelog_msg = commitmessage
- portage_version = getattr(portage, "VERSION", None)
- gpg_key = repoman_settings.get("PORTAGE_GPG_KEY", "")
- dco_sob = repoman_settings.get("DCO_SIGNED_OFF_BY", "")
- if portage_version is None:
- sys.stderr.write("Failed to insert portage version in message!\n")
- sys.stderr.flush()
- portage_version = "Unknown"
-
- report_options = []
- if options.force:
- report_options.append("--force")
- if options.ignore_arches:
- report_options.append("--ignore-arches")
- if scanner.include_arches is not None:
- report_options.append(
- "--include-arches=\"%s\"" %
- " ".join(sorted(scanner.include_arches)))
-
- if vcs_settings.vcs == "git":
- # Use new footer only for git (see bug #438364).
- commit_footer = "\n\nPackage-Manager: portage-%s" % portage_version
- if report_options:
- commit_footer += "\nRepoMan-Options: " + " ".join(report_options)
- if repo_settings.sign_manifests:
- commit_footer += "\nManifest-Sign-Key: %s" % (gpg_key, )
- if dco_sob:
- commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
- else:
- unameout = platform.system() + " "
- if platform.system() in ["Darwin", "SunOS"]:
- unameout += platform.processor()
- else:
- unameout += platform.machine()
- commit_footer = "\n\n"
- if dco_sob:
- commit_footer += "Signed-off-by: %s\n" % (dco_sob, )
- commit_footer += "(Portage version: %s/%s/%s" % \
- (portage_version, vcs_settings.vcs, unameout)
- if report_options:
- commit_footer += ", RepoMan options: " + " ".join(report_options)
- if repo_settings.sign_manifests:
- commit_footer += ", signed Manifest commit with key %s" % \
- (gpg_key, )
- else:
- commit_footer += ", unsigned Manifest commit"
- commit_footer += ")"
-
- commitmessage += commit_footer
-
- broken_changelog_manifests = []
- if options.echangelog in ('y', 'force'):
- logging.info("checking for unmodified ChangeLog files")
- committer_name = utilities.get_committer_name(env=repoman_settings)
- for x in sorted(vcs_files_to_cps(
- chain(myupdates, mymanifests, myremoved),
- scanner.repolevel, scanner.reposplit, scanner.categories)):
- catdir, pkgdir = x.split("/")
- checkdir = repo_settings.repodir + "/" + x
- checkdir_relative = ""
- if scanner.repolevel < 3:
- checkdir_relative = os.path.join(pkgdir, checkdir_relative)
- if scanner.repolevel < 2:
- checkdir_relative = os.path.join(catdir, checkdir_relative)
- checkdir_relative = os.path.join(".", checkdir_relative)
-
- changelog_path = os.path.join(checkdir_relative, "ChangeLog")
- changelog_modified = changelog_path in scanner.changed.changelogs
- if changelog_modified and options.echangelog != 'force':
- continue
-
- # get changes for this package
- cdrlen = len(checkdir_relative)
- check_relative = lambda e: e.startswith(checkdir_relative)
- split_relative = lambda e: e[cdrlen:]
- clnew = list(map(split_relative, filter(check_relative, mynew)))
- clremoved = list(map(split_relative, filter(check_relative, myremoved)))
- clchanged = list(map(split_relative, filter(check_relative, mychanged)))
-
- # Skip ChangeLog generation if only the Manifest was modified,
- # as discussed in bug #398009.
- nontrivial_cl_files = set()
- nontrivial_cl_files.update(clnew, clremoved, clchanged)
- nontrivial_cl_files.difference_update(['Manifest'])
- if not nontrivial_cl_files and options.echangelog != 'force':
- continue
-
- new_changelog = utilities.UpdateChangeLog(
- checkdir_relative, committer_name, changelog_msg,
- os.path.join(repo_settings.repodir, 'skel.ChangeLog'),
- catdir, pkgdir,
- new=clnew, removed=clremoved, changed=clchanged,
- pretend=options.pretend)
- if new_changelog is None:
- writemsg_level(
- "!!! Updating the ChangeLog failed\n",
- level=logging.ERROR, noiselevel=-1)
- sys.exit(1)
-
- # if the ChangeLog was just created, add it to vcs
- if new_changelog:
- myautoadd.append(changelog_path)
- # myautoadd is appended to myupdates below
- else:
- myupdates.append(changelog_path)
-
- if options.ask and not options.pretend:
- # regenerate Manifest for modified ChangeLog (bug #420735)
- repoman_settings["O"] = checkdir
- digestgen(mysettings=repoman_settings, myportdb=portdb)
- else:
- broken_changelog_manifests.append(x)
-
- if myautoadd:
- print(">>> Auto-Adding missing Manifest/ChangeLog file(s)...")
- add_cmd = [vcs_settings.vcs, "add"]
- add_cmd += myautoadd
- if options.pretend:
- portage.writemsg_stdout(
- "(%s)\n" % " ".join(add_cmd),
- noiselevel=-1)
- else:
-
- if sys.hexversion < 0x3020000 and sys.hexversion >= 0x3000000 and \
- not os.path.isabs(add_cmd[0]):
- # Python 3.1 _execvp throws TypeError for non-absolute executable
- # path passed as bytes (see http://bugs.python.org/issue8513).
- fullname = find_binary(add_cmd[0])
- if fullname is None:
- raise portage.exception.CommandNotFound(add_cmd[0])
- add_cmd[0] = fullname
-
- add_cmd = [_unicode_encode(arg) for arg in add_cmd]
- retcode = subprocess.call(add_cmd)
- if retcode != os.EX_OK:
- logging.error(
- "Exiting on %s error code: %s\n" % (vcs_settings.vcs, retcode))
- sys.exit(retcode)
-
- myupdates += myautoadd
-
- print("* %s files being committed..." % green(str(len(myupdates))), end=' ')
-
- if vcs_settings.vcs not in ('cvs', 'svn'):
- # With git, bzr and hg, there's never any keyword expansion, so
- # there's no need to regenerate manifests and all files will be
- # committed in one big commit at the end.
- print()
- elif not repo_settings.repo_config.thin_manifest:
- if vcs_settings.vcs == 'cvs':
- headerstring = "'\$(Header|Id).*\$'"
- elif vcs_settings.vcs == "svn":
- svn_keywords = dict((k.lower(), k) for k in [
- "Rev",
- "Revision",
- "LastChangedRevision",
- "Date",
- "LastChangedDate",
- "Author",
- "LastChangedBy",
- "URL",
- "HeadURL",
- "Id",
- "Header",
- ])
-
- for myfile in myupdates:
-
- # for CVS, no_expansion contains files that are excluded from expansion
- if vcs_settings.vcs == "cvs":
- if myfile in no_expansion:
- continue
-
- # for SVN, expansion contains files that are included in expansion
- elif vcs_settings.vcs == "svn":
- if myfile not in expansion:
- continue
-
- # Subversion keywords are case-insensitive
- # in svn:keywords properties,
- # but case-sensitive in contents of files.
- enabled_keywords = []
- for k in expansion[myfile]:
- keyword = svn_keywords.get(k.lower())
- if keyword is not None:
- enabled_keywords.append(keyword)
-
- headerstring = "'\$(%s).*\$'" % "|".join(enabled_keywords)
-
- myout = repoman_getstatusoutput(
- "egrep -q %s %s" % (headerstring, portage._shell_quote(myfile)))
- if myout[0] == 0:
- myheaders.append(myfile)
-
- print("%s have headers that will change." % green(str(len(myheaders))))
- print(
- "* Files with headers will"
- " cause the manifests to be changed and committed separately.")
-
- logging.info("myupdates: %s", myupdates)
- logging.info("myheaders: %s", myheaders)
-
- uq = UserQuery(options)
- if options.ask and uq.query('Commit changes?', True) != 'Yes':
- print("* aborting commit.")
- sys.exit(128 + signal.SIGINT)
-
- # Handle the case where committed files have keywords which
- # will change and need a priming commit before the Manifest
- # can be committed.
- if (myupdates or myremoved) and myheaders:
- myfiles = myupdates + myremoved
- fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
- mymsg = os.fdopen(fd, "wb")
- mymsg.write(_unicode_encode(commitmessage))
- mymsg.close()
-
- separator = '-' * 78
-
- print()
- print(green("Using commit message:"))
- print(green(separator))
- print(commitmessage)
- print(green(separator))
- print()
-
- # Having a leading ./ prefix on file paths can trigger a bug in
- # the cvs server when committing files to multiple directories,
- # so strip the prefix.
- myfiles = [f.lstrip("./") for f in myfiles]
-
- commit_cmd = [vcs_settings.vcs]
- commit_cmd.extend(vcs_settings.vcs_global_opts)
- commit_cmd.append("commit")
- commit_cmd.extend(vcs_settings.vcs_local_opts)
- commit_cmd.extend(["-F", commitmessagefile])
- commit_cmd.extend(myfiles)
-
- try:
- if options.pretend:
- print("(%s)" % (" ".join(commit_cmd),))
- else:
- retval = spawn(commit_cmd, env=repo_settings.commit_env)
- if retval != os.EX_OK:
- writemsg_level(
- "!!! Exiting on %s (shell) "
- "error code: %s\n" % (vcs_settings.vcs, retval),
- level=logging.ERROR, noiselevel=-1)
- sys.exit(retval)
- finally:
- try:
- os.unlink(commitmessagefile)
- except OSError:
- pass
-
- # When files are removed and re-added, the cvs server will put /Attic/
- # inside the $Header path. This code detects the problem and corrects it
- # so that the Manifest will generate correctly. See bug #169500.
- # Use binary mode in order to avoid potential character encoding issues.
- cvs_header_re = re.compile(br'^#\s*\$Header.*\$$')
- attic_str = b'/Attic/'
- attic_replace = b'/'
- for x in myheaders:
- f = open(
- _unicode_encode(x, encoding=_encodings['fs'], errors='strict'),
- mode='rb')
- mylines = f.readlines()
- f.close()
- modified = False
- for i, line in enumerate(mylines):
- if cvs_header_re.match(line) is not None and \
- attic_str in line:
- mylines[i] = line.replace(attic_str, attic_replace)
- modified = True
- if modified:
- portage.util.write_atomic(x, b''.join(mylines), mode='wb')
-
- if scanner.repolevel == 1:
- utilities.repoman_sez(
- "\"You're rather crazy... "
- "doing the entire repository.\"\n")
-
- if vcs_settings.vcs in ('cvs', 'svn') and (myupdates or myremoved):
- for x in sorted(vcs_files_to_cps(
- chain(myupdates, myremoved, mymanifests),
- scanner.repolevel, scanner.reposplit, scanner.categories)):
- repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
- digestgen(mysettings=repoman_settings, myportdb=portdb)
-
- elif broken_changelog_manifests:
- for x in broken_changelog_manifests:
- repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
- digestgen(mysettings=repoman_settings, myportdb=portdb)
-
- if repo_settings.sign_manifests:
- try:
- for x in sorted(vcs_files_to_cps(
- chain(myupdates, myremoved, mymanifests),
- scanner.repolevel, scanner.reposplit, scanner.categories)):
- repoman_settings["O"] = os.path.join(repo_settings.repodir, x)
- manifest_path = os.path.join(repoman_settings["O"], "Manifest")
- if not need_signature(manifest_path):
- continue
- gpgsign(manifest_path, repoman_settings, options)
- except portage.exception.PortageException as e:
- portage.writemsg("!!! %s\n" % str(e))
- portage.writemsg("!!! Disabled FEATURES='sign'\n")
- repo_settings.sign_manifests = False
-
- if vcs_settings.vcs == 'git':
- # It's not safe to use the git commit -a option since there might
- # be some modified files elsewhere in the working tree that the
- # user doesn't want to commit. Therefore, call git update-index
- # in order to ensure that the index is updated with the latest
- # versions of all new and modified files in the relevant portion
- # of the working tree.
- myfiles = mymanifests + myupdates
- myfiles.sort()
- update_index_cmd = ["git", "update-index"]
- update_index_cmd.extend(f.lstrip("./") for f in myfiles)
- if options.pretend:
- print("(%s)" % (" ".join(update_index_cmd),))
- else:
- retval = spawn(update_index_cmd, env=os.environ)
- if retval != os.EX_OK:
- writemsg_level(
- "!!! Exiting on %s (shell) "
- "error code: %s\n" % (vcs_settings.vcs, retval),
- level=logging.ERROR, noiselevel=-1)
- sys.exit(retval)
-
- if True:
- myfiles = mymanifests[:]
- # If there are no header (SVN/CVS keywords) changes in
- # the files, this Manifest commit must include the
- # other (yet uncommitted) files.
- if not myheaders:
- myfiles += myupdates
- myfiles += myremoved
- myfiles.sort()
-
- fd, commitmessagefile = tempfile.mkstemp(".repoman.msg")
- mymsg = os.fdopen(fd, "wb")
- mymsg.write(_unicode_encode(commitmessage))
- mymsg.close()
-
- commit_cmd = []
- if options.pretend and vcs_settings.vcs is None:
- # substitute a bogus value for pretend output
- commit_cmd.append("cvs")
- else:
- commit_cmd.append(vcs_settings.vcs)
- commit_cmd.extend(vcs_settings.vcs_global_opts)
- commit_cmd.append("commit")
- commit_cmd.extend(vcs_settings.vcs_local_opts)
- if vcs_settings.vcs == "hg":
- commit_cmd.extend(["--logfile", commitmessagefile])
- commit_cmd.extend(myfiles)
- else:
- commit_cmd.extend(["-F", commitmessagefile])
- commit_cmd.extend(f.lstrip("./") for f in myfiles)
-
- try:
- if options.pretend:
- print("(%s)" % (" ".join(commit_cmd),))
- else:
- retval = spawn(commit_cmd, env=repo_settings.commit_env)
- if retval != os.EX_OK:
- if repo_settings.repo_config.sign_commit and vcs_settings.vcs == 'git' and \
- not git_supports_gpg_sign():
- # Inform user that newer git is needed (bug #403323).
- logging.error(
- "Git >=1.7.9 is required for signed commits!")
-
- writemsg_level(
- "!!! Exiting on %s (shell) "
- "error code: %s\n" % (vcs_settings.vcs, retval),
- level=logging.ERROR, noiselevel=-1)
- sys.exit(retval)
- finally:
- try:
- os.unlink(commitmessagefile)
- except OSError:
- pass
-
- print()
- if vcs_settings.vcs:
- print("Commit complete.")
- else:
- print(
- "repoman was too scared"
- " by not seeing any familiar version control file"
- " that he forgot to commit anything")
- utilities.repoman_sez(
- "\"If everyone were like you, I'd be out of business!\"\n")
+ # output the results
+ actions = Actions(repo_settings, options, scanner, vcs_settings)
+ if actions.inform(can_force, result):
+ # perform any other actions
+ actions.perform(qa_output)
+
sys.exit(0)
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
@ 2015-09-21 23:47 Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
0 siblings, 1 reply; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:47 UTC (permalink / raw
To: gentoo-commits
commit: 1ab7562ec6027e5edd118e66a9e39d2353d8bc87
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 17 02:39:34 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:45 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1ab7562e
repoman/repos.py: Fix a regression where the repo is not in repos.conf
The regression was introduced when a variable was used to reduce the size of
some long lines. The variable was not being reset after the repo was added, so
the remaining code was looking at a stale config.
It turned out the variable was a dupe of an already properly updated class wide
one.
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>
pym/repoman/repos.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pym/repoman/repos.py b/pym/repoman/repos.py
index 700c064..de99fdf 100644
--- a/pym/repoman/repos.py
+++ b/pym/repoman/repos.py
@@ -30,12 +30,12 @@ class RepoSettings(object):
self.repoman_settings = repoman_settings
self.vcs_settings = vcs_settings
- repoman_repos = self.repoman_settings.repositories
+ self.repositories = self.repoman_settings.repositories
# Ensure that current repository is in the list of enabled repositories.
self.repodir = os.path.realpath(portdir_overlay)
try:
- repoman_repos.get_repo_for_location(self.repodir)
+ self.repositories.get_repo_for_location(self.repodir)
except KeyError:
self._add_repo(config_root, portdir_overlay)
@@ -47,15 +47,15 @@ class RepoSettings(object):
# Constrain dependency resolution to the master(s)
# that are specified in layout.conf.
- self.repo_config = repoman_repos.get_repo_for_location(self.repodir)
+ self.repo_config = self.repositories.get_repo_for_location(self.repodir)
self.portdb.porttrees = list(self.repo_config.eclass_db.porttrees)
self.portdir = self.portdb.porttrees[0]
self.commit_env = os.environ.copy()
# list() is for iteration on a copy.
- for repo in list(repoman_repos):
+ for repo in list(self.repositories):
# all paths are canonical
if repo.location not in self.repo_config.eclass_db.porttrees:
- del repoman_repos[repo.name]
+ del self.repositories[repo.name]
if self.repo_config.allow_provide_virtual:
qawarnings.add("virtual.oldstyle")
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
@ 2015-09-21 23:51 ` Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
To: gentoo-commits
commit: 1ab7562ec6027e5edd118e66a9e39d2353d8bc87
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 17 02:39:34 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:45 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1ab7562e
repoman/repos.py: Fix a regression where the repo is not in repos.conf
The regression was introduced when a variable was used to reduce the size of
some long lines. The variable was not being reset after the repo was added, so
the remaining code was looking at a stale config.
It turned out the variable was a dupe of an already properly updated class wide
one.
Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>
pym/repoman/repos.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pym/repoman/repos.py b/pym/repoman/repos.py
index 700c064..de99fdf 100644
--- a/pym/repoman/repos.py
+++ b/pym/repoman/repos.py
@@ -30,12 +30,12 @@ class RepoSettings(object):
self.repoman_settings = repoman_settings
self.vcs_settings = vcs_settings
- repoman_repos = self.repoman_settings.repositories
+ self.repositories = self.repoman_settings.repositories
# Ensure that current repository is in the list of enabled repositories.
self.repodir = os.path.realpath(portdir_overlay)
try:
- repoman_repos.get_repo_for_location(self.repodir)
+ self.repositories.get_repo_for_location(self.repodir)
except KeyError:
self._add_repo(config_root, portdir_overlay)
@@ -47,15 +47,15 @@ class RepoSettings(object):
# Constrain dependency resolution to the master(s)
# that are specified in layout.conf.
- self.repo_config = repoman_repos.get_repo_for_location(self.repodir)
+ self.repo_config = self.repositories.get_repo_for_location(self.repodir)
self.portdb.porttrees = list(self.repo_config.eclass_db.porttrees)
self.portdir = self.portdb.porttrees[0]
self.commit_env = os.environ.copy()
# list() is for iteration on a copy.
- for repo in list(repoman_repos):
+ for repo in list(self.repositories):
# all paths are canonical
if repo.location not in self.repo_config.eclass_db.porttrees:
- del repoman_repos[repo.name]
+ del self.repositories[repo.name]
if self.repo_config.allow_provide_virtual:
qawarnings.add("virtual.oldstyle")
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-08-10 14:44 Michał Górny
0 siblings, 0 replies; 123+ messages in thread
From: Michał Górny @ 2015-08-10 14:44 UTC (permalink / raw
To: gentoo-commits
commit: aef2873cd86d91ffd4badec45d7d310d917a12f7
Author: Sergei Trofimovich <siarheit <AT> google <DOT> com>
AuthorDate: Mon Aug 10 14:19:26 2015 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Aug 10 14:43:30 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=aef2873c
repoman: Switch to new git '# $Id$' header format
Currently repoman complains on every ebuild in ::gentoo.
Signed-off-by: Sergei Trofimovich <siarheit <AT> google.com>
Reviewed-by: Alexander Berntsen <bernalex <AT> gentoo.org>
pym/repoman/checks.py | 7 +++----
pym/repoman/errors.py | 2 +-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 5f37648..4ab23d1 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -81,7 +81,7 @@ class EbuildHeader(LineCheck):
# Why a regex here, use a string match
# gentoo_license = re.compile(r'^# Distributed under the terms of the GNU General Public License v2$')
gentoo_license = '# Distributed under the terms of the GNU General Public License v2'
- cvs_header = re.compile(r'^# \$Header: .*\$$')
+ id_header = '# $Id$'
ignore_comment = False
def new(self, pkg):
@@ -100,9 +100,8 @@ class EbuildHeader(LineCheck):
return errors.COPYRIGHT_ERROR
elif num == 1 and line.rstrip('\n') != self.gentoo_license:
return errors.LICENSE_ERROR
- elif num == 2:
- if not self.cvs_header.match(line):
- return errors.CVS_HEADER_ERROR
+ elif num == 2 and line.rstrip('\n') != self.id_header:
+ return errors.ID_HEADER_ERROR
class EbuildWhitespace(LineCheck):
diff --git a/pym/repoman/errors.py b/pym/repoman/errors.py
index 3833be6..74a5959 100644
--- a/pym/repoman/errors.py
+++ b/pym/repoman/errors.py
@@ -6,7 +6,7 @@ from __future__ import unicode_literals
COPYRIGHT_ERROR = 'Invalid Gentoo Copyright on line: %d'
LICENSE_ERROR = 'Invalid Gentoo/GPL License on line: %d'
-CVS_HEADER_ERROR = 'Malformed CVS Header on line: %d'
+ID_HEADER_ERROR = 'Malformed Id 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'
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2015-02-11 8:00 Michał Górny
0 siblings, 0 replies; 123+ messages in thread
From: Michał Górny @ 2015-02-11 8:00 UTC (permalink / raw
To: gentoo-commits
commit: 8482a88e8dfa3acf67d9bf4df4d3588ed993bb96
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 10 11:38:07 2015 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Feb 11 07:58:27 2015 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8482a88e
repoman: mark errors with explicit '[fatal']
Mark fatal check results with explicit '[fatal]' marker to ease grepping
and provide the additional information on non-colorful terminals
as well.
---
pym/repoman/utilities.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 415825e..a2535f0 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -310,11 +310,16 @@ def format_qa_output(formatter, stats, fails, dofull, dofail, options, qawarning
# we only want key value pairs where value > 0
for category, number in \
filter(lambda myitem: myitem[1] > 0, sorted(stats.items())):
- formatter.add_literal_data(" " + category.ljust(30))
+ formatter.add_literal_data(" " + category)
+ spacing_width = 30 - len(category)
if category in qawarnings:
formatter.push_style("WARN")
else:
formatter.push_style("BAD")
+ formatter.add_literal_data(" [fatal]")
+ spacing_width -= 8
+
+ formatter.add_literal_data(" " * spacing_width)
formatter.add_literal_data("%s" % number)
formatter.pop_style()
formatter.add_line_break()
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2014-09-11 23:45 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2014-09-11 23:45 UTC (permalink / raw
To: gentoo-commits
commit: 1967a7c9055e8df536b406ce4a1d72a0082d7e90
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 3 09:54:41 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Sep 11 23:44:25 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1967a7c9
repoman: Do not check for indirect inherits of deprecated eclasses
Complain only about deprecated eclasses that are inherited directly.
Checking indirectly inherited eclasses is pointless since the ebuild
maintainer can't really do anything about it --- it is up to
the maintainer of one of the directly inherited eclasses.
---
pym/repoman/checks.py | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index abb9545..5f37648 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -395,11 +395,8 @@ class InheritDeprecated(LineCheck):
def new(self, pkg):
self._errors = []
- self._indirect_deprecated = set(eclass for eclass in \
- self.deprecated_classes if eclass in pkg.inherited)
def check(self, num, line):
-
direct_inherits = None
m = self._inherit_re.match(line)
if m is not None:
@@ -415,11 +412,9 @@ class InheritDeprecated(LineCheck):
if replacement is None:
pass
elif replacement is False:
- self._indirect_deprecated.discard(eclass)
self._errors.append("please migrate from " + \
"'%s' (no replacement) on line: %d" % (eclass, num + 1))
else:
- self._indirect_deprecated.discard(eclass)
self._errors.append("please migrate from " + \
"'%s' to '%s' on line: %d" % \
(eclass, replacement, num + 1))
@@ -429,17 +424,6 @@ class InheritDeprecated(LineCheck):
yield error
del self._errors
- for eclass in self._indirect_deprecated:
- replacement = self.deprecated_classes[eclass]
- if replacement is False:
- yield "please migrate from indirect " + \
- "inherit of '%s' (no replacement)" % (eclass,)
- else:
- yield "please migrate from indirect " + \
- "inherit of '%s' to '%s'" % \
- (eclass, replacement)
- del self._indirect_deprecated
-
class InheritEclass(LineCheck):
"""
Base class for checking for missing inherits, as well as excess inherits.
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2014-04-04 23:01 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2014-04-04 23:01 UTC (permalink / raw
To: gentoo-commits
commit: b24dbbba140962fcceb425f98308b2a77c540190
Author: Michael Palimaka <kensington <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 17 14:38:43 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Apr 4 22:55:41 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b24dbbba
repoman: Remove obsolete eclass checks
---
pym/repoman/checks.py | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 8032b28..abb9545 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -385,19 +385,9 @@ class InheritDeprecated(LineCheck):
"boost-utils": False,
"distutils": "distutils-r1",
"gems": "ruby-fakegem",
- "git": "git-2",
"mono": "mono-env",
- "mozconfig-2": "mozconfig-3",
- "mozcoreconf": "mozcoreconf-2",
- "php-ext-pecl-r1": "php-ext-pecl-r2",
- "php-ext-source-r1": "php-ext-source-r2",
- "php-pear": "php-pear-r1",
"python": "python-r1 / python-single-r1 / python-any-r1",
- "python-distutils-ng": "python-r1 + distutils-r1",
- "qt3": False,
- "qt4": "qt4-r2",
"ruby": "ruby-ng",
- "ruby-gnome2": "ruby-ng-gnome2",
"x-modular": "xorg-2",
}
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2014-04-04 23:01 Brian Dolbec
0 siblings, 0 replies; 123+ messages in thread
From: Brian Dolbec @ 2014-04-04 23:01 UTC (permalink / raw
To: gentoo-commits
commit: c5df3ce7eb311db6e5c860208f76de134c4e2eac
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 30 11:55:05 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Apr 4 22:55:41 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c5df3ce7
Sort repoman check results in output
Currently, the check results are output in dict order which is
implementation-defined. This makes it hard to compare results coming
from two machines (Python versions).
Instead, sort all the results lexically.
---
pym/repoman/utilities.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index aec61fe..415825e 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -309,7 +309,7 @@ def format_qa_output(formatter, stats, fails, dofull, dofail, options, qawarning
full = options.mode == 'full'
# we only want key value pairs where value > 0
for category, number in \
- filter(lambda myitem: myitem[1] > 0, iter(stats.items())):
+ filter(lambda myitem: myitem[1] > 0, sorted(stats.items())):
formatter.add_literal_data(" " + category.ljust(30))
if category in qawarnings:
formatter.push_style("WARN")
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2014-01-27 3:13 Chris Reffett
0 siblings, 0 replies; 123+ messages in thread
From: Chris Reffett @ 2014-01-27 3:13 UTC (permalink / raw
To: gentoo-commits
commit: 00560e0b22059ffb42d965b4ef625950ab987afc
Author: Chris Reffett <creffett <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 14 00:01:25 2014 +0000
Commit: Chris Reffett <creffett <AT> gentoo <DOT> org>
CommitDate: Mon Jan 27 03:12:04 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=00560e0b
Add src_{prepare, configure} and pkg_pretend checks to repoman
EAPI 0/1: Warn if src_configure/src_pretend used
EAPI < 4: Warn if pkg_pretend is used
Fixes bug 379491.
Acked-by: Mike Frysinger <vapier <AT> gentoo.org>
---
pym/repoman/checks.py | 33 +++++++++++++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 85aa065..8032b28 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -1,5 +1,5 @@
# repoman: Checks
-# Copyright 2007-2013 Gentoo Foundation
+# Copyright 2007-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
"""This module contains functions used in Repoman to ascertain the quality
@@ -15,7 +15,7 @@ import repoman.errors as errors
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_exports_AA, eapi_has_pkg_pretend
class LineCheck(object):
"""Run a check on a line of an ebuild."""
@@ -731,6 +731,21 @@ class DeprecatedHasq(LineCheck):
re = re.compile(r'(^|.*\b)hasq\b')
error = errors.HASQ_ERROR
+# EAPI <2 checks
+class UndefinedSrcPrepareSrcConfigurePhases(LineCheck):
+ repoman_check_name = 'EAPI.incompatible'
+ src_configprepare_re = re.compile(r'\s*(src_configure|src_prepare)\s*\(\)')
+
+ def check_eapi(self, eapi):
+ return not eapi_has_src_prepare_and_src_configure(eapi)
+
+ def check(self, num, line):
+ m = self.src_configprepare_re.match(line)
+ if m is not None:
+ return ("'%s'" % m.group(1)) + \
+ " phase is not defined in EAPI < 2 on line: %d"
+
+
# EAPI-3 checks
class Eapi3DeprecatedFuncs(LineCheck):
repoman_check_name = 'EAPI.deprecated'
@@ -745,6 +760,20 @@ class Eapi3DeprecatedFuncs(LineCheck):
return ("'%s'" % m.group(1)) + \
" has been deprecated in EAPI=3 on line: %d"
+# EAPI <4 checks
+class UndefinedPkgPretendPhase(LineCheck):
+ repoman_check_name = 'EAPI.incompatible'
+ pkg_pretend_re = re.compile(r'\s*(pkg_pretend)\s*\(\)')
+
+ def check_eapi(self, eapi):
+ return not eapi_has_pkg_pretend(eapi)
+
+ def check(self, num, line):
+ m = self.pkg_pretend_re.match(line)
+ if m is not None:
+ return ("'%s'" % m.group(1)) + \
+ " phase is not defined in EAPI < 4 on line: %d"
+
# EAPI-4 checks
class Eapi4IncompatibleFuncs(LineCheck):
repoman_check_name = 'EAPI.incompatible'
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2013-08-08 17:33 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2013-08-08 17:33 UTC (permalink / raw
To: gentoo-commits
commit: 49cbc17bf7b99be586e158c1bd588cfe91dfe58c
Author: Samuli Suominen <ssuominen <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 8 17:31:49 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 8 17:31:49 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=49cbc17b
repoman: change preserve_old_lib msg, bug #480244
---
pym/repoman/checks.py | 4 ++--
pym/repoman/errors.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index c552581..c60db3d 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -682,8 +682,8 @@ class NoAsNeeded(LineCheck):
error = errors.NO_AS_NEEDED
class PreserveOldLib(LineCheck):
- """Check for calls to the preserve_old_lib function."""
- repoman_check_name = 'upstream.workaround'
+ """Check for calls to the deprecated preserve_old_lib function."""
+ repoman_check_name = 'ebuild.minorsyn'
re = re.compile(r'.*preserve_old_lib')
error = errors.PRESERVE_OLD_LIB
diff --git a/pym/repoman/errors.py b/pym/repoman/errors.py
index 51ffeb8..3833be6 100644
--- a/pym/repoman/errors.py
+++ b/pym/repoman/errors.py
@@ -19,7 +19,7 @@ EMAKE_PARALLEL_DISABLED_VIA_MAKEOPTS = 'Upstream parallel compilation bug (MAKEO
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 = 'Upstream ABI change workaround 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'
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2013-05-24 19:00 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2013-05-24 19:00 UTC (permalink / raw
To: gentoo-commits
commit: aa026d95ddcad54da1baa22155ff583d7d1f5171
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 24 19:00:00 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 24 19:00:00 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=aa026d95
repoman: deprecate mono.eclass, bug #471184
---
pym/repoman/checks.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 8c0a301..c552581 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -387,6 +387,7 @@ class InheritDeprecated(LineCheck):
"distutils": "distutils-r1",
"gems": "ruby-fakegem",
"git": "git-2",
+ "mono": "mono-env",
"mozconfig-2": "mozconfig-3",
"mozcoreconf": "mozcoreconf-2",
"php-ext-pecl-r1": "php-ext-pecl-r2",
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2013-04-22 21:08 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2013-04-22 21:08 UTC (permalink / raw
To: gentoo-commits
commit: a1dd9cd4c41c7c390afac0cddcb0676a1532e75f
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 20 17:22:48 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 22 21:07:36 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a1dd9cd4
Deprecate python.eclass & distutils.eclass.
---
pym/repoman/checks.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 5146e4d..8c0a301 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -384,6 +384,7 @@ class InheritDeprecated(LineCheck):
deprecated_classes = {
"bash-completion": "bash-completion-r1",
"boost-utils": False,
+ "distutils": "distutils-r1",
"gems": "ruby-fakegem",
"git": "git-2",
"mozconfig-2": "mozconfig-3",
@@ -391,6 +392,7 @@ class InheritDeprecated(LineCheck):
"php-ext-pecl-r1": "php-ext-pecl-r2",
"php-ext-source-r1": "php-ext-source-r2",
"php-pear": "php-pear-r1",
+ "python": "python-r1 / python-single-r1 / python-any-r1",
"python-distutils-ng": "python-r1 + distutils-r1",
"qt3": False,
"qt4": "qt4-r2",
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2013-03-19 16:50 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2013-03-19 16:50 UTC (permalink / raw
To: gentoo-commits
commit: 2e13ec014ffda81d340f3d373e879b9587078b0c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 19 16:49:22 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar 19 16:49:22 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2e13ec01
repoman: exempt multilib-minimal for get_libdir
This will fix bug #461944.
---
pym/repoman/checks.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 1a53934..5146e4d 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -596,7 +596,8 @@ _eclass_info = {
),
# These are "eclasses are the whole ebuild" type thing.
- 'exempt_eclasses': _eclass_export_functions + ('autotools', 'libtool'),
+ 'exempt_eclasses': _eclass_export_functions + ('autotools', 'libtool',
+ 'multilib-minimal'),
'comprehensive': False
},
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2013-03-15 3:30 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 123+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-03-15 3:30 UTC (permalink / raw
To: gentoo-commits
commit: 59fcd70861387f03fc34c9c891e154bb6617d285
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri Mar 15 03:29:17 2013 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Fri Mar 15 03:29:17 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=59fcd708
Fix NameError introduced in commit 473caf415603e0b69ac29b0f0e59761b3c583ed8.
---
pym/repoman/checks.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index b29b8d3..1a53934 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -165,7 +165,7 @@ class EbuildQuote(LineCheck):
"GAMES_LOGDIR", "GAMES_BINDIR"]
# variables for multibuild.eclass
- var_name += ["BUILD_DIR"]
+ var_names += ["BUILD_DIR"]
var_names = "(%s)" % "|".join(var_names)
var_reference = re.compile(r'\$(\{'+var_names+'\}|' + \
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2013-03-14 17:18 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2013-03-14 17:18 UTC (permalink / raw
To: gentoo-commits
commit: 473caf415603e0b69ac29b0f0e59761b3c583ed8
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 14 17:12:34 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 14 17:18:11 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=473caf41
repoman checks: include BUILD_DIR in quoting checks.
---
pym/repoman/checks.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 3b2b124..b29b8d3 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -164,6 +164,9 @@ class EbuildQuote(LineCheck):
"GAMES_DATADIR_BASE", "GAMES_SYSCONFDIR", "GAMES_STATEDIR",
"GAMES_LOGDIR", "GAMES_BINDIR"]
+ # variables for multibuild.eclass
+ var_name += ["BUILD_DIR"]
+
var_names = "(%s)" % "|".join(var_names)
var_reference = re.compile(r'\$(\{'+var_names+'\}|' + \
var_names + '\W)')
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2013-02-11 9:50 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2013-02-11 9:50 UTC (permalink / raw
To: gentoo-commits
commit: de51993645f9656dfa8a74f6bf9cc85ed56ee8fa
Author: Heather <Heather <AT> cynede <DOT> net>
AuthorDate: Mon Feb 11 07:41:04 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 11 09:49:46 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=de519936
nowarn syntax for repoman to ignore
---
pym/repoman/checks.py | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 9dd3b95..3b2b124 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -883,17 +883,18 @@ def run_checks(contents, pkg):
multiline = line
continue
- # Finally we have a full line to parse.
- is_comment = _ignore_comment_re.match(line) is not None
- for lc in checks:
- if is_comment and lc.ignore_comment:
- continue
- if lc.check_eapi(pkg.eapi):
- ignore = lc.ignore_line
- if not ignore or not ignore.match(line):
- e = lc.check(num, line)
- if e:
- yield lc.repoman_check_name, e % (num + 1)
+ if not line.endswith("#nowarn\n"):
+ # Finally we have a full line to parse.
+ is_comment = _ignore_comment_re.match(line) is not None
+ for lc in checks:
+ if is_comment and lc.ignore_comment:
+ continue
+ if lc.check_eapi(pkg.eapi):
+ ignore = lc.ignore_line
+ if not ignore or not ignore.match(line):
+ e = lc.check(num, line)
+ if e:
+ yield lc.repoman_check_name, e % (num + 1)
for lc in checks:
i = lc.end()
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2013-01-19 19:11 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2013-01-19 19:11 UTC (permalink / raw
To: gentoo-commits
commit: eb628bb18c26c6a6aaf55cfa5ba69d54c5aac0ce
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 19 19:10:36 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jan 19 19:10:36 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eb628bb1
FindVCS: add debug info
---
pym/repoman/utilities.py | 38 ++++++++++++++++++++++++++++++--------
1 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 8d24abb..cb03621 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -25,6 +25,7 @@ __all__ = [
"UpdateChangeLog"
]
+import collections
import errno
import io
from itertools import chain
@@ -521,6 +522,28 @@ def FindPortdir(settings):
return [normalize_path(x) for x in (portdir, portdir_overlay, location)]
+_vcs_type = collections.namedtuple('_vcs_type',
+ 'name dir_name')
+
+_FindVCS_data = (
+ _vcs_type(
+ name = 'git',
+ dir_name = '.git'
+ ),
+ _vcs_type(
+ name = 'bzr',
+ dir_name = '.bzr'
+ ),
+ _vcs_type(
+ name = 'hg',
+ dir_name = '.hg'
+ ),
+ _vcs_type(
+ name = 'svn',
+ dir_name = '.svn'
+ )
+)
+
def FindVCS():
""" Try to figure out in what VCS' working tree we are. """
@@ -532,14 +555,13 @@ def FindVCS():
pathprep = ''
while depth is None or depth > 0:
- if os.path.isdir(os.path.join(pathprep, '.git')):
- retvcs.append('git')
- if os.path.isdir(os.path.join(pathprep, '.bzr')):
- retvcs.append('bzr')
- if os.path.isdir(os.path.join(pathprep, '.hg')):
- retvcs.append('hg')
- if os.path.isdir(os.path.join(pathprep, '.svn')): # >=1.7
- retvcs.append('svn')
+ for vcs_type in _FindVCS_data:
+ vcs_dir = os.path.join(pathprep, vcs_type.dir_name)
+ if os.path.isdir(vcs_dir):
+ logging.debug('FindVCS: found %(name)s dir: %(vcs_dir)s' %
+ {'name': vcs_type.name,
+ 'vcs_dir': os.path.abspath(vcs_dir)})
+ retvcs.append(vcs_type.name)
if retvcs:
break
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2013-01-01 23:40 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2013-01-01 23:40 UTC (permalink / raw
To: gentoo-commits
commit: e59b6ab18f346e3bbe134f4953a8c617d94a1dbf
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 1 23:39:50 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan 1 23:39:50 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e59b6ab1
repoman: usex check 4-python and 4-slot-abi
---
pym/repoman/checks.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 80e0d14..36c9863 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -506,7 +506,7 @@ class InheritEclass(LineCheck):
yield 'no function called from %s.eclass; please drop' % self._eclass
_eclass_eapi_functions = {
- "usex" : lambda eapi: eapi not in ("0", "1", "2", "3", "4")
+ "usex" : lambda eapi: eapi not in ("0", "1", "2", "3", "4", "4-python", "4-slot-abi")
}
# eclasses that export ${ECLASS}_src_(compile|configure|install)
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2013-01-01 23:23 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2013-01-01 23:23 UTC (permalink / raw
To: gentoo-commits
commit: 7213586e1bdfbab66ddb21284eddbd9b51c28cb1
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 1 23:23:46 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan 1 23:23:46 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7213586e
repoman: handle EAPI 5 usex, bug #449678
---
pym/repoman/checks.py | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index c6c7ddb..80e0d14 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -480,6 +480,7 @@ class InheritEclass(LineCheck):
self._disabled = any(x in inherited for x in self._exempt_eclasses)
else:
self._disabled = False
+ self._eapi = pkg.eapi
def check(self, num, line):
if not self._inherit:
@@ -488,10 +489,14 @@ class InheritEclass(LineCheck):
if self._disabled or self._ignore_missing:
return
s = self._func_re.search(line)
- if s:
- self._func_call = True
- return '%s.eclass is not inherited, but "%s" found at line: %s' % \
- (self._eclass, s.group(3), '%d')
+ if s is not None:
+ func_name = s.group(3)
+ eapi_func = _eclass_eapi_functions.get(func_name)
+ if eapi_func is None or not eapi_func(self._eapi):
+ self._func_call = True
+ return ('%s.eclass is not inherited, '
+ 'but "%s" found at line: %s') % \
+ (self._eclass, func_name, '%d')
elif not self._func_call:
self._func_call = self._func_re.search(line)
@@ -500,6 +505,10 @@ class InheritEclass(LineCheck):
self.repoman_check_name = 'inherit.unused'
yield 'no function called from %s.eclass; please drop' % self._eclass
+_eclass_eapi_functions = {
+ "usex" : lambda eapi: eapi not in ("0", "1", "2", "3", "4")
+}
+
# eclasses that export ${ECLASS}_src_(compile|configure|install)
_eclass_export_functions = (
'ant-tasks', 'apache-2', 'apache-module', 'aspell-dict',
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-12-15 20:08 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-12-15 20:08 UTC (permalink / raw
To: gentoo-commits
commit: e91e0dac2fbcec4ebb42af29e2914a120341eefa
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 15 14:43:29 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 15 20:04:58 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e91e0dac
makeopts_jobs is declared in multiprocessing, not eutils.
---
pym/repoman/checks.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index f8252b5..c6c7ddb 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -552,8 +552,7 @@ _eclass_info = {
'funcs': (
'estack_push', 'estack_pop', 'eshopts_push', 'eshopts_pop',
'eumask_push', 'eumask_pop', 'epatch', 'epatch_user',
- 'emktemp', 'edos2unix', 'in_iuse', 'use_if_iuse', 'usex',
- 'makeopts_jobs'
+ 'emktemp', 'edos2unix', 'in_iuse', 'use_if_iuse', 'usex'
),
'comprehensive': False,
@@ -588,6 +587,13 @@ _eclass_info = {
'comprehensive': False
},
+ 'multiprocessing': {
+ 'funcs': (
+ 'makeopts_jobs',
+ ),
+ 'comprehensive': False
+ },
+
'prefix': {
'funcs': (
'eprefixify',
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-11-22 22:12 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 123+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-11-22 22:12 UTC (permalink / raw
To: gentoo-commits
commit: 71859a7defe5700b1bf8442657913a2be1dafdfb
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Nov 22 22:11:35 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Thu Nov 22 22:11:35 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=71859a7d
Fix some typos and improve amount of whitespace.
---
pym/repoman/checks.py | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 0cae50d..f8252b5 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -69,7 +69,7 @@ class EbuildHeader(LineCheck):
Copyright header errors
CVS header errors
License header errors
-
+
Args:
modification_year - Year the ebuild was last modified
"""
@@ -112,7 +112,7 @@ class EbuildWhitespace(LineCheck):
ignore_line = re.compile(r'(^$)|(^(\t)*#)')
ignore_comment = False
leading_spaces = re.compile(r'^[\S\t]')
- trailing_whitespace = re.compile(r'.*([\S]$)')
+ trailing_whitespace = re.compile(r'.*([\S]$)')
def check(self, num, line):
if self.leading_spaces.match(line) is None:
@@ -169,7 +169,7 @@ class EbuildQuote(LineCheck):
r'\}?[^"\'\s]*(\s|$)')
cond_begin = re.compile(r'(^|\s+)\[\[($|\\$|\s+)')
cond_end = re.compile(r'(^|\s+)\]\]($|\\$|\s+)')
-
+
def check(self, num, line):
if self.var_reference.search(line) is None:
return
@@ -239,11 +239,11 @@ class Eapi3EbuildAssignment(EbuildAssignment):
return eapi_supports_prefix(eapi)
class EbuildNestedDie(LineCheck):
- """Check ebuild for nested die statements (die statements in subshells"""
-
+ """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
@@ -465,13 +465,13 @@ class InheritEclass(LineCheck):
self._inherit_re = re.compile(r'^(\s*|.*[|&]\s*)\binherit\s(.*\s)?%s(\s|$)' % inherit_re)
# Match when the function is preceded only by leading whitespace, a
# shell operator such as (, {, |, ||, or &&, or optional variable
- # setting(s). This prevents false postives in things like elog
+ # setting(s). This prevents false positives in things like elog
# messages, as reported in bug #413285.
self._func_re = re.compile(r'(^|[|&{(])\s*(\w+=.*)?\b(' + '|'.join(funcs) + r')\b')
def new(self, pkg):
self.repoman_check_name = 'inherit.missing'
- # We can't use pkg.inherited because that tells us all the eclass that
+ # We can't use pkg.inherited because that tells us all the eclasses that
# have been inherited and not just the ones we inherit directly.
self._inherit = False
self._func_call = False
@@ -777,7 +777,7 @@ class PortageInternal(LineCheck):
repoman_check_name = 'portage.internal'
ignore_comment = True
# Match when the command is preceded only by leading whitespace or a shell
- # operator such as (, {, |, ||, or &&. This prevents false postives in
+ # operator such as (, {, |, ||, or &&. This prevents false positives in
# things like elog messages, as reported in bug #413285.
re = re.compile(r'^(\s*|.*[|&{(]+\s*)\b(ecompress|ecompressdir|env-update|prepall|prepalldocs|preplib)\b')
@@ -788,7 +788,6 @@ class PortageInternal(LineCheck):
return ("'%s'" % m.group(2)) + " called on line: %d"
class PortageInternalVariableAssignment(LineCheck):
-
repoman_check_name = 'portage.internal'
internal_assignment = re.compile(r'\s*(export\s+)?(EXTRA_ECONF|EXTRA_EMAKE)\+?=')
@@ -799,6 +798,7 @@ class PortageInternalVariableAssignment(LineCheck):
e = 'Assignment to variable %s' % match.group(2)
e += ' on line: %d'
return e
+
_base_check_classes = (InheritEclass, LineCheck, PhaseCheck)
_constant_checks = tuple(chain((v() for k, v in globals().items()
if isinstance(v, type) and issubclass(v, LineCheck) and v not in _base_check_classes),
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-11-22 21:53 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 123+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-11-22 21:53 UTC (permalink / raw
To: gentoo-commits
commit: da268c268e7fb91318a4676025ec841a4444b362
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Nov 22 21:53:09 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Thu Nov 22 21:53:09 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=da268c26
Bug #440680: Add boost-utils to list of deprecated eclasses.
---
pym/repoman/checks.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index fe9330c..0cae50d 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -378,6 +378,7 @@ class InheritDeprecated(LineCheck):
# deprecated eclass : new eclass (False if no new eclass)
deprecated_classes = {
"bash-completion": "bash-completion-r1",
+ "boost-utils": False,
"gems": "ruby-fakegem",
"git": "git-2",
"mozconfig-2": "mozconfig-3",
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-11-22 21:51 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 123+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-11-22 21:51 UTC (permalink / raw
To: gentoo-commits
commit: 81d6536d096154ce0d1ffd0e02849d35a2610578
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Nov 22 21:48:57 2012 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Thu Nov 22 21:48:57 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=81d6536d
Automatically generate list of repoman checks.
This also reenables InheritDeprecated check, which has been disabled in
commit 597826a1cabf654f9b3fff88425d04303e921577.
---
pym/repoman/checks.py | 16 +++-------------
1 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 8b80214..fe9330c 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -798,19 +798,9 @@ class PortageInternalVariableAssignment(LineCheck):
e = 'Assignment to variable %s' % match.group(2)
e += ' on line: %d'
return e
-
-_constant_checks = tuple(chain((c() for c in (
- EbuildHeader, EbuildWhitespace, EbuildBlankLine, EbuildQuote,
- EbuildAssignment, Eapi3EbuildAssignment, EbuildUselessDodoc,
- EbuildUselessCdS, EbuildNestedDie,
- EbuildPatches, EbuildQuotedA, EapiDefinition,
- ImplicitRuntimeDeps,
- EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS, NoAsNeeded,
- DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue,
- SrcCompileEconf, Eapi3DeprecatedFuncs, NoOffsetWithHelpers,
- Eapi4IncompatibleFuncs, Eapi4GoneVars, BuiltWithUse,
- PreserveOldLib, SandboxAddpredict, PortageInternal,
- PortageInternalVariableAssignment, DeprecatedUseq, DeprecatedHasq)),
+_base_check_classes = (InheritEclass, LineCheck, PhaseCheck)
+_constant_checks = tuple(chain((v() for k, v in globals().items()
+ if isinstance(v, type) and issubclass(v, LineCheck) and v not in _base_check_classes),
(InheritEclass(k, **kwargs) for k, kwargs in _eclass_info.items())))
_here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$')
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-10-31 14:11 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-10-31 14:11 UTC (permalink / raw
To: gentoo-commits
commit: 700946f783ee3f06a10b913cd190a1983264a2ec
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 31 10:07:19 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct 31 14:11:05 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=700946f7
Deprecate python-distutils-ng.
python-r1 & distutils-r1 are almost drop-in replacements.
---
pym/repoman/checks.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index b47028c..240f249 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -385,6 +385,7 @@ class InheritDeprecated(LineCheck):
"php-ext-pecl-r1": "php-ext-pecl-r2",
"php-ext-source-r1": "php-ext-source-r2",
"php-pear": "php-pear-r1",
+ "python-distutils-ng": "python-r1 + distutils-r1",
"qt3": False,
"qt4": "qt4-r2",
"ruby": "ruby-ng",
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-10-08 14:17 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-10-08 14:17 UTC (permalink / raw
To: gentoo-commits
commit: 202a55ef437e8d472f25a8013b5694efee855e78
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 8 14:17:20 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 8 14:17:20 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=202a55ef
repoman: simplify EbuildAssignment check
The line continuation code is no longer needed since commit
a1578c654f26cab07309bc9cbddd3c95c0c205b5, because wrapped lines are
automatically joined before they are passed to the check. Also, inherit
ignore_comment = True from LineCheck.
---
pym/repoman/checks.py | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 9c076ea..7e3d4b8 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -221,21 +221,13 @@ class EbuildAssignment(LineCheck):
"""Ensure ebuilds don't assign to readonly variables."""
repoman_check_name = 'variable.readonly'
-
readonly_assignment = re.compile(r'^\s*(export\s+)?(A|CATEGORY|P|PV|PN|PR|PVR|PF|D|WORKDIR|FILESDIR|FEATURES|USE)=')
- line_continuation = re.compile(r'([^#]*\S)(\s+|\t)\\$')
- ignore_line = re.compile(r'(^$)|(^(\t)*#)')
- ignore_comment = False
-
- def __init__(self):
- self.previous_line = None
def check(self, num, line):
match = self.readonly_assignment.match(line)
e = None
- if match and (not self.previous_line or not self.line_continuation.match(self.previous_line)):
+ if match is not None:
e = errors.READONLY_ASSIGNMENT_ERROR
- self.previous_line = line
return e
class Eapi3EbuildAssignment(EbuildAssignment):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-09-12 4:56 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-09-12 4:56 UTC (permalink / raw
To: gentoo-commits
commit: 5614fa2d7cef0b509136fd00c52a8436d41a3647
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 12 04:56:39 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 12 04:56:39 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5614fa2d
make_herd_base: encode unicode file paths safely
This will fix cases similar to the one fixed in commit
f01d7a8ca158ec60df76a3e8ae5b80ac3f62429e for bug #310789.
---
pym/repoman/herdbase.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/herdbase.py b/pym/repoman/herdbase.py
index fcf58b3..4c420d0 100644
--- a/pym/repoman/herdbase.py
+++ b/pym/repoman/herdbase.py
@@ -17,6 +17,8 @@ except (ImportError, SystemError, RuntimeError, Exception):
# 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
__all__ = [
@@ -56,7 +58,8 @@ def make_herd_base(filename):
all_emails = set()
try:
- xml_tree = xml.etree.ElementTree.parse(filename,
+ 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:
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-09-10 21:07 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-09-10 21:07 UTC (permalink / raw
To: gentoo-commits
commit: c512c31e3ce0f53ac3ad4d59a577503413704174
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 10 21:06:52 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 10 21:06:52 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c512c31e
repoman: fix Unicode unequal comparison warning
---
pym/repoman/utilities.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index e5236aa..b408074 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -439,7 +439,7 @@ def FindPortdir(settings):
portdir = None
portdir_overlay = None
location = os.getcwd()
- pwd = os.environ.get('PWD', '')
+ pwd = _unicode_decode(os.environ.get('PWD', ''), encoding=_encodings['fs'])
if pwd and pwd != location and os.path.realpath(pwd) == location:
# getcwd() returns the canonical path but that makes it hard for repoman to
# orient itself if the user has symlinks in their portage tree structure.
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-09-10 5:52 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-09-10 5:52 UTC (permalink / raw
To: gentoo-commits
commit: e885f1f1a555cd7b285e4f6958d06a145af5283a
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 10 05:45:54 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 10 05:52:04 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e885f1f1
repoman: fix getstatusoutput more, bug #310789
---
pym/repoman/utilities.py | 32 ++++++++++++++++++++++----------
1 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 013858a..e5236aa 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -33,6 +33,7 @@ import pwd
import re
import stat
import sys
+import subprocess
import time
import textwrap
import difflib
@@ -40,11 +41,11 @@ from tempfile import mkstemp
from portage import os
from portage import shutil
-from portage import subprocess_getstatusoutput
from portage import _encodings
from portage import _unicode_decode
from portage import _unicode_encode
from portage import output
+from portage.const import BASH_BINARY
from portage.localization import _
from portage.output import red, green
from portage.process import find_binary
@@ -71,22 +72,33 @@ def detect_vcs_conflicts(options, vcs):
Returns:
None (calls sys.exit on fatal problems)
"""
- retval = ("","")
+
+ cmd = None
if vcs == 'cvs':
logging.info("Performing a " + output.green("cvs -n up") + \
" with a little magic grep to check for updates.")
- retval = subprocess_getstatusoutput("cvs -n up 2>/dev/null | " + \
+ cmd = "cvs -n up 2>/dev/null | " + \
"egrep '^[^\?] .*' | " + \
- "egrep -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'")
+ "egrep -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'"
if vcs == 'svn':
logging.info("Performing a " + output.green("svn status -u") + \
" with a little magic grep to check for updates.")
- retval = subprocess_getstatusoutput("svn status -u 2>&1 | " + \
+ cmd = "svn status -u 2>&1 | " + \
"egrep -v '^. +.*/digest-[^/]+' | " + \
- "head -n-1")
-
- if vcs in ['cvs', 'svn']:
- mylines = retval[1].splitlines()
+ "head -n-1"
+
+ if cmd is not None:
+ # Use Popen instead of getstatusoutput(), in order to avoid
+ # unicode handling problems (see bug #310789).
+ args = [BASH_BINARY, "-c", cmd]
+ if sys.hexversion < 0x3000000 or sys.hexversion >= 0x3020000:
+ # Python 3.1 does not support bytes in Popen args.
+ args = [_unicode_encode(x) for x in args]
+ proc = subprocess.Popen(args, stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+ out = _unicode_decode(proc.communicate()[0])
+ proc.wait()
+ mylines = out.splitlines()
myupdates = []
for line in mylines:
if not line:
@@ -98,7 +110,7 @@ def detect_vcs_conflicts(options, vcs):
logging.error(red("!!! Please fix the following issues reported " + \
"from cvs: ")+green("(U,P,M,A,R,D are ok)"))
logging.error(red("!!! Note: This is a pretend/no-modify pass..."))
- logging.error(retval[1])
+ logging.error(out)
sys.exit(1)
elif vcs == 'cvs' and line[0] in "UP":
myupdates.append(line[2:])
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-09-10 5:46 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-09-10 5:46 UTC (permalink / raw
To: gentoo-commits
commit: 4ad3eda1e7f9546ebc474ae563207fb5a2566839
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 10 05:45:54 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 10 05:45:54 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4ad3eda1
repoman: fix getstatusoutput more, bug #310789
---
pym/repoman/utilities.py | 32 ++++++++++++++++++++++----------
1 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 013858a..03dbdab 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -33,6 +33,7 @@ import pwd
import re
import stat
import sys
+import subprocess
import time
import textwrap
import difflib
@@ -40,11 +41,11 @@ from tempfile import mkstemp
from portage import os
from portage import shutil
-from portage import subprocess_getstatusoutput
from portage import _encodings
from portage import _unicode_decode
from portage import _unicode_encode
from portage import output
+from portage.const import BASH_BINARY
from portage.localization import _
from portage.output import red, green
from portage.process import find_binary
@@ -71,22 +72,33 @@ def detect_vcs_conflicts(options, vcs):
Returns:
None (calls sys.exit on fatal problems)
"""
- retval = ("","")
+
+ cmd = None
if vcs == 'cvs':
logging.info("Performing a " + output.green("cvs -n up") + \
" with a little magic grep to check for updates.")
- retval = subprocess_getstatusoutput("cvs -n up 2>/dev/null | " + \
+ cmd = "cvs -n up 2>/dev/null | " + \
"egrep '^[^\?] .*' | " + \
- "egrep -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'")
+ "egrep -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'"
if vcs == 'svn':
logging.info("Performing a " + output.green("svn status -u") + \
" with a little magic grep to check for updates.")
- retval = subprocess_getstatusoutput("svn status -u 2>&1 | " + \
+ cmd = "svn status -u 2>&1 | " + \
"egrep -v '^. +.*/digest-[^/]+' | " + \
- "head -n-1")
-
- if vcs in ['cvs', 'svn']:
- mylines = retval[1].splitlines()
+ "head -n-1"
+
+ if cmd is not None:
+ # Use Popen instead of getstatusoutput(), in order to avoid
+ # unicode handling problems (see bug #310789).
+ args = [BASH_BINARY, "-c", cmd]
+ if sys.hexversion < 0x3000000 or sys.hexversion >= 0x3020000:
+ # Python 3.1 does not support bytes in Popen args.
+ args = [_unicode_encode(x) for x in args]
+ proc = subprocess.Popen(args, stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+ out = proc.communicate()[0]
+ proc.wait()
+ mylines = out.splitlines()
myupdates = []
for line in mylines:
if not line:
@@ -98,7 +110,7 @@ def detect_vcs_conflicts(options, vcs):
logging.error(red("!!! Please fix the following issues reported " + \
"from cvs: ")+green("(U,P,M,A,R,D are ok)"))
logging.error(red("!!! Note: This is a pretend/no-modify pass..."))
- logging.error(retval[1])
+ logging.error(out)
sys.exit(1)
elif vcs == 'cvs' and line[0] in "UP":
myupdates.append(line[2:])
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-06-21 1:02 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-06-21 1:02 UTC (permalink / raw
To: gentoo-commits
commit: 7a294d7fdc75ef71823c84f46e868326d308d638
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 21 01:02:22 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 21 01:02:22 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7a294d7f
InheritEclass: add user esethome func
---
pym/repoman/checks.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 92a1e5a..ca4c260 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -611,7 +611,7 @@ _eclass_info = {
'user': {
'funcs': (
'enewuser', 'enewgroup',
- 'egetent', 'egethome', 'egetshell'
+ 'egetent', 'egethome', 'egetshell', 'esethome'
),
'comprehensive': True
}
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-06-09 2:03 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-06-09 2:03 UTC (permalink / raw
To: gentoo-commits
commit: a199763028a451389a92b8e58cab20cda83710b5
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 9 02:03:42 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 9 02:03:42 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a1997630
InheritEclass: avoid false positive in func regex
---
pym/repoman/checks.py | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 2864d67..92a1e5a 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -469,10 +469,11 @@ class InheritEclass(LineCheck):
self._ignore_missing = ignore_missing
inherit_re = eclass
self._inherit_re = re.compile(r'^(\s*|.*[|&]\s*)\binherit\s(.*\s)?%s(\s|$)' % inherit_re)
- # Match when the function is preceded only by leading whitespace or a shell
- # operator such as (, {, |, ||, or &&. This prevents false postives in
- # things like elog messages, as reported in bug #413285.
- self._func_re = re.compile(r'(^|[|&{(])\s*\b(' + '|'.join(funcs) + r')\b')
+ # Match when the function is preceded only by leading whitespace, a
+ # shell operator such as (, {, |, ||, or &&, or optional variable
+ # setting(s). This prevents false postives in things like elog
+ # messages, as reported in bug #413285.
+ self._func_re = re.compile(r'(^|[|&{(])\s*(\w+=.*)?\b(' + '|'.join(funcs) + r')\b')
def new(self, pkg):
self.repoman_check_name = 'inherit.missing'
@@ -496,7 +497,7 @@ class InheritEclass(LineCheck):
if s:
self._func_call = True
return '%s.eclass is not inherited, but "%s" found at line: %s' % \
- (self._eclass, s.group(2), '%d')
+ (self._eclass, s.group(3), '%d')
elif not self._func_call:
self._func_call = self._func_re.search(line)
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-06-08 2:52 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-06-08 2:52 UTC (permalink / raw
To: gentoo-commits
commit: dcdfed5f9487f4232affc156518e05e00c10da5f
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 8 02:51:48 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 8 02:51:48 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dcdfed5f
InheritEclass: avoid false positive in func regex
---
pym/repoman/checks.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 65f024c..2864d67 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -469,7 +469,10 @@ class InheritEclass(LineCheck):
self._ignore_missing = ignore_missing
inherit_re = eclass
self._inherit_re = re.compile(r'^(\s*|.*[|&]\s*)\binherit\s(.*\s)?%s(\s|$)' % inherit_re)
- self._func_re = re.compile(r'\b(' + '|'.join(funcs) + r')\b')
+ # Match when the function is preceded only by leading whitespace or a shell
+ # operator such as (, {, |, ||, or &&. This prevents false postives in
+ # things like elog messages, as reported in bug #413285.
+ self._func_re = re.compile(r'(^|[|&{(])\s*\b(' + '|'.join(funcs) + r')\b')
def new(self, pkg):
self.repoman_check_name = 'inherit.missing'
@@ -493,7 +496,7 @@ class InheritEclass(LineCheck):
if s:
self._func_call = True
return '%s.eclass is not inherited, but "%s" found at line: %s' % \
- (self._eclass, s.group(0), '%d')
+ (self._eclass, s.group(2), '%d')
elif not self._func_call:
self._func_call = self._func_re.search(line)
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-06-04 4:06 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-06-04 4:06 UTC (permalink / raw
To: gentoo-commits
commit: cb942014acf8323d55d4e5dad3637cf231645d91
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 4 04:06:10 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 4 04:06:10 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cb942014
InheritEclass: exempt auto/libtool for multilib
---
pym/repoman/checks.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 2627f38..65f024c 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -585,7 +585,7 @@ _eclass_info = {
),
# These are "eclasses are the whole ebuild" type thing.
- 'exempt_eclasses': _eclass_export_functions,
+ 'exempt_eclasses': _eclass_export_functions + ('autotools', 'libtool'),
'comprehensive': False
},
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-06-04 3:25 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-06-04 3:25 UTC (permalink / raw
To: gentoo-commits
commit: 7372606cb28005eec386f02fa831bdfbb45de867
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 4 03:25:10 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 4 03:25:10 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7372606c
InheritEclass: exempt autotools for libtool
---
pym/repoman/checks.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 15c5f35..2627f38 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -575,7 +575,8 @@ _eclass_info = {
'funcs': (
'elibtoolize',
),
- 'comprehensive': True
+ 'comprehensive': True,
+ 'exempt_eclasses': ('autotools',)
},
'multilib': {
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-06-02 6:24 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-06-02 6:24 UTC (permalink / raw
To: gentoo-commits
commit: f160c636e6b6fd4388534a2483e33b4a241bd1fe
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 2 06:24:10 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 2 06:24:10 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f160c636
InheritEclass: remove unused inherited_api code
---
pym/repoman/checks.py | 14 --------------
1 files changed, 0 insertions(+), 14 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 62c735e..15c5f35 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -468,9 +468,6 @@ class InheritEclass(LineCheck):
self._exempt_eclasses = exempt_eclasses
self._ignore_missing = ignore_missing
inherit_re = eclass
- subclasses = _eclass_subclass_info.get(eclass)
- if subclasses is not None:
- inherit_re = '(%s)' % '|'.join([eclass] + list(subclasses))
self._inherit_re = re.compile(r'^(\s*|.*[|&]\s*)\binherit\s(.*\s)?%s(\s|$)' % inherit_re)
self._func_re = re.compile(r'\b(' + '|'.join(funcs) + r')\b')
@@ -564,8 +561,6 @@ _eclass_info = {
# These are "eclasses are the whole ebuild" type thing.
'exempt_eclasses': _eclass_export_functions,
-
- #'inherited_api': ('multilib', 'user',),
},
'flag-o-matic': {
@@ -617,14 +612,6 @@ _eclass_info = {
}
}
-_eclass_subclass_info = {}
-
-for k, v in _eclass_info.items():
- inherited_api = v.get('inherited_api')
- if inherited_api is not None:
- for parent in inherited_api:
- _eclass_subclass_info.setdefault(parent, set()).add(k)
-
if not _ENABLE_INHERIT_CHECK:
# Since the InheritEclass check is experimental, in the stable branch
# we emulate the old eprefixify.defined and inherit.autotools checks.
@@ -647,7 +634,6 @@ if not _ENABLE_INHERIT_CHECK:
'comprehensive': False
}
}
- _eclass_subclass_info = {}
class IUseUndefined(LineCheck):
"""
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-06-02 6:24 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-06-02 6:24 UTC (permalink / raw
To: gentoo-commits
commit: f32f9308393fe9e6ef9143ac852479ec63bc8a70
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 2 06:21:49 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 2 06:21:49 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f32f9308
InheritEclass: exempt eclasses that export src_*
We really need to annotate exceptions like these directly in the
eclasses, but hardcode them for now.
---
pym/repoman/checks.py | 38 +++++++++++++++++++++++++++++++++++---
1 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index ab93ac9..62c735e 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -481,7 +481,8 @@ class InheritEclass(LineCheck):
self._inherit = False
self._func_call = False
if self._exempt_eclasses is not None:
- self._disabled = any(x in pkg.inherited for x in self._exempt_eclasses)
+ inherited = pkg.inherited
+ self._disabled = any(x in inherited for x in self._exempt_eclasses)
else:
self._disabled = False
@@ -504,6 +505,37 @@ class InheritEclass(LineCheck):
self.repoman_check_name = 'inherit.unused'
yield 'no function called from %s.eclass; please drop' % self._eclass
+# eclasses that export ${ECLASS}_src_(compile|configure|install)
+_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 = {
'autotools': {
'funcs': (
@@ -531,7 +563,7 @@ _eclass_info = {
'comprehensive': False,
# These are "eclasses are the whole ebuild" type thing.
- 'exempt_eclasses': ('base', 'cmake-utils', 'kde4-base', 'toolchain', 'toolchain-binutils', 'vim'),
+ 'exempt_eclasses': _eclass_export_functions,
#'inherited_api': ('multilib', 'user',),
},
@@ -557,7 +589,7 @@ _eclass_info = {
),
# These are "eclasses are the whole ebuild" type thing.
- 'exempt_eclasses': ('cmake-utils', 'kde4-base'),
+ 'exempt_eclasses': _eclass_export_functions,
'comprehensive': False
},
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-06-02 5:14 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-06-02 5:14 UTC (permalink / raw
To: gentoo-commits
commit: 54410a15b2c6c01121330361da9583c3902c44a8
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 2 05:14:33 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun 2 05:14:33 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=54410a15
InheritEclass: kde4-base exemptions
---
pym/repoman/checks.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 461e216..ab93ac9 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -531,7 +531,7 @@ _eclass_info = {
'comprehensive': False,
# These are "eclasses are the whole ebuild" type thing.
- 'exempt_eclasses': ('base', 'cmake-utils', 'toolchain', 'toolchain-binutils', 'vim'),
+ 'exempt_eclasses': ('base', 'cmake-utils', 'kde4-base', 'toolchain', 'toolchain-binutils', 'vim'),
#'inherited_api': ('multilib', 'user',),
},
@@ -557,7 +557,7 @@ _eclass_info = {
),
# These are "eclasses are the whole ebuild" type thing.
- 'exempt_eclasses': ('cmake-utils',),
+ 'exempt_eclasses': ('cmake-utils', 'kde4-base'),
'comprehensive': False
},
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-06-01 3:32 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-06-01 3:32 UTC (permalink / raw
To: gentoo-commits
commit: 033084fd96d2a92e4dbfd952bf8c68301e435437
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 1 03:31:37 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 1 03:32:14 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=033084fd
InheritEclass: base and cmake-utils exemptions
---
pym/repoman/checks.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 2101435..4d37187 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -529,7 +529,7 @@ _eclass_info = {
'comprehensive': False,
# These are "eclasses are the whole ebuild" type thing.
- 'exempt_eclasses': ('toolchain', 'toolchain-binutils', 'vim'),
+ 'exempt_eclasses': ('base', 'cmake-utils', 'toolchain', 'toolchain-binutils', 'vim'),
#'inherited_api': ('multilib', 'user',),
},
@@ -553,6 +553,10 @@ _eclass_info = {
'funcs': (
'get_libdir',
),
+
+ # These are "eclasses are the whole ebuild" type thing.
+ 'exempt_eclasses': ('cmake-utils',),
+
'comprehensive': False
},
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-06-01 2:23 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-06-01 2:23 UTC (permalink / raw
To: gentoo-commits
commit: 42297ec38d291165527ea4d5124638ce084cb15c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 1 02:23:30 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 1 02:23:30 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=42297ec3
InheritEclass: support inherit after && or ||
---
pym/repoman/checks.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 6573b95..2101435 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -469,7 +469,7 @@ class InheritEclass(LineCheck):
subclasses = _eclass_subclass_info.get(eclass)
if subclasses is not None:
inherit_re = '(%s)' % '|'.join([eclass] + list(subclasses))
- self._inherit_re = re.compile(r'^\s*inherit\s(.*\s)?%s(\s|$)' % inherit_re)
+ self._inherit_re = re.compile(r'^(\s*|.*[|&]\s*)\binherit\s(.*\s)?%s(\s|$)' % inherit_re)
self._func_re = re.compile(r'\b(' + '|'.join(funcs) + r')\b')
def new(self, pkg):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-05-31 22:27 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-05-31 22:27 UTC (permalink / raw
To: gentoo-commits
commit: a54ee82de8bb657017f6bc6407676930396f160f
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 31 22:27:23 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 31 22:27:23 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a54ee82d
InheritEclass: exempt vim for eutils
---
pym/repoman/checks.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 6dd4977..6573b95 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -529,7 +529,7 @@ _eclass_info = {
'comprehensive': False,
# These are "eclasses are the whole ebuild" type thing.
- 'exempt_eclasses': ('toolchain', 'toolchain-binutils'),
+ 'exempt_eclasses': ('toolchain', 'toolchain-binutils', 'vim'),
#'inherited_api': ('multilib', 'user',),
},
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-05-31 0:59 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-05-31 0:59 UTC (permalink / raw
To: gentoo-commits
commit: 6d3873a690ccdf47f1d5c3f83fc8dbef92f5a9f1
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu May 31 00:59:03 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 31 00:59:03 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6d3873a6
InheritEclass: fix autotools for polylib-9999
---
pym/repoman/checks.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index cd21fd9..6dd4977 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -498,7 +498,7 @@ class InheritEclass(LineCheck):
self._func_call = self._func_re.search(line)
def end(self):
- if self._comprehensive and self._inherit and not self._func_call:
+ if not self._disabled and self._comprehensive and self._inherit and not self._func_call:
self.repoman_check_name = 'inherit.unused'
yield 'no function called from %s.eclass; please drop' % self._eclass
@@ -516,7 +516,7 @@ _eclass_info = {
# the autotools functions.
# subversion - An ESVN_BOOTSTRAP variable may be used to call one of
# the autotools functions.
- 'exempt_eclasses': ('git', 'subversion', 'autotools-utils')
+ 'exempt_eclasses': ('git', 'git-2', 'subversion', 'autotools-utils')
},
'eutils': {
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-05-30 23:56 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-05-30 23:56 UTC (permalink / raw
To: gentoo-commits
commit: 7acbff42e2ff9a4521efb7fbf2cb69f17944b53c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 30 23:56:33 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 30 23:56:33 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7acbff42
InheritEclass: support subclass inherited_api
---
pym/repoman/checks.py | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 5d56888..cd21fd9 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -461,13 +461,16 @@ class InheritEclass(LineCheck):
"""
def __init__(self, eclass, funcs=None, comprehensive=False,
- exempt_eclasses=None):
+ exempt_eclasses=None, **kwargs):
self._eclass = eclass
- self._funcs = funcs
self._comprehensive = comprehensive
self._exempt_eclasses = exempt_eclasses
- self._inherit_re = re.compile(r'^\s*inherit\s(.*\s)?%s(\s|$)' % self._eclass)
- self._func_re = re.compile(r'\b(' + '|'.join(self._funcs) + r')\b')
+ inherit_re = eclass
+ subclasses = _eclass_subclass_info.get(eclass)
+ if subclasses is not None:
+ inherit_re = '(%s)' % '|'.join([eclass] + list(subclasses))
+ self._inherit_re = re.compile(r'^\s*inherit\s(.*\s)?%s(\s|$)' % inherit_re)
+ self._func_re = re.compile(r'\b(' + '|'.join(funcs) + r')\b')
def new(self, pkg):
self.repoman_check_name = 'inherit.missing'
@@ -526,7 +529,9 @@ _eclass_info = {
'comprehensive': False,
# These are "eclasses are the whole ebuild" type thing.
- 'exempt_eclasses': frozenset(['toolchain', 'toolchain-binutils'])
+ 'exempt_eclasses': ('toolchain', 'toolchain-binutils'),
+
+ #'inherited_api': ('multilib', 'user',),
},
'flag-o-matic': {
@@ -574,6 +579,14 @@ _eclass_info = {
}
}
+_eclass_subclass_info = {}
+
+for k, v in _eclass_info.items():
+ inherited_api = v.get('inherited_api')
+ if inherited_api is not None:
+ for parent in inherited_api:
+ _eclass_subclass_info.setdefault(parent, set()).add(k)
+
class IUseUndefined(LineCheck):
"""
Make sure the ebuild defines IUSE (style guideline
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-05-30 23:20 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-05-30 23:20 UTC (permalink / raw
To: gentoo-commits
commit: 597826a1cabf654f9b3fff88425d04303e921577
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 30 23:20:27 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 30 23:20:27 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=597826a1
InheritEclass: move eclass info to a dict
This handles the info more like it will be handled when we parse it
directly from eclasses.
---
pym/repoman/checks.py | 175 +++++++++++++++++++++++++-----------------------
1 files changed, 91 insertions(+), 84 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 94dcfbe..5d56888 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -6,13 +6,14 @@
and correctness of an ebuild."""
import codecs
+from itertools import chain
import re
import time
import repoman.errors as errors
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_exports_KV
+ eapi_exports_AA
class LineCheck(object):
"""Run a check on a line of an ebuild."""
@@ -452,14 +453,19 @@ class InheritEclass(LineCheck):
Base class for checking for missing inherits, as well as excess inherits.
Args:
- _eclass: Set to the name of your eclass.
- _funcs: A tuple of functions that this eclass provides.
- _comprehensive: Is the list of functions complete?
- _exempt_eclasses: If these eclasses are inherited, disable the missing
+ eclass: Set to the name of your eclass.
+ funcs: A tuple of functions that this eclass provides.
+ comprehensive: Is the list of functions complete?
+ exempt_eclasses: If these eclasses are inherited, disable the missing
inherit check.
"""
- def __init__(self):
+ def __init__(self, eclass, funcs=None, comprehensive=False,
+ exempt_eclasses=None):
+ self._eclass = eclass
+ self._funcs = funcs
+ self._comprehensive = comprehensive
+ self._exempt_eclasses = exempt_eclasses
self._inherit_re = re.compile(r'^\s*inherit\s(.*\s)?%s(\s|$)' % self._eclass)
self._func_re = re.compile(r'\b(' + '|'.join(self._funcs) + r')\b')
@@ -469,7 +475,7 @@ class InheritEclass(LineCheck):
# have been inherited and not just the ones we inherit directly.
self._inherit = False
self._func_call = False
- if hasattr(self, '_exempt_eclasses'):
+ if self._exempt_eclasses is not None:
self._disabled = any(x in pkg.inherited for x in self._exempt_eclasses)
else:
self._disabled = False
@@ -493,78 +499,80 @@ class InheritEclass(LineCheck):
self.repoman_check_name = 'inherit.unused'
yield 'no function called from %s.eclass; please drop' % self._eclass
-class InheritAutotools(InheritEclass):
- _eclass = '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 = frozenset(['git', 'subversion', 'autotools-utils'])
-
-class InheritEutils(InheritEclass):
- _eclass = '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',
- 'makeopts_jobs'
- )
- _comprehensive = False
-
- # These are "eclasses are the whole ebuild" type thing.
- _exempt_eclasses = frozenset(['toolchain', 'toolchain-binutils'])
-
-class InheritFlagOMatic(InheritEclass):
- _eclass = 'flag-o-matic'
- _funcs = (
- 'filter-(ld)?flags', 'strip-flags', 'strip-unsupported-flags',
- 'append-((ld|c(pp|xx)?))?flags', 'append-libs',
- )
- _comprehensive = False
-
-class InheritLibtool(InheritEclass):
- _eclass = 'libtool'
- _funcs = (
- 'elibtoolize',
- )
- _comprehensive = True
-
-class InheritMultilib(InheritEclass):
- _eclass = 'multilib'
- _funcs = (
- 'get_libdir',
- )
- _comprehensive = False
-
-class InheritPrefix(InheritEclass):
- _eclass = 'prefix'
- _funcs = (
- 'eprefixify',
- )
- _comprehensive = True
-
-class InheritToolchainFuncs(InheritEclass):
- _eclass = 'toolchain-funcs'
- _funcs = (
- 'gen_usr_ldscript',
- )
- _comprehensive = False
-
-class InheritUser(InheritEclass):
- _eclass = 'user'
- _funcs = (
- 'enewuser', 'enewgroup',
- 'egetent', 'egethome', 'egetshell'
- )
- _comprehensive = True
+_eclass_info = {
+ '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', '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',
+ 'makeopts_jobs'
+ ),
+ 'comprehensive': False,
+
+ # These are "eclasses are the whole ebuild" type thing.
+ 'exempt_eclasses': frozenset(['toolchain', 'toolchain-binutils'])
+ },
+
+ '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
+ },
+
+ 'multilib': {
+ 'funcs': (
+ 'get_libdir',
+ ),
+ 'comprehensive': False
+ },
+
+ 'prefix': {
+ 'funcs': (
+ 'eprefixify',
+ ),
+ 'comprehensive': True
+ },
+
+ 'toolchain-funcs': {
+ 'funcs': (
+ 'gen_usr_ldscript',
+ ),
+ 'comprehensive': False
+ },
+
+ 'user': {
+ 'funcs': (
+ 'enewuser', 'enewgroup',
+ 'egetent', 'egethome', 'egetshell'
+ ),
+ 'comprehensive': True
+ }
+}
class IUseUndefined(LineCheck):
"""
@@ -739,20 +747,19 @@ class PortageInternal(LineCheck):
if m is not None:
return ("'%s'" % m.group(2)) + " called on line: %d"
-_constant_checks = tuple((c() for c in (
+_constant_checks = tuple(chain((c() for c in (
EbuildHeader, EbuildWhitespace, EbuildBlankLine, EbuildQuote,
EbuildAssignment, Eapi3EbuildAssignment, EbuildUselessDodoc,
EbuildUselessCdS, EbuildNestedDie,
EbuildPatches, EbuildQuotedA, EapiDefinition,
- ImplicitRuntimeDeps, InheritAutotools, InheritDeprecated, InheritEutils,
- InheritFlagOMatic, InheritMultilib, InheritLibtool, InheritPrefix,
- InheritToolchainFuncs, InheritUser, IUseUndefined,
+ ImplicitRuntimeDeps, IUseUndefined,
EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS, NoAsNeeded,
DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue,
SrcCompileEconf, Eapi3DeprecatedFuncs, NoOffsetWithHelpers,
Eapi4IncompatibleFuncs, Eapi4GoneVars, BuiltWithUse,
PreserveOldLib, SandboxAddpredict, PortageInternal,
- DeprecatedUseq, DeprecatedHasq)))
+ DeprecatedUseq, DeprecatedHasq)),
+ (InheritEclass(k, **kwargs) for k, kwargs in _eclass_info.items())))
_here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$')
_ignore_comment_re = re.compile(r'^\s*#')
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-05-25 16:18 Mike Frysinger
0 siblings, 0 replies; 123+ messages in thread
From: Mike Frysinger @ 2012-05-25 16:18 UTC (permalink / raw
To: gentoo-commits
commit: a1578c654f26cab07309bc9cbddd3c95c0c205b5
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu May 24 04:05:30 2012 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri May 25 16:20:12 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a1578c65
repoman: unroll escaped lines so we can check the entirety of it
Sometimes people wrap long lines in their ebuilds to make it easier to
read, but this causes us issues when doing line-by-line checking. So
automatically unroll those lines before passing the full content down
to our checkers.
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
---
pym/repoman/checks.py | 65 ++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 53 insertions(+), 12 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 77df603..a413968 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -5,6 +5,7 @@
"""This module contains functions used in Repoman to ascertain the quality
and correctness of an ebuild."""
+import codecs
import re
import time
import repoman.errors as errors
@@ -692,8 +693,11 @@ _here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$')
_ignore_comment_re = re.compile(r'^\s*#')
def run_checks(contents, pkg):
+ unicode_escape_codec = codecs.lookup('unicode_escape')
+ unicode_escape = lambda x: unicode_escape_codec.decode(x)[0]
checks = _constant_checks
here_doc_delim = None
+ multiline = None
for lc in checks:
lc.new(pkg)
@@ -707,19 +711,56 @@ def run_checks(contents, pkg):
here_doc = _here_doc_re.match(line)
if here_doc is not None:
here_doc_delim = re.compile(r'^\s*%s$' % here_doc.group(1))
+ if here_doc_delim is not None:
+ continue
+
+ # Unroll multiline escaped strings so that we can check things:
+ # inherit foo bar \
+ # moo \
+ # cow
+ # This will merge these lines like so:
+ # inherit foo bar moo cow
+ try:
+ # A normal line will end in the two bytes: <\> <\n>. So decoding
+ # that will result in python thinking the <\n> is being escaped
+ # and eat the single <\> which makes it hard for us to detect.
+ # Instead, strip the newline (which we know all lines have), and
+ # append a <0>. Then when python escapes it, if the line ended
+ # in a <\>, we'll end up with a <\0> marker to key off of. This
+ # shouldn't be a problem with any valid ebuild ...
+ line_escaped = unicode_escape(line.rstrip('\n') + '0')
+ except SystemExit:
+ raise
+ except:
+ # Who knows what kind of crazy crap an ebuild will have
+ # in it -- don't allow it to kill us.
+ line_escaped = line
+ if multiline:
+ # Chop off the \ and \n bytes from the previous line.
+ multiline = multiline[:-2] + line
+ if not line_escaped.endswith('\0'):
+ line = multiline
+ num = multinum
+ multiline = None
+ else:
+ continue
+ else:
+ if line_escaped.endswith('\0'):
+ multinum = num
+ multiline = line
+ continue
- if here_doc_delim is None:
- # We're not in a here-document.
- is_comment = _ignore_comment_re.match(line) is not None
- for lc in checks:
- if is_comment and lc.ignore_comment:
- continue
- if lc.check_eapi(pkg.metadata['EAPI']):
- ignore = lc.ignore_line
- if not ignore or not ignore.match(line):
- e = lc.check(num, line)
- if e:
- yield lc.repoman_check_name, e % (num + 1)
+ # Finally we have a full line to parse.
+ is_comment = _ignore_comment_re.match(line) is not None
+ for lc in checks:
+ if is_comment and lc.ignore_comment:
+ continue
+ if lc.check_eapi(pkg.metadata['EAPI']):
+ ignore = lc.ignore_line
+ if not ignore or not ignore.match(line):
+ e = lc.check(num, line)
+ if e:
+ yield lc.repoman_check_name, e % (num + 1)
for lc in checks:
i = lc.end()
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-04-23 20:18 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-04-23 20:18 UTC (permalink / raw
To: gentoo-commits
commit: a8889947c45a9fa81ca006b333466372b64f0344
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 23 20:15:56 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 20:18:03 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a8889947
repoman: fix portage.internal false positives
---
pym/repoman/checks.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index ab4ddd9..733bbc3 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -664,13 +664,17 @@ class Eapi4GoneVars(LineCheck):
class PortageInternal(LineCheck):
repoman_check_name = 'portage.internal'
- re = re.compile(r'[^#]*\b(ecompress|ecompressdir|env-update|prepall|prepalldocs|preplib)\b')
+ ignore_comment = True
+ # Match when the command is preceded only by leading whitespace or a shell
+ # operator such as (, {, |, ||, or &&. This prevents false postives in
+ # things like elog messages, as reported in bug #413285.
+ re = re.compile(r'^(\s*|.*[|&{(]+\s*)\b(ecompress|ecompressdir|env-update|prepall|prepalldocs|preplib)\b')
def check(self, num, line):
"""Run the check on line and return error if there is one"""
m = self.re.match(line)
if m is not None:
- return ("'%s'" % m.group(1)) + " called on line: %d"
+ return ("'%s'" % m.group(2)) + " called on line: %d"
_constant_checks = tuple((c() for c in (
EbuildHeader, EbuildWhitespace, EbuildBlankLine, EbuildQuote,
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-04-23 20:16 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-04-23 20:16 UTC (permalink / raw
To: gentoo-commits
commit: 84b6a6df608298757b39d092afcddd0ebc5b02f1
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 23 20:15:56 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 20:15:56 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=84b6a6df
repoman: fix portage.internal false positives
---
pym/repoman/checks.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index ab4ddd9..89a71d8 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -664,13 +664,17 @@ class Eapi4GoneVars(LineCheck):
class PortageInternal(LineCheck):
repoman_check_name = 'portage.internal'
- re = re.compile(r'[^#]*\b(ecompress|ecompressdir|env-update|prepall|prepalldocs|preplib)\b')
+ ignore_comment = True
+ # Match when the command is preceded only by leading whitespace or a shell
+ # operator such as (, {, |, ||, or &&. This prevents false postives in things
+ # like elog messages, as reported in bug #413285.
+ re = re.compile(r'^(\s*|.*[|&{(]+\s*)\b(ecompress|ecompressdir|env-update|prepall|prepalldocs|preplib)\b')
def check(self, num, line):
"""Run the check on line and return error if there is one"""
m = self.re.match(line)
if m is not None:
- return ("'%s'" % m.group(1)) + " called on line: %d"
+ return ("'%s'" % m.group(2)) + " called on line: %d"
_constant_checks = tuple((c() for c in (
EbuildHeader, EbuildWhitespace, EbuildBlankLine, EbuildQuote,
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-04-23 20:08 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-04-23 20:08 UTC (permalink / raw
To: gentoo-commits
commit: c9d53cec19dadaa7f318578709e822192c6f373c
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 23 20:08:27 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 20:08:27 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c9d53cec
repoman: fix portage.internal false positives
---
pym/repoman/checks.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index ab4ddd9..23cd37c 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -664,13 +664,17 @@ class Eapi4GoneVars(LineCheck):
class PortageInternal(LineCheck):
repoman_check_name = 'portage.internal'
- re = re.compile(r'[^#]*\b(ecompress|ecompressdir|env-update|prepall|prepalldocs|preplib)\b')
+ ignore_comment = True
+ # Match when the command is preceded only by leading whitespace or a shell
+ # operator such as |, ||, or &&. This prevents false postives in things
+ # like elog messages, as reported in bug #413285.
+ re = re.compile(r'^(\s*|.*[|&]+\s*)\b(ecompress|ecompressdir|env-update|prepall|prepalldocs|preplib)\b')
def check(self, num, line):
"""Run the check on line and return error if there is one"""
m = self.re.match(line)
if m is not None:
- return ("'%s'" % m.group(1)) + " called on line: %d"
+ return ("'%s'" % m.group(2)) + " called on line: %d"
_constant_checks = tuple((c() for c in (
EbuildHeader, EbuildWhitespace, EbuildBlankLine, EbuildQuote,
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-04-22 23:01 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-04-22 23:01 UTC (permalink / raw
To: gentoo-commits
commit: c31e5b74437b499b8361fb867e118e500c0c8d91
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 22 23:01:07 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 23:01:07 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c31e5b74
EapiDefinition: handle impossible "%d" % None
---
pym/repoman/checks.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index c3d110f..ab4ddd9 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -1,5 +1,5 @@
# repoman: Checks
-# Copyright 2007, 2011 Gentoo Foundation
+# Copyright 2007-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
"""This module contains functions used in Repoman to ascertain the quality
@@ -308,11 +308,11 @@ class EapiDefinition(LineCheck):
def end(self):
if self._parsed_eapi is None:
if self._cached_eapi != "0":
- yield "valid EAPI assignment must occur on or before line: %d" % \
+ yield "valid EAPI assignment must occur on or before line: %s" % \
self._eapi_line_num
elif self._parsed_eapi != self._cached_eapi:
yield ("bash returned EAPI '%s' which does not match "
- "assignment on line: %d") % \
+ "assignment on line: %s") % \
(self._cached_eapi, self._eapi_line_num)
class EbuildPatches(LineCheck):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-04-22 22:58 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-04-22 22:58 UTC (permalink / raw
To: gentoo-commits
commit: d55266683484aa4f32fab5e18c69b6cd2f0a6bb1
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 22 22:57:47 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 22:57:47 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d5526668
EapiDefinition: handle impossible "%d" % None
---
pym/repoman/checks.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index c3d110f..735e90e 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -1,5 +1,5 @@
# repoman: Checks
-# Copyright 2007, 2011 Gentoo Foundation
+# Copyright 2007-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
"""This module contains functions used in Repoman to ascertain the quality
@@ -306,14 +306,18 @@ class EapiDefinition(LineCheck):
self._parsed_eapi = m.group(2)
def end(self):
+ eapi_line_num = self._eapi_line_num
+ if eapi_line_num is None:
+ # This shouldn't be necessary, but handle it anyway.
+ eapi_line_num = 1
if self._parsed_eapi is None:
if self._cached_eapi != "0":
yield "valid EAPI assignment must occur on or before line: %d" % \
- self._eapi_line_num
+ eapi_line_num
elif self._parsed_eapi != self._cached_eapi:
yield ("bash returned EAPI '%s' which does not match "
"assignment on line: %d") % \
- (self._cached_eapi, self._eapi_line_num)
+ (self._cached_eapi, eapi_line_num)
class EbuildPatches(LineCheck):
"""Ensure ebuilds use bash arrays for PATCHES to ensure white space safety"""
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-04-22 22:53 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-04-22 22:53 UTC (permalink / raw
To: gentoo-commits
commit: 8975886e91c82164dbae9a44ca10c7284086386e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 22 22:53:32 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 22 22:53:32 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8975886e
EapiDefinition: handle impossible %d % None
---
pym/repoman/checks.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index c3d110f..af805d0 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -1,5 +1,5 @@
# repoman: Checks
-# Copyright 2007, 2011 Gentoo Foundation
+# Copyright 2007-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
"""This module contains functions used in Repoman to ascertain the quality
@@ -308,6 +308,9 @@ class EapiDefinition(LineCheck):
def end(self):
if self._parsed_eapi is None:
if self._cached_eapi != "0":
+ if self._eapi_line_num is None:
+ # This shouldn't be possible, but handle it anyway.
+ self._eapi_line_num = 1
yield "valid EAPI assignment must occur on or before line: %d" % \
self._eapi_line_num
elif self._parsed_eapi != self._cached_eapi:
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-03-05 0:01 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-03-05 0:01 UTC (permalink / raw
To: gentoo-commits
commit: 6cd05a95afe799807c90e71d577fb87b1bd01093
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 5 00:01:29 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Mar 5 00:01:29 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6cd05a95
repoman: support overlays without repo_name
---
pym/repoman/utilities.py | 33 ++++++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 449005a..34d6494 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -1,5 +1,5 @@
# repoman: Utilities
-# Copyright 2007-2011 Gentoo Foundation
+# Copyright 2007-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
"""This module contains utility functions to help repoman find ebuilds to
@@ -17,6 +17,7 @@ __all__ = [
"get_commit_message_with_editor",
"get_commit_message_with_stdin",
"get_committer_name",
+ "have_ebuild_dir",
"have_profile_dir",
"parse_metadata_use",
"UnknownHerdsError",
@@ -30,6 +31,7 @@ from itertools import chain
import logging
import pwd
import re
+import stat
import sys
import time
import textwrap
@@ -126,6 +128,33 @@ def have_profile_dir(path, maxdepth=3, filename="profiles.desc"):
path = normalize_path(path + "/..")
maxdepth -= 1
+def have_ebuild_dir(path, maxdepth=3):
+ """
+ Try to figure out if 'path' or a subdirectory contains one or more
+ ebuild files named appropriately for their parent directory.
+ """
+ stack = [(normalize_path(path), 1)]
+ while stack:
+ path, depth = stack.pop()
+ basename = os.path.basename(path)
+ try:
+ listdir = os.listdir(path)
+ except OSError:
+ continue
+ for filename in listdir:
+ abs_filename = os.path.join(path, filename)
+ try:
+ st = os.stat(abs_filename)
+ except OSError:
+ continue
+ if stat.S_ISDIR(st.st_mode):
+ if depth < maxdepth:
+ stack.append((abs_filename, depth + 1))
+ elif stat.S_ISREG(st.st_mode):
+ if filename.endswith(".ebuild") and \
+ filename.startswith(basename + "-"):
+ return os.path.dirname(os.path.dirname(path))
+
def parse_metadata_use(xml_tree):
"""
Records are wrapped in XML as per GLEP 56
@@ -447,6 +476,8 @@ def FindPortdir(settings):
# file.
if not portdir_overlay:
portdir_overlay = have_profile_dir(location, filename="repo_name")
+ if not portdir_overlay:
+ portdir_overlay = have_ebuild_dir(location)
if portdir_overlay:
subdir = location[len(portdir_overlay):]
if subdir and subdir[-1] != os.sep:
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-02-15 0:04 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-02-15 0:04 UTC (permalink / raw
To: gentoo-commits
commit: 2854a67644252fa1133f7f2720b1811b2c3f10fb
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 15 00:04:34 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Feb 15 00:04:34 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2854a676
repoman: fix ebuild.badheader for bug #403705
---
pym/repoman/checks.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 80f994c..50c017a 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -77,6 +77,7 @@ class EbuildHeader(LineCheck):
# gentoo_license = re.compile(r'^# Distributed under the terms of the GNU General Public License v2$')
gentoo_license = '# Distributed under the terms of the GNU General Public License v2'
cvs_header = re.compile(r'^# \$Header: .*\$$')
+ ignore_comment = False
def new(self, pkg):
if pkg.mtime is None:
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2012-02-12 23:32 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2012-02-12 23:32 UTC (permalink / raw
To: gentoo-commits
commit: 9997bb9c81e0742060dc795e4e0397db4cbfb5c2
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 23:32:12 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 23:32:12 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9997bb9c
repoman: check for env-update, bug #402339
---
pym/repoman/checks.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index cdcc8bc..80f994c 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -647,7 +647,7 @@ class Eapi4GoneVars(LineCheck):
class PortageInternal(LineCheck):
repoman_check_name = 'portage.internal'
- re = re.compile(r'[^#]*\b(ecompress|ecompressdir|prepall|prepalldocs|preplib)\b')
+ re = re.compile(r'[^#]*\b(ecompress|ecompressdir|env-update|prepall|prepalldocs|preplib)\b')
def check(self, num, line):
"""Run the check on line and return error if there is one"""
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-26 18:13 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-26 18:13 UTC (permalink / raw
To: gentoo-commits
commit: f7872bd1418540b8dfe04f604d30b374f86817f0
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 26 18:13:27 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct 26 18:13:27 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f7872bd1
UpdateChangeLog: sort files
---
pym/repoman/utilities.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index a79ea2c..81fa5e7 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -752,6 +752,10 @@ def UpdateChangeLog(pkgdir, user, msg, skel_path, category, package,
display_changed = [fn]
break
+ display_new.sort()
+ display_removed.sort()
+ display_changed.sort()
+
mesg = '%s; %s %s:' % (date, user, ', '.join(chain(
display_new, display_removed, display_changed)))
for line in textwrap.wrap(mesg, 80, \
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-21 8:11 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-21 8:11 UTC (permalink / raw
To: gentoo-commits
commit: 0c63881bf206f8b5f707b1ca4ea2b171d740913d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 21 08:11:32 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 21 08:11:32 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0c63881b
UpdateChangeLog: tweak clold_lines logic
There are two cases here that have to be mutually exclusive.
---
pym/repoman/utilities.py | 31 +++++++++++++++++--------------
1 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index fa58346..a79ea2c 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -771,25 +771,28 @@ def UpdateChangeLog(pkgdir, user, msg, skel_path, category, package,
# append stuff from old ChangeLog
if clold_file is not None:
- # clold_lines may contain a saved non-header line
- # that we want to write first.
- # Also, append this line to clnew_lines so that the
- # unified_diff call doesn't show it as removed.
- for line in clold_lines:
- f.write(line)
- clnew_lines.append(line)
+
+ if clold_lines:
+ # clold_lines may contain a saved non-header line
+ # that we want to write first.
+ # Also, append this line to clnew_lines so that the
+ # unified_diff call doesn't show it as removed.
+ for line in clold_lines:
+ f.write(line)
+ clnew_lines.append(line)
+
+ else:
+ # ensure that there is no more than one blank
+ # line after our new entry
+ for line in clold_file:
+ if line.strip():
+ f.write(line)
+ break
# Now prepend old_header_lines to clold_lines, for use
# in the unified_diff call below.
clold_lines = old_header_lines + clold_lines
- # ensure that there is no more than one blank
- # line after our new entry
- for line in clold_file:
- if line.strip():
- f.write(line)
- break
-
for line in clold_file:
f.write(line)
clold_file.close()
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-21 7:38 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-21 7:38 UTC (permalink / raw
To: gentoo-commits
commit: 9f6fe53436112b7cd764b0c2c24ee2e59fa8ad8f
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 21 07:37:32 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 21 07:37:32 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9f6fe534
update_copyright: make pretend a keyword arg
---
pym/repoman/utilities.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index eecd46f..fa58346 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -562,7 +562,7 @@ def _update_copyright_year(year, line):
line = _unicode_decode(line)
return line
-def update_copyright(fn_path, year, pretend):
+def update_copyright(fn_path, year, pretend=False):
"""
Check file for a Copyright statement, and update its year. The
patterns used for replacing copyrights are taken from echangelog.
@@ -668,7 +668,7 @@ def UpdateChangeLog(pkgdir, user, msg, skel_path, category, package,
for fn in chain(new, changed):
if fn.endswith('.diff') or fn.endswith('.patch'):
continue
- update_copyright(os.path.join(pkgdir, fn), year, pretend)
+ update_copyright(os.path.join(pkgdir, fn), year, pretend=pretend)
cl_path = os.path.join(pkgdir, 'ChangeLog')
clold_lines = []
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-21 7:20 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-21 7:20 UTC (permalink / raw
To: gentoo-commits
commit: bcde93a8752d428ac2ecdcf2608c0c1d75ee5be2
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 21 07:19:48 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 21 07:19:48 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bcde93a8
_update_copyright_year: optimize no-match case
---
pym/repoman/utilities.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 9be6901..eecd46f 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -546,9 +546,16 @@ def _update_copyright_year(year, line):
1999 here (in order to be more generic).
"""
is_bytes = isinstance(line, bytes)
+ if is_bytes:
+ if not line.startswith(b'# Copyright '):
+ return line
+ else:
+ if not line.startswith('# Copyright '):
+ return line
+
year = _unicode_encode(year)
line = _unicode_encode(line)
-
+
line = _copyright_re1.sub(br'\1-' + year + b' ', line)
line = _copyright_re2.sub(_copyright_repl(year), line)
if not is_bytes:
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-21 7:06 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-21 7:06 UTC (permalink / raw
To: gentoo-commits
commit: 4dd5fc4a1fc5f5a9676c212c93244ec8c50288dc
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 21 07:06:32 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 21 07:06:32 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4dd5fc4a
update_copyright: process files as raw bytes
This function will work correctly with files encoded in any character
set, as long as the copyright statements consist of plain ASCII.
---
pym/repoman/utilities.py | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index eec6fdf..9be6901 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -524,8 +524,8 @@ def FindVCS():
return outvcs
-_copyright_re1 = re.compile(r'^(# Copyright \d\d\d\d)-\d\d\d\d ')
-_copyright_re2 = re.compile(r'^(# Copyright )(\d\d\d\d) ')
+_copyright_re1 = re.compile(br'^(# Copyright \d\d\d\d)-\d\d\d\d ')
+_copyright_re2 = re.compile(br'^(# Copyright )(\d\d\d\d) ')
class _copyright_repl(object):
@@ -536,8 +536,8 @@ class _copyright_repl(object):
if matchobj.group(2) == self.year:
return matchobj.group(0)
else:
- return '%s%s-%s ' % \
- (matchobj.group(1), matchobj.group(2), self.year)
+ return matchobj.group(1) + matchobj.group(2) + \
+ b'-' + self.year + b' '
def _update_copyright_year(year, line):
"""
@@ -545,8 +545,14 @@ def _update_copyright_year(year, line):
update_copyright(), except that we don't hardcode
1999 here (in order to be more generic).
"""
- line = _copyright_re1.sub(r'\1-%s ' % year, line)
+ is_bytes = isinstance(line, bytes)
+ year = _unicode_encode(year)
+ line = _unicode_encode(line)
+
+ line = _copyright_re1.sub(br'\1-' + year + b' ', line)
line = _copyright_re2.sub(_copyright_repl(year), line)
+ if not is_bytes:
+ line = _unicode_decode(line)
return line
def update_copyright(fn_path, year, pretend):
@@ -555,12 +561,15 @@ def update_copyright(fn_path, year, pretend):
patterns used for replacing copyrights are taken from echangelog.
Only the first lines of each file that start with a hash ('#') are
considered, until a line is found that doesn't start with a hash.
+ 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.
"""
try:
fn_hdl = io.open(_unicode_encode(fn_path,
encoding=_encodings['fs'], errors='strict'),
- mode='r', encoding=_encodings['repo.content'], errors='replace')
+ mode='rb')
except EnvironmentError:
return
@@ -570,7 +579,7 @@ def update_copyright(fn_path, year, pretend):
for line in fn_hdl:
line_strip = line.strip()
orig_header.append(line)
- if not line_strip or line_strip[:1] != '#':
+ if not line_strip or line_strip[:1] != b'#':
new_header.append(line)
break
@@ -578,7 +587,9 @@ def update_copyright(fn_path, year, pretend):
new_header.append(line)
difflines = 0
- for line in difflib.unified_diff(orig_header, new_header,
+ for line in difflib.unified_diff(
+ [_unicode_decode(line) for line in orig_header],
+ [_unicode_decode(line) for line in new_header],
fromfile=fn_path, tofile=fn_path, n=0):
util.writemsg_stdout(line, noiselevel=-1)
difflines += 1
@@ -588,8 +599,7 @@ def update_copyright(fn_path, year, pretend):
if difflines > 3 and not pretend:
# write new file with changed header
f, fnnew_path = mkstemp()
- f = io.open(f, mode='w', encoding=_encodings['repo.content'],
- errors='backslashreplace')
+ f = io.open(f, mode='wb')
for line in new_header:
f.write(line)
for line in fn_hdl:
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-21 4:53 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-21 4:53 UTC (permalink / raw
To: gentoo-commits
commit: 7d7fa4af2dbec7e7cc06e5ac176fe0b697ee867b
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 21 04:53:14 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 21 04:53:14 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7d7fa4af
UpdateChangeLog: tweak new/changed coded
---
pym/repoman/utilities.py | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 0ecc92c..6b4bd50 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -629,7 +629,7 @@ def UpdateChangeLog(pkgdir, user, msg, skel_path, category, package,
# check modified files and the ChangeLog for copyright updates
# patches and diffs (identified by .patch and .diff) are excluded
- for fn in new + changed:
+ for fn in chain(new, changed):
if fn.endswith('.diff') or fn.endswith('.patch'):
continue
update_copyright(os.path.join(pkgdir, fn), year, pretend)
@@ -711,14 +711,13 @@ def UpdateChangeLog(pkgdir, user, msg, skel_path, category, package,
if not (display_new or display_removed or display_changed):
# If there's nothing else to display, show one of the
# trivial files.
- if 'ChangeLog' in new:
- display_new = ['+ChangeLog']
- elif 'ChangeLog' in changed:
- display_changed = ['ChangeLog']
- elif 'Manifest' in new:
- display_new = ['+Manifest']
- elif 'Manifest' in changed:
- display_changed = ['Manifest']
+ for fn in trivial_files:
+ if fn in new:
+ display_new = ['+' + fn]
+ break
+ elif fn in changed:
+ display_changed = [fn]
+ break
mesg = '%s; %s %s:' % (date, user, ', '.join(chain(
display_new, display_removed, display_changed)))
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-21 1:27 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-21 1:27 UTC (permalink / raw
To: gentoo-commits
commit: 706abe8ec2e633432d41dfb6553fee3c9604b886
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 21 01:26:05 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 21 01:26:05 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=706abe8e
UpdateChangeLog: handle edge cases
This should handle all kinds of variance in the input ChangeLog and
skel.ChangeLog.
---
pym/repoman/utilities.py | 38 ++++++++++++++++++++++++++++----------
1 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 325ade5..c1a9da8 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -632,6 +632,7 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, \
cl_path = os.path.join(pkgdir, 'ChangeLog')
clold_lines = []
clnew_lines = []
+ old_header_lines = []
header_lines = []
try:
@@ -661,15 +662,17 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, \
if clold_file is not None:
# retain header from old ChangeLog
for line in clold_file:
- line_strip = line.strip()
- clold_lines.append(line)
- if line_strip[:1] != '#':
+ line_strip = line.strip()
+ if line_strip and line[:1] != "#":
+ clold_lines.append(line)
break
- line = re.sub(r'^(# Copyright \d\d\d\d)-\d\d\d\d',
- r'\1-%s' % year, line)
- clnew_lines.append(line)
+ old_header_lines.append(line)
+ header_lines.append(
+ re.sub(r'^(# Copyright \d\d\d\d)-\d\d\d\d ',
+ r'\1-%s ' % year, line))
if not line_strip:
break
+
elif clskel_file is not None:
# read skel.ChangeLog up to first empty line
for line in clskel_file:
@@ -680,11 +683,12 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, \
line = line.replace('<PACKAGE_NAME>', package)
line = re.sub(r'^(# Copyright \d\d\d\d)-\d\d\d\d ',
r'\1-%s ' % year, line)
- clnew_lines.append(line)
- clnew_lines.append(_unicode_decode('\n'))
+ header_lines.append(line)
+ header_lines.append(_unicode_decode('\n'))
clskel_file.close()
# write new ChangeLog entry
+ clnew_lines.extend(header_lines)
newebuild = False
for fn in new:
if not fn.endswith('.ebuild'):
@@ -733,8 +737,22 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, \
if clold_file is not None:
# clold_lines may contain a saved non-header line
# that we want to write first.
- if clold_lines and clold_lines[-1].strip():
- f.write(clold_lines[-1])
+ # Also, append this line to clnew_lines so that the
+ # unified_diff call doesn't show it as removed.
+ for line in clold_lines:
+ f.write(line)
+ clnew_lines.append(line)
+
+ # Now prepend old_header_lines to clold_lines, for use
+ # in the unified_diff call below.
+ clold_lines = old_header_lines + clold_lines
+
+ # ensure that there is no more than one blank
+ # line after our new entry
+ for line in clold_file:
+ if line.strip():
+ f.write(line)
+ break
for line in clold_file:
f.write(line)
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-20 21:51 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-20 21:51 UTC (permalink / raw
To: gentoo-commits
commit: abff80f965637c23582d8f7c08da379b01555c43
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 20 21:51:05 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 20 21:51:05 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=abff80f9
UpdateChangeLog: don't hardcode 1999 copyright
We want repoman to be applicable to as many repositories as possible.
If necessary, we can add another layout.conf attribute that configures
the copyright start years for all files.
---
pym/repoman/utilities.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index ba34407..325ade5 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -665,8 +665,8 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, \
clold_lines.append(line)
if line_strip[:1] != '#':
break
- line = re.sub(r'^(# Copyright) \d\d\d\d-\d\d\d\d',
- r'\1 1999-%s' % year, line)
+ line = re.sub(r'^(# Copyright \d\d\d\d)-\d\d\d\d',
+ r'\1-%s' % year, line)
clnew_lines.append(line)
if not line_strip:
break
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-20 21:29 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-20 21:29 UTC (permalink / raw
To: gentoo-commits
commit: fa0374f86b3aa1ba52bbb200195fd7b8b7754245
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 20 21:29:23 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 20 21:29:23 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fa0374f8
update_copyright: remove stray semicolon
---
pym/repoman/utilities.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 7f7d62a..ba34407 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -571,7 +571,7 @@ def update_copyright(fn_path, year, pretend):
f = io.open(f, mode='w', encoding=_encodings['repo.content'],
errors='backslashreplace')
for line in new_header:
- f.write(line);
+ f.write(line)
for line in fn_hdl:
f.write(line)
f.close()
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-20 21:26 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-20 21:26 UTC (permalink / raw
To: gentoo-commits
commit: 8dfd8582e31a17c3adda9cba0f41545620289e5a
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 20 21:26:26 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 20 21:26:26 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8dfd8582
update_copyright: don't hardcode 1999 start year
We want repoman to be applicable to as many repositories as possible.
If necessary, we can add another layout.conf attribute that configures
the copyright start years for all files.
---
pym/repoman/utilities.py | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index a3fdf12..7f7d62a 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -548,12 +548,13 @@ def update_copyright(fn_path, year, pretend):
new_header.append(line)
break
- # these two regexes are taken from
- # echangelog update_copyright()
+ # These two regexes are taken from echangelog
+ # update_copyright(), except that we don't hardcode
+ # 1999 here (in order to be more generic).
line = re.sub(r'^(# Copyright \d+) ',
r'\1-%s ' % year, line)
- line = re.sub(r'^(# Copyright) \d\d\d\d-\d\d\d\d',
- r'\1 1999-%s' % year, line)
+ line = re.sub(r'^(# Copyright \d\d\d\d)-\d\d\d\d',
+ r'\1-%s' % year, line)
new_header.append(line)
difflines = 0
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-20 20:40 Fabian Groffen
0 siblings, 0 replies; 123+ messages in thread
From: Fabian Groffen @ 2011-10-20 20:40 UTC (permalink / raw
To: gentoo-commits
commit: ba8396c5e6bc9a979df46f7b8d209f89f2a89a14
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 20 20:38:00 2011 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Oct 20 20:38:00 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ba8396c5
repoman: update copyright on modified files
To retain the behaviour of echangelog, update the copyrights on modified
files (mostly ebuilds) when necessary. Also update the ChangeLog's
copyright.
---
pym/repoman/utilities.py | 91 +++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 85 insertions(+), 6 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 0eeea8b..3195136 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -523,9 +523,77 @@ def FindVCS():
return outvcs
+def update_copyright(fn_path, year, pretend):
+ """
+ Check file for a Copyright statement, and update its year. The
+ patterns used for replacing copyrights are taken from echangelog.
+ Only the first lines of each file that start with a hash ('#') are
+ considered, until a line is found that doesn't start with a hash.
+ """
+
+ try:
+ fn_hdl = io.open(_unicode_encode(fn_path,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['repo.content'], errors='replace')
+ except EnvironmentError:
+ return
+
+ orig_header = []
+ new_header = []
+
+ for line in fn_hdl:
+ line_strip = line.strip()
+ orig_header.append(line)
+ if not line_strip or line_strip[:1] != '#':
+ new_header.append(line)
+ break
+
+ # these two regexes are taken from
+ # echangelog update_copyright()
+ line = re.sub(r'^(# Copyright \d+) ',
+ r'\1-%s ' % year, line)
+ line = re.sub(r'^(# Copyright) \d\d\d\d-\d\d\d\d',
+ r'\1 1999-%s' % year, line)
+ new_header.append(line)
+
+ difflines = 0
+ for line in difflib.unified_diff(orig_header, new_header,
+ fromfile=fn_path, tofile=fn_path, n=0):
+ util.writemsg_stdout(line, noiselevel=-1)
+ difflines += 1
+ util.writemsg_stdout("\n", noiselevel=-1)
+
+ # unified diff has three lines to start with
+ if difflines > 3 and not pretend:
+ # write new file with changed header
+ f, fnnew_path = mkstemp()
+ f = io.open(f, mode='w', encoding=_encodings['repo.content'],
+ errors='backslashreplace')
+ for line in new_header:
+ f.write(line);
+ for line in fn_hdl:
+ f.write(line)
+ f.close()
+ try:
+ fn_stat = os.stat(fn_path)
+ except OSError:
+ fn_stat = None
+
+ shutil.move(fnnew_path, fn_path)
+
+ if fn_stat is None:
+ util.apply_permissions(fn_path, mode=0o644)
+ else:
+ util.apply_stat_permissions(fn_path, fn_stat)
+ fn_hdl.close()
+
def UpdateChangeLog(pkgdir, category, package, new, removed, changed, \
msg, pretend, repodir):
- """ Write an entry to an existing ChangeLog, or create a new one. """
+ """
+ Write an entry to an existing ChangeLog, or create a new one.
+ Updates copyright year on changed files, and updates the header of
+ ChangeLog with the contents of skel.ChangeLog.
+ """
# figure out who to write as
if 'GENTOO_COMMITTER_NAME' in os.environ and \
@@ -548,6 +616,18 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, \
logging.critical(err)
return None
+ # ChangeLog times are in UTC
+ gmtime = time.gmtime()
+ year = time.strftime('%Y', gmtime)
+ date = time.strftime('%d %b %Y', gmtime)
+
+ # check modified files and the ChangeLog for copyright updates
+ # patches and diffs (identified by .patch and .diff) are excluded
+ for fn in new + changed:
+ if fn.endswith('.diff') or fn.endswith('.patch'):
+ continue
+ update_copyright(os.path.join(pkgdir, fn), year, pretend)
+
cl_path = os.path.join(pkgdir, 'ChangeLog')
clold_lines = []
clnew_lines = []
@@ -573,8 +653,6 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, \
except EnvironmentError:
pass
- # ChangeLog times are in UTC
- gmtime = time.gmtime()
f, clnew_path = mkstemp()
# construct correct header first
@@ -586,8 +664,9 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, \
clold_lines.append(line)
if line_strip[:1] != '#':
break
- if clskel_file is None:
- clnew_lines.append(line)
+ line = re.sub(r'^(# Copyright) \d\d\d\d-\d\d\d\d',
+ r'\1 1999-%s' % year, line)
+ clnew_lines.append(line)
if not line_strip:
break
elif clskel_file is not None:
@@ -599,7 +678,7 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, \
line = line.replace('<CATEGORY>', category)
line = line.replace('<PACKAGE_NAME>', package)
line = re.sub(r'^(# Copyright \d\d\d\d)-\d\d\d\d ',
- r'\1-%s ' % time.strftime('%Y', gmtime), line)
+ r'\1-%s ' % year, line)
clnew_lines.append(line)
clnew_lines.append(_unicode_decode('\n'))
clskel_file.close()
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-20 20:40 Fabian Groffen
0 siblings, 0 replies; 123+ messages in thread
From: Fabian Groffen @ 2011-10-20 20:40 UTC (permalink / raw
To: gentoo-commits
commit: db3e214be456864225eecb37a9c941fd1689bee0
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 20 20:39:38 2011 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Oct 20 20:39:38 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=db3e214b
UpdateChangeLog: fix whitespace
---
pym/repoman/utilities.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 3195136..a3fdf12 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -616,8 +616,8 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, \
logging.critical(err)
return None
- # ChangeLog times are in UTC
- gmtime = time.gmtime()
+ # ChangeLog times are in UTC
+ gmtime = time.gmtime()
year = time.strftime('%Y', gmtime)
date = time.strftime('%d %b %Y', gmtime)
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-20 19:11 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-20 19:11 UTC (permalink / raw
To: gentoo-commits
commit: 0f261405f63cd09639728da78e70a254cd3c5320
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 20 19:10:50 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 20 19:10:50 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0f261405
UpdateChangeLog: time in UTC
---
pym/repoman/utilities.py | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 588ca8d..c8cbba7 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -560,6 +560,8 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, msg, prete
except EnvironmentError:
clold_file = None
+ # ChangeLog times are in UTC
+ gmtime = time.gmtime()
f, clnew_path = mkstemp()
# create an empty ChangeLog.new with correct header first
@@ -570,7 +572,7 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, msg, prete
if clold_file is None:
header_lines.append(_unicode_decode('# ChangeLog for %s/%s\n' %
(category, package)))
- year = time.strftime('%Y')
+ year = time.strftime('%Y', gmtime)
header_lines.append(_unicode_decode('# Copyright 1999-'
'%s Gentoo Foundation; Distributed under the GPL v2\n' % year))
header_lines.append(_unicode_decode('# $Header: $\n'))
@@ -589,11 +591,11 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, msg, prete
old_header_lines = header_lines[:]
if len(header_lines) >= 2:
header_lines[1] = re.sub(r'^(# Copyright \d\d\d\d)-\d\d\d\d ',
- r'\1-%s ' % time.strftime('%Y'), header_lines[1])
+ r'\1-%s ' % time.strftime('%Y', gmtime), header_lines[1])
# write new ChangeLog entry
clnew_lines.extend(header_lines)
- date = time.strftime('%d %b %Y')
+ date = time.strftime('%d %b %Y', gmtime)
newebuild = False
for fn in new:
if not fn.endswith('.ebuild'):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-17 15:53 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-17 15:53 UTC (permalink / raw
To: gentoo-commits
commit: 85256ed31e67655530dc26a4a036bfda963e9722
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 17 15:53:29 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 17 15:53:29 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=85256ed3
UpdateChangeLog: use struct_passwd attributes
---
pym/repoman/utilities.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index e068749..588ca8d 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -538,9 +538,9 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, msg, prete
elif 'ECHANGELOG_USER' in os.environ:
user = os.environ['ECHANGELOG_USER']
else:
- (login, _, _, _, gecos, _, _) = pwd.getpwuid(os.getuid())
- gecos = gecos.split(',')[0] # bug #80011
- user = '%s <%s@gentoo.org>' % (gecos, login)
+ pwd_struct = pwd.getpwuid(os.getuid())
+ gecos = pwd_struct.pw_gecos.split(',')[0] # bug #80011
+ user = '%s <%s@gentoo.org>' % (gecos, pwd_struct.pw_name)
if '<root@' in user:
err = 'Please set ECHANGELOG_USER or run as non-root'
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-17 3:47 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-17 3:47 UTC (permalink / raw
To: gentoo-commits
commit: 630ea9d916bd6e09a1af6414ae7fbe83ecd2331f
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 17 03:45:10 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 17 03:45:10 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=630ea9d9
UpdateChangeLog: show trivial if nothing else
Like echangelog does, show ChangeLog or Manifest if there are no other
changes to display.
---
pym/repoman/utilities.py | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index e4fc1a4..e068749 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -603,11 +603,26 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, msg, prete
newebuild = True
if newebuild:
clnew_lines.append(_unicode_decode('\n'))
- new = ['+' + elem for elem in new if elem not in ['ChangeLog', 'Manifest']]
- removed = ['-' + elem for elem in removed]
- changed = [elem for elem in changed if elem not in ['ChangeLog', 'Manifest']]
- mesg = '%s; %s %s:' % (date, user, \
- ', '.join(chain(new,removed,changed)))
+ trivial_files = ('ChangeLog', 'Manifest')
+ display_new = ['+' + elem for elem in new
+ if elem not in trivial_files]
+ display_removed = ['-' + elem for elem in removed]
+ display_changed = [elem for elem in changed
+ if elem not in trivial_files]
+ if not (display_new or display_removed or display_changed):
+ # If there's nothing else to display, show one of the
+ # trivial files.
+ if 'ChangeLog' in new:
+ display_new = ['+ChangeLog']
+ elif 'ChangeLog' in changed:
+ display_changed = ['ChangeLog']
+ elif 'Manifest' in new:
+ display_new = ['+Manifest']
+ elif 'Manifest' in changed:
+ display_changed = ['Manifest']
+
+ mesg = '%s; %s %s:' % (date, user, ', '.join(chain(
+ display_new, display_removed, display_changed)))
for line in textwrap.wrap(mesg, 80, \
initial_indent=' ', subsequent_indent=' ', \
break_on_hyphens=False):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-17 1:11 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-17 1:11 UTC (permalink / raw
To: gentoo-commits
commit: 190a8a577934755ff07f9bc58f0b87a65c7f0738
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 17 01:11:22 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 17 01:11:22 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=190a8a57
UpdateChangeLog: update copyright year in header
This feature got dropped on commit
b655137b7b5f87c11a7e742b7ef0e028a1139677.
---
pym/repoman/utilities.py | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 5b9eaf7..e4fc1a4 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -28,6 +28,7 @@ import io
from itertools import chain
import logging
import pwd
+import re
import sys
import time
import textwrap
@@ -549,6 +550,7 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, msg, prete
cl_path = os.path.join(pkgdir, 'ChangeLog')
clold_lines = []
clnew_lines = []
+ old_header_lines = []
header_lines = []
try:
@@ -583,6 +585,12 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, msg, prete
if not line_strip:
break
+ # update the copyright year
+ old_header_lines = header_lines[:]
+ if len(header_lines) >= 2:
+ header_lines[1] = re.sub(r'^(# Copyright \d\d\d\d)-\d\d\d\d ',
+ r'\1-%s ' % time.strftime('%Y'), header_lines[1])
+
# write new ChangeLog entry
clnew_lines.extend(header_lines)
date = time.strftime('%d %b %Y')
@@ -620,9 +628,9 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, msg, prete
for line in clold_lines:
f.write(line)
- # Now prepend header_lines to clold_lines, for use
+ # Now prepend old_header_lines to clold_lines, for use
# in the unified_diff call below.
- clold_lines = header_lines + clold_lines
+ clold_lines = old_header_lines + clold_lines
for line in clold_file:
f.write(line)
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-17 0:14 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-10-17 0:14 UTC (permalink / raw
To: gentoo-commits
commit: b655137b7b5f87c11a7e742b7ef0e028a1139677
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 17 00:11:08 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 17 00:11:08 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b655137b
UpdateChangeLog: optimize and add unicode support
Also:
* copy the old header from the old ChangeLog if it exists, in case it
contains a non-gentoo header
* don't add a header if the old ChangeLog exists and doesn't contain
a header
---
pym/repoman/utilities.py | 102 +++++++++++++++++++++++++++++++--------------
1 files changed, 70 insertions(+), 32 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 8f7d5d5..5b9eaf7 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -547,28 +547,54 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, msg, prete
return None
cl_path = os.path.join(pkgdir, 'ChangeLog')
+ clold_lines = []
+ clnew_lines = []
+ header_lines = []
+
+ try:
+ clold_file = io.open(_unicode_encode(cl_path,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['repo.content'], errors='replace')
+ except EnvironmentError:
+ clold_file = None
+
f, clnew_path = mkstemp()
# create an empty ChangeLog.new with correct header first
try:
- f = os.fdopen(f, 'w+')
- f.write('# ChangeLog for %s/%s\n' % (category, package))
- year = time.strftime('%Y')
- f.write('# Copyright 1999-%s Gentoo Foundation; Distributed under the GPL v2\n' % year)
- f.write('# $Header: $\n')
- f.write('\n')
+ f = io.open(f, mode='w', encoding=_encodings['repo.content'],
+ errors='backslashreplace')
+
+ if clold_file is None:
+ header_lines.append(_unicode_decode('# ChangeLog for %s/%s\n' %
+ (category, package)))
+ year = time.strftime('%Y')
+ header_lines.append(_unicode_decode('# Copyright 1999-'
+ '%s Gentoo Foundation; Distributed under the GPL v2\n' % year))
+ header_lines.append(_unicode_decode('# $Header: $\n'))
+ header_lines.append(_unicode_decode('\n'))
+ else:
+ for line in clold_file:
+ line_strip = line.strip()
+ if line_strip and line[:1] != "#":
+ clold_lines.append(line)
+ break
+ header_lines.append(line)
+ if not line_strip:
+ break
# write new ChangeLog entry
+ clnew_lines.extend(header_lines)
date = time.strftime('%d %b %Y')
newebuild = False
for fn in new:
if not fn.endswith('.ebuild'):
continue
ebuild = fn.split(os.sep)[-1][0:-7]
- f.write('*%s (%s)\n' % (ebuild, date))
+ clnew_lines.append(_unicode_decode('*%s (%s)\n' % (ebuild, date)))
newebuild = True
if newebuild:
- f.write('\n')
+ clnew_lines.append(_unicode_decode('\n'))
new = ['+' + elem for elem in new if elem not in ['ChangeLog', 'Manifest']]
removed = ['-' + elem for elem in removed]
changed = [elem for elem in changed if elem not in ['ChangeLog', 'Manifest']]
@@ -577,45 +603,57 @@ def UpdateChangeLog(pkgdir, category, package, new, removed, changed, msg, prete
for line in textwrap.wrap(mesg, 80, \
initial_indent=' ', subsequent_indent=' ', \
break_on_hyphens=False):
- f.write('%s\n' % line)
+ clnew_lines.append(_unicode_decode('%s\n' % line))
for line in textwrap.wrap(msg, 80, \
initial_indent=' ', subsequent_indent=' '):
- f.write('%s\n' % line)
+ clnew_lines.append(_unicode_decode('%s\n' % line))
+ clnew_lines.append(_unicode_decode('\n'))
+
+ for line in clnew_lines:
+ f.write(line)
# append stuff from old ChangeLog
- cl_lines = []
- if os.path.exists(cl_path):
- c = open(cl_path, 'r')
- cl_lines = c.readlines()
- for index, line in enumerate(cl_lines):
- # skip the headers
- if line.startswith('#'):
- # normalise to $Header: $ to avoid pointless diff line
- if line.startswith('# $Header:'):
- cl_lines[index] = '# $Header: $\n'
- continue
+ if clold_file is not None:
+ # If the old ChangeLog didn't have a header, then
+ # clold_lines may contain a saved non-header line
+ # that we want to write first.
+ for line in clold_lines:
f.write(line)
- c.close()
- # show diff (do we want to keep on doing this, or only when
- # pretend?)
- f.seek(0)
- clnew_lines = f.readlines()
- for line in difflib.unified_diff(cl_lines, clnew_lines, \
- fromfile=cl_path, tofile=cl_path + '.new', n=0):
- print(line.rstrip())
- print()
+ # Now prepend header_lines to clold_lines, for use
+ # in the unified_diff call below.
+ clold_lines = header_lines + clold_lines
+ for line in clold_file:
+ f.write(line)
+ clold_file.close()
f.close()
+ # show diff (do we want to keep on doing this, or only when
+ # pretend?)
+ for line in difflib.unified_diff(clold_lines, clnew_lines,
+ fromfile=cl_path, tofile=cl_path + '.new', n=0):
+ util.writemsg_stdout(line, noiselevel=-1)
+ util.writemsg_stdout("\n", noiselevel=-1)
+
if pretend:
# remove what we've done
os.remove(clnew_path)
else:
- # rename ChangeLog.new to ChangeLog
+ # rename ChangeLog.new to ChangeLog, and set permissions
+ try:
+ clold_stat = os.stat(cl_path)
+ except OSError:
+ clold_stat = None
+
shutil.move(clnew_path, cl_path)
- if cl_lines == []:
+ if clold_stat is None:
+ util.apply_permissions(cl_path, mode=0o644)
+ else:
+ util.apply_stat_permissions(cl_path, clold_stat)
+
+ if clold_file is None:
return True
else:
return False
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-10-15 12:42 Fabian Groffen
0 siblings, 0 replies; 123+ messages in thread
From: Fabian Groffen @ 2011-10-15 12:42 UTC (permalink / raw
To: gentoo-commits
commit: 513445d8e36db3cc2c03e4c6ed3c357e0d6f15b6
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 12:41:13 2011 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 12:41:13 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=513445d8
FindVCS: support Subversion 1.7
Since subversion 1.7, only a top-level .svn dir is used. Make FindVCS
also deal with that. (Tested with repoman on Prefix SVN-based tree.)
---
pym/repoman/utilities.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 380f8ed..7913703 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -472,7 +472,7 @@ def FindVCS():
outvcs = []
def seek(depth = None):
- """ Seek for distributed VCSes. """
+ """ Seek for VCSes that have a top-level data directory only. """
retvcs = []
pathprep = ''
@@ -483,6 +483,8 @@ def FindVCS():
retvcs.append('bzr')
if os.path.isdir(os.path.join(pathprep, '.hg')):
retvcs.append('hg')
+ if os.path.isdir(os.path.join(pathprep, '.svn')): # >=1.7
+ retvcs.append('svn')
if retvcs:
break
@@ -497,7 +499,7 @@ def FindVCS():
# Level zero VCS-es.
if os.path.isdir('CVS'):
outvcs.append('cvs')
- if os.path.isdir('.svn'):
+ if os.path.isdir('.svn'): # <1.7
outvcs.append('svn')
# If we already found one of 'level zeros', just take a quick look
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-09-24 19:30 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-09-24 19:30 UTC (permalink / raw
To: gentoo-commits
commit: f4aaee6edd75b16ccbdd7bafe0e0288886a0113a
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 23 09:15:35 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 24 19:28:00 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f4aaee6e
Invalidate 'no-herd', there will be no special herds.
---
pym/repoman/herdbase.py | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/pym/repoman/herdbase.py b/pym/repoman/herdbase.py
index 64b59e6..8ce36a7 100644
--- a/pym/repoman/herdbase.py
+++ b/pym/repoman/herdbase.py
@@ -19,8 +19,6 @@ __all__ = [
"make_herd_base"
]
-_SPECIAL_HERDS = set(('no-herd',))
-
def _make_email(nick_name):
if not nick_name.endswith('@gentoo.org'):
nick_name = nick_name + '@gentoo.org'
@@ -33,8 +31,6 @@ class HerdBase(object):
self.all_emails = all_emails
def known_herd(self, herd_name):
- if herd_name in _SPECIAL_HERDS:
- return True
return herd_name in self.herd_to_emails
def known_maintainer(self, nick_name):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-09-10 19:40 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-09-10 19:40 UTC (permalink / raw
To: gentoo-commits
commit: 9f58b6e47090766454af1106806d08391772b13b
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 10 18:13:45 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 10 19:40:09 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9f58b6e4
Add repoman warning about bash-completion deprecation.
---
pym/repoman/checks.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index bff4b1f..cdcc8bc 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -384,6 +384,7 @@ class InheritDeprecated(LineCheck):
# deprecated eclass : new eclass (False if no new eclass)
deprecated_classes = {
+ "bash-completion": "bash-completion-r1",
"gems": "ruby-fakegem",
"git": "git-2",
"mozconfig-2": "mozconfig-3",
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-08-30 16:26 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-08-30 16:26 UTC (permalink / raw
To: gentoo-commits
commit: 41f12443efdab544ace9f2c90df516360ebf9df1
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 30 10:12:50 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Aug 30 16:25:54 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=41f12443
repoman: discard STDERR output from CVS.
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=373669
---
pym/repoman/utilities.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 232739e..380f8ed 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -60,7 +60,7 @@ def detect_vcs_conflicts(options, vcs):
if vcs == 'cvs':
logging.info("Performing a " + output.green("cvs -n up") + \
" with a little magic grep to check for updates.")
- retval = subprocess_getstatusoutput("cvs -n up 2>&1 | " + \
+ retval = subprocess_getstatusoutput("cvs -n up 2>/dev/null | " + \
"egrep '^[^\?] .*' | " + \
"egrep -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'")
if vcs == 'svn':
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-08-09 6:44 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-08-09 6:44 UTC (permalink / raw
To: gentoo-commits
commit: 022e09dd6ddd8372a9ec2ef2284b7cb174e6e6b2
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 9 06:44:17 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Aug 9 06:44:17 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=022e09dd
repoman: check more helper calls for $D, $ED...
This adds docinto, docompress, fowners and fperms to the
variable.usedwithhelpers check. Notably absent is dosed since that
supports mixed input. This will fix bug #377303.
---
pym/repoman/checks.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index e7472df..bff4b1f 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -341,7 +341,7 @@ class NoOffsetWithHelpers(LineCheck):
repoman_check_name = 'variable.usedwithhelpers'
# Ignore matches in quoted strings like this:
# elog "installed into ${ROOT}usr/share/php5/apc/."
- re = re.compile(r'^[^#"\']*\b(dodir|dohard|exeinto|insinto|into)\s+"?\$\{?(D|ROOT|ED|EROOT|EPREFIX)\b.*')
+ re = re.compile(r'^[^#"\']*\b(docinto|docompress|dodir|dohard|exeinto|fowners|fperms|insinto|into)\s+"?\$\{?(D|ROOT|ED|EROOT|EPREFIX)\b.*')
error = errors.NO_OFFSET_WITH_HELPERS
class ImplicitRuntimeDeps(LineCheck):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-07-08 8:08 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-07-08 8:08 UTC (permalink / raw
To: gentoo-commits
commit: 8f80a4d52bbc05200f51ca659a4fe574f80fdc49
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 8 08:07:51 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jul 8 08:07:51 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8f80a4d5
repoman: tighten regex for useq and hasq
---
pym/repoman/checks.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 58ac20d..e7472df 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -587,19 +587,19 @@ class SrcUnpackPatches(PhaseCheck):
class BuiltWithUse(LineCheck):
repoman_check_name = 'ebuild.minorsyn'
- re = re.compile('^.*built_with_use')
+ re = re.compile(r'(^|.*\b)built_with_use\b')
error = errors.BUILT_WITH_USE
class DeprecatedUseq(LineCheck):
"""Checks for use of the deprecated useq function"""
repoman_check_name = 'ebuild.minorsyn'
- re = re.compile('^.*useq')
+ re = re.compile(r'(^|.*\b)useq\b')
error = errors.USEQ_ERROR
class DeprecatedHasq(LineCheck):
"""Checks for use of the deprecated hasq function"""
repoman_check_name = 'ebuild.minorsyn'
- re = re.compile('^.*hasq')
+ re = re.compile(r'(^|.*\b)hasq\b')
error = errors.HASQ_ERROR
# EAPI-3 checks
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-07-08 7:47 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-07-08 7:47 UTC (permalink / raw
To: gentoo-commits
commit: caf6e68cc5fd175a52610bebdec7d354cc7b714a
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 8 07:47:31 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jul 8 07:47:31 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=caf6e68c
repoman: centralize code for ignoring comments
---
pym/repoman/checks.py | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index fabf0b3..58ac20d 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -16,6 +16,9 @@ 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
@@ -35,7 +38,6 @@ class LineCheck(object):
class PhaseCheck(LineCheck):
""" basic class for function detection """
- ignore_line = re.compile(r'(^\s*#)')
func_end_re = re.compile(r'^\}$')
phases_re = re.compile('(%s)' % '|'.join((
'pkg_pretend', 'pkg_setup', 'src_unpack', 'src_prepare',
@@ -103,6 +105,7 @@ class EbuildWhitespace(LineCheck):
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]$)')
@@ -114,6 +117,7 @@ class EbuildWhitespace(LineCheck):
class EbuildBlankLine(LineCheck):
repoman_check_name = 'ebuild.minorsyn'
+ ignore_comment = False
blank_line = re.compile(r'^$')
def new(self, pkg):
@@ -142,6 +146,7 @@ class EbuildQuote(LineCheck):
_ignored_commands = ["local", "export"] + _message_commands
ignore_line = re.compile(r'(^$)|(^\s*#.*)|(^\s*\w+=.*)' + \
r'|(^\s*(' + "|".join(_ignored_commands) + r')\s+)')
+ ignore_comment = False
var_names = ["D", "DISTDIR", "FILESDIR", "S", "T", "ROOT", "WORKDIR"]
# EAPI=3/Prefix vars
@@ -215,6 +220,7 @@ class EbuildAssignment(LineCheck):
readonly_assignment = re.compile(r'^\s*(export\s+)?(A|CATEGORY|P|PV|PN|PR|PVR|PF|D|WORKDIR|FILESDIR|FEATURES|USE)=')
line_continuation = re.compile(r'([^#]*\S)(\s+|\t)\\$')
ignore_line = re.compile(r'(^$)|(^(\t)*#)')
+ ignore_comment = False
def __init__(self):
self.previous_line = None
@@ -448,7 +454,6 @@ class InheritAutotools(LineCheck):
"""
repoman_check_name = 'inherit.autotools'
- ignore_line = re.compile(r'(^|\s*)#')
_inherit_autotools_re = re.compile(r'^\s*inherit\s(.*\s)?autotools(\s|$)')
_autotools_funcs = (
"eaclocal", "eautoconf", "eautoheader",
@@ -582,7 +587,6 @@ class SrcUnpackPatches(PhaseCheck):
class BuiltWithUse(LineCheck):
repoman_check_name = 'ebuild.minorsyn'
- ignore_line = re.compile(r'^\s*#')
re = re.compile('^.*built_with_use')
error = errors.BUILT_WITH_USE
@@ -601,7 +605,6 @@ class DeprecatedHasq(LineCheck):
# EAPI-3 checks
class Eapi3DeprecatedFuncs(LineCheck):
repoman_check_name = 'EAPI.deprecated'
- ignore_line = re.compile(r'(^\s*#)')
deprecated_commands_re = re.compile(r'^\s*(check_license)\b')
def check_eapi(self, eapi):
@@ -616,7 +619,6 @@ class Eapi3DeprecatedFuncs(LineCheck):
# EAPI-4 checks
class Eapi4IncompatibleFuncs(LineCheck):
repoman_check_name = 'EAPI.incompatible'
- ignore_line = re.compile(r'(^\s*#)')
banned_commands_re = re.compile(r'^\s*(dosed|dohard)')
def check_eapi(self, eapi):
@@ -630,7 +632,6 @@ class Eapi4IncompatibleFuncs(LineCheck):
class Eapi4GoneVars(LineCheck):
repoman_check_name = 'EAPI.incompatible'
- ignore_line = re.compile(r'(^\s*#)')
undefined_vars_re = re.compile(r'.*\$(\{(AA|KV|EMERGE_FROM)\}|(AA|KV|EMERGE_FROM))')
def check_eapi(self, eapi):
@@ -667,6 +668,7 @@ _constant_checks = tuple((c() for c in (
DeprecatedUseq, DeprecatedHasq)))
_here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$')
+_ignore_comment_re = re.compile(r'^\s*#')
def run_checks(contents, pkg):
checks = _constant_checks
@@ -687,7 +689,10 @@ def run_checks(contents, pkg):
if here_doc_delim is None:
# We're not in a here-document.
+ is_comment = _ignore_comment_re.match(line) is not None
for lc in checks:
+ if is_comment and lc.ignore_comment:
+ continue
if lc.check_eapi(pkg.metadata['EAPI']):
ignore = lc.ignore_line
if not ignore or not ignore.match(line):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-07-08 7:13 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-07-08 7:13 UTC (permalink / raw
To: gentoo-commits
commit: de32b0d92ee28965c137bea637cddf6d8c0679c2
Author: Dane Smith <c1pher <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 8 07:12:33 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jul 8 07:12:33 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=de32b0d9
repoman: check for deprecated useq and hasq calls
---
pym/repoman/checks.py | 15 ++++++++++++++-
pym/repoman/errors.py | 2 ++
2 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index c9ada5f..fabf0b3 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -586,6 +586,18 @@ class BuiltWithUse(LineCheck):
re = re.compile('^.*built_with_use')
error = errors.BUILT_WITH_USE
+class DeprecatedUseq(LineCheck):
+ """Checks for use of the deprecated useq function"""
+ repoman_check_name = 'ebuild.minorsyn'
+ re = re.compile('^.*useq')
+ error = errors.USEQ_ERROR
+
+class DeprecatedHasq(LineCheck):
+ """Checks for use of the deprecated hasq function"""
+ repoman_check_name = 'ebuild.minorsyn'
+ re = re.compile('^.*hasq')
+ error = errors.HASQ_ERROR
+
# EAPI-3 checks
class Eapi3DeprecatedFuncs(LineCheck):
repoman_check_name = 'EAPI.deprecated'
@@ -651,7 +663,8 @@ _constant_checks = tuple((c() for c in (
DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue,
SrcCompileEconf, Eapi3DeprecatedFuncs, NoOffsetWithHelpers,
Eapi4IncompatibleFuncs, Eapi4GoneVars, BuiltWithUse,
- PreserveOldLib, SandboxAddpredict, PortageInternal)))
+ PreserveOldLib, SandboxAddpredict, PortageInternal,
+ DeprecatedUseq, DeprecatedHasq)))
_here_doc_re = re.compile(r'.*\s<<[-]?(\w+)$')
diff --git a/pym/repoman/errors.py b/pym/repoman/errors.py
index a19e8c5..3209243 100644
--- a/pym/repoman/errors.py
+++ b/pym/repoman/errors.py
@@ -22,3 +22,5 @@ BUILT_WITH_USE = 'built_with_use on line: %d'
EPREFIXIFY_MISSING_INHERIT = "prefix.eclass is not inherited, but eprefixify is used 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'
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-05-31 22:25 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-05-31 22:25 UTC (permalink / raw
To: gentoo-commits
commit: 10f6c6d3c028a509ed943ef76633c72dbbcff7f6
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue May 31 22:22:02 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue May 31 22:22:02 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=10f6c6d3
repoman: disallow EMERGE_FROM in EAPI 4
We already have the Eapi4GoneVars check for AA and KV which were
removed in EAPI 4, so we can re-use it to disallow EMERGE_FROM.
This will fix bug #368865.
---
pym/repoman/checks.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index bc25cd5..c9ada5f 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -619,10 +619,11 @@ class Eapi4IncompatibleFuncs(LineCheck):
class Eapi4GoneVars(LineCheck):
repoman_check_name = 'EAPI.incompatible'
ignore_line = re.compile(r'(^\s*#)')
- undefined_vars_re = re.compile(r'.*\$(\{(AA|KV)\}|(AA|KV))')
+ undefined_vars_re = re.compile(r'.*\$(\{(AA|KV|EMERGE_FROM)\}|(AA|KV|EMERGE_FROM))')
def check_eapi(self, eapi):
- return not eapi_exports_AA(eapi) or not eapi_exports_KV(eapi)
+ # AA, KV, and EMERGE_FROM should not be referenced in EAPI 4 or later.
+ return not eapi_exports_AA(eapi)
def check(self, num, line):
m = self.undefined_vars_re.match(line)
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-04-20 23:58 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-04-20 23:58 UTC (permalink / raw
To: gentoo-commits
commit: 1bbcc74920400e6a0e0b4119ea905ac2f96aae1a
Author: Tomas Chvatal <scarabeus <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 20 23:56:06 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Apr 20 23:56:06 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1bbcc749
repoman: deprecate more eclasses
---
pym/repoman/checks.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 200b542..bc25cd5 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -379,6 +379,11 @@ class InheritDeprecated(LineCheck):
# deprecated eclass : new eclass (False if no new eclass)
deprecated_classes = {
"gems": "ruby-fakegem",
+ "git": "git-2",
+ "mozconfig-2": "mozconfig-3",
+ "mozcoreconf": "mozcoreconf-2",
+ "php-ext-pecl-r1": "php-ext-pecl-r2",
+ "php-ext-source-r1": "php-ext-source-r2",
"php-pear": "php-pear-r1",
"qt3": False,
"qt4": "qt4-r2",
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-02-28 20:39 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-02-28 20:39 UTC (permalink / raw
To: gentoo-commits
commit: afd70ceacf522efeb64ea0cbf4626c7533e2c021
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 28 20:37:22 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 28 20:37:22 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=afd70cea
repoman: variable.usedwithhelpers ignore quoted
---
pym/repoman/checks.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 566984a..200b542 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -333,7 +333,9 @@ class NoOffsetWithHelpers(LineCheck):
helpers """
repoman_check_name = 'variable.usedwithhelpers'
- re = re.compile(r'^[^#]*\b(dodir|dohard|exeinto|insinto|into)\s+"?\$\{?(D|ROOT|ED|EROOT|EPREFIX)\b.*')
+ # Ignore matches in quoted strings like this:
+ # elog "installed into ${ROOT}usr/share/php5/apc/."
+ re = re.compile(r'^[^#"\']*\b(dodir|dohard|exeinto|insinto|into)\s+"?\$\{?(D|ROOT|ED|EROOT|EPREFIX)\b.*')
error = errors.NO_OFFSET_WITH_HELPERS
class ImplicitRuntimeDeps(LineCheck):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-02-28 5:27 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-02-28 5:27 UTC (permalink / raw
To: gentoo-commits
commit: 1ba916f6aa4c82b4e0f74955b9146b8cbf65b859
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 28 05:27:02 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Feb 28 05:27:02 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1ba916f6
repoman: warn about calls to prepall and preplib
---
pym/repoman/checks.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index a05c128..566984a 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -625,7 +625,7 @@ class Eapi4GoneVars(LineCheck):
class PortageInternal(LineCheck):
repoman_check_name = 'portage.internal'
- re = re.compile(r'[^#]*\b(ecompress|ecompressdir|prepalldocs)\b')
+ re = re.compile(r'[^#]*\b(ecompress|ecompressdir|prepall|prepalldocs|preplib)\b')
def check(self, num, line):
"""Run the check on line and return error if there is one"""
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-02-19 23:49 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-02-19 23:49 UTC (permalink / raw
To: gentoo-commits
commit: 8126784f69d87792edc3b4249302602731783e95
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 19 23:49:13 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 19 23:49:13 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8126784f
repoman: variable.usedwithhelpers tighten regex
This will fix bug #355621.
---
pym/repoman/checks.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 8f61c07..5bf039b 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -333,7 +333,7 @@ class NoOffsetWithHelpers(LineCheck):
helpers """
repoman_check_name = 'variable.usedwithhelpers'
- re = re.compile(r'^[^#]*\b(dodir|dohard|exeinto|insinto|into)\s+"?\$\{?(D|ROOT|ED|EROOT|EPREFIX)\}?.*')
+ re = re.compile(r'^[^#]*\b(dodir|dohard|exeinto|insinto|into)\s+"?\$\{?(D|ROOT|ED|EROOT|EPREFIX)\b.*')
error = errors.NO_OFFSET_WITH_HELPERS
class ImplicitRuntimeDeps(LineCheck):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-02-13 7:52 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-02-13 7:52 UTC (permalink / raw
To: gentoo-commits
commit: 27eda93149cb1e731d5f29c2bb788d7aa181bc9f
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 13 07:50:08 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Feb 13 07:50:08 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=27eda931
repoman: variable.usedwithhelpers ignore comments
This will fix bug #354685.
---
pym/repoman/checks.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 7e5a8a1..8f61c07 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -333,7 +333,7 @@ class NoOffsetWithHelpers(LineCheck):
helpers """
repoman_check_name = 'variable.usedwithhelpers'
- re = re.compile(r'.*\b(dodir|dohard|exeinto|insinto|into)\s+"?\$\{?(D|ROOT|ED|EROOT|EPREFIX)\}?.*')
+ re = re.compile(r'^[^#]*\b(dodir|dohard|exeinto|insinto|into)\s+"?\$\{?(D|ROOT|ED|EROOT|EPREFIX)\}?.*')
error = errors.NO_OFFSET_WITH_HELPERS
class ImplicitRuntimeDeps(LineCheck):
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-02-05 0:58 Zac Medico
0 siblings, 0 replies; 123+ messages in thread
From: Zac Medico @ 2011-02-05 0:58 UTC (permalink / raw
To: gentoo-commits
commit: c202f11dc844edc8dea4ececc6ac8590af903cf0
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 5 00:56:14 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 5 00:56:14 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c202f11d
Revert "parse_metadata_use(): omit empty text tokens."
This reverts commit 52f6b55d51e2accaa446bc5d6920421959289baa.
Since split() never return empty tokens, this patch does nothing.
---
pym/repoman/utilities.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index ceb1ba1..9d4898e 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -157,8 +157,7 @@ def parse_metadata_use(xml_tree):
uselist[pkg_flag] = {}
# (flag_restrict can be None)
- uselist[pkg_flag][flag_restrict] = " ".join( \
- [x for x in "".join(inner_text).split() if x])
+ uselist[pkg_flag][flag_restrict] = " ".join("".join(inner_text).split())
return uselist
^ permalink raw reply related [flat|nested] 123+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/
@ 2011-02-04 5:02 zmedico
0 siblings, 0 replies; 123+ messages in thread
From: zmedico @ 2011-02-04 5:02 UTC (permalink / raw
To: gentoo-commits
commit: 52f6b55d51e2accaa446bc5d6920421959289baa
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 3 20:49:31 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 4 05:02:04 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=52f6b55d51e2accaa446bc5d6920421959289baa
parse_metadata_use(): omit empty text tokens.
---
pym/repoman/utilities.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index 9d4898e..ceb1ba1 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -157,7 +157,8 @@ def parse_metadata_use(xml_tree):
uselist[pkg_flag] = {}
# (flag_restrict can be None)
- uselist[pkg_flag][flag_restrict] = " ".join("".join(inner_text).split())
+ uselist[pkg_flag][flag_restrict] = " ".join( \
+ [x for x in "".join(inner_text).split() if x])
return uselist
^ permalink raw reply related [flat|nested] 123+ messages in thread
end of thread, other threads:[~2016-04-29 17:25 UTC | newest]
Thread overview: 123+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 22:39 [gentoo-commits] proj/portage:master commit in: pym/repoman/ Brian Dolbec
-- strict thread matches above, loose matches on Subject: below --
2016-04-29 17:24 Brian Dolbec
2016-04-29 17:24 Brian Dolbec
2016-04-29 17:24 Brian Dolbec
2016-04-29 17:24 Brian Dolbec
2016-04-28 15:05 [gentoo-commits] proj/portage:repoman " Brian Dolbec
2016-04-29 17:24 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2016-01-30 16:44 Brian Dolbec
2016-01-29 23:04 Brian Dolbec
2016-01-29 5:34 Brian Dolbec
2016-01-27 20:39 Brian Dolbec
2015-12-29 20:29 Zac Medico
2015-12-24 14:30 Brian Dolbec
2015-10-13 16:27 Michał Górny
2015-10-07 23:22 Brian Dolbec
2015-10-07 23:09 Brian Dolbec
2015-10-04 21:15 Brian Dolbec
2015-09-26 20:53 Brian Dolbec
2015-09-26 20:53 Brian Dolbec
2015-09-26 20:49 Brian Dolbec
2015-09-26 20:49 Brian Dolbec
2015-09-24 16:19 Brian Dolbec
2015-09-24 16:19 Brian Dolbec
2015-09-24 15:24 Brian Dolbec
2015-09-21 23:51 Brian Dolbec
2015-09-21 23:51 Brian Dolbec
2015-09-21 23:51 Brian Dolbec
2015-09-21 23:51 Brian Dolbec
2015-09-21 23:51 Brian Dolbec
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2015-09-21 23:47 [gentoo-commits] proj/portage:repoman " Brian Dolbec
2015-09-21 23:51 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2015-08-10 14:44 Michał Górny
2015-02-11 8:00 Michał Górny
2014-09-11 23:45 Brian Dolbec
2014-04-04 23:01 Brian Dolbec
2014-04-04 23:01 Brian Dolbec
2014-01-27 3:13 Chris Reffett
2013-08-08 17:33 Zac Medico
2013-05-24 19:00 Zac Medico
2013-04-22 21:08 Zac Medico
2013-03-19 16:50 Zac Medico
2013-03-15 3:30 Arfrever Frehtes Taifersar Arahesis
2013-03-14 17:18 Zac Medico
2013-02-11 9:50 Zac Medico
2013-01-19 19:11 Zac Medico
2013-01-01 23:40 Zac Medico
2013-01-01 23:23 Zac Medico
2012-12-15 20:08 Zac Medico
2012-11-22 22:12 Arfrever Frehtes Taifersar Arahesis
2012-11-22 21:53 Arfrever Frehtes Taifersar Arahesis
2012-11-22 21:51 Arfrever Frehtes Taifersar Arahesis
2012-10-31 14:11 Zac Medico
2012-10-08 14:17 Zac Medico
2012-09-12 4:56 Zac Medico
2012-09-10 21:07 Zac Medico
2012-09-10 5:52 Zac Medico
2012-09-10 5:46 Zac Medico
2012-06-21 1:02 Zac Medico
2012-06-09 2:03 Zac Medico
2012-06-08 2:52 Zac Medico
2012-06-04 4:06 Zac Medico
2012-06-04 3:25 Zac Medico
2012-06-02 6:24 Zac Medico
2012-06-02 6:24 Zac Medico
2012-06-02 5:14 Zac Medico
2012-06-01 3:32 Zac Medico
2012-06-01 2:23 Zac Medico
2012-05-31 22:27 Zac Medico
2012-05-31 0:59 Zac Medico
2012-05-30 23:56 Zac Medico
2012-05-30 23:20 Zac Medico
2012-05-25 16:18 Mike Frysinger
2012-04-23 20:18 Zac Medico
2012-04-23 20:16 Zac Medico
2012-04-23 20:08 Zac Medico
2012-04-22 23:01 Zac Medico
2012-04-22 22:58 Zac Medico
2012-04-22 22:53 Zac Medico
2012-03-05 0:01 Zac Medico
2012-02-15 0:04 Zac Medico
2012-02-12 23:32 Zac Medico
2011-10-26 18:13 Zac Medico
2011-10-21 8:11 Zac Medico
2011-10-21 7:38 Zac Medico
2011-10-21 7:20 Zac Medico
2011-10-21 7:06 Zac Medico
2011-10-21 4:53 Zac Medico
2011-10-21 1:27 Zac Medico
2011-10-20 21:51 Zac Medico
2011-10-20 21:29 Zac Medico
2011-10-20 21:26 Zac Medico
2011-10-20 20:40 Fabian Groffen
2011-10-20 20:40 Fabian Groffen
2011-10-20 19:11 Zac Medico
2011-10-17 15:53 Zac Medico
2011-10-17 3:47 Zac Medico
2011-10-17 1:11 Zac Medico
2011-10-17 0:14 Zac Medico
2011-10-15 12:42 Fabian Groffen
2011-09-24 19:30 Zac Medico
2011-09-10 19:40 Zac Medico
2011-08-30 16:26 Zac Medico
2011-08-09 6:44 Zac Medico
2011-07-08 8:08 Zac Medico
2011-07-08 7:47 Zac Medico
2011-07-08 7:13 Zac Medico
2011-05-31 22:25 Zac Medico
2011-04-20 23:58 Zac Medico
2011-02-28 20:39 Zac Medico
2011-02-28 5:27 Zac Medico
2011-02-19 23:49 Zac Medico
2011-02-13 7:52 Zac Medico
2011-02-05 0:58 Zac Medico
2011-02-04 5:02 zmedico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox