1 |
commit: 12fab561d3b63093805107cfcff4a425048db2aa |
2 |
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jun 26 15:16:37 2017 +0000 |
4 |
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 27 21:29:30 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=12fab561 |
7 |
|
8 |
repoman: Warn about dropped keywords only for latest in SLOT. |
9 |
|
10 |
Rationale: There is no point in rekeywording non-latest and nobody ever does that. |
11 |
Modified by: Brian Dolbec <dolsen <AT> gentoo.org> , shorten commit message, add missed docstring. |
12 |
|
13 |
For example: |
14 |
$ epkginfo texlive-latex |
15 |
* dev-texlive/texlive-latex [gentoo] |
16 |
Maintainer: aballier <AT> gentoo.org (Alexis Ballier) |
17 |
Maintainer: tex <AT> gentoo.org (Gentoo TeX Project) |
18 |
Upstream: None specified |
19 |
Homepage: http://www.tug.org/texlive/ |
20 |
Location: /mnt/dev/gentoo-x86/dev-texlive/texlive-latex |
21 |
Keywords: 2012:0: s390 sh sparc |
22 |
Keywords: 2015:0: hppa ppc ppc64 |
23 |
Keywords: 2016:0: alpha amd64 arm arm64 ia64 x86 |
24 |
Keywords: 2017:0: ~alpha ~amd64 ~amd64-fbsd ~amd64-linux ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc-macos ~ppc64 ~s390 ~sh ~sparc ~sparc-solaris ~x64-macos ~x64-solaris ~x86 ~x86-fbsd ~x86-linux ~x86-macos ~x86-solaris |
25 |
|
26 |
Before: |
27 |
RepoMan scours the neighborhood... |
28 |
KEYWORDS.dropped 3 |
29 |
dev-texlive/texlive-latex/texlive-latex-2014.ebuild: ia64 sparc |
30 |
dev-texlive/texlive-latex/texlive-latex-2015.ebuild: ia64 sparc |
31 |
dev-texlive/texlive-latex/texlive-latex-2016.ebuild: sparc |
32 |
repo.eapi.deprecated 1 |
33 |
dev-texlive/texlive-latex/texlive-latex-2012.ebuild: 4 |
34 |
|
35 |
After: |
36 |
RepoMan scours the neighborhood... |
37 |
repo.eapi.deprecated 1 |
38 |
dev-texlive/texlive-latex/texlive-latex-2012.ebuild: 4 |
39 |
|
40 |
Or also: |
41 |
$ epkginfo ffmpeg |
42 |
* media-video/ffmpeg [gentoo] |
43 |
Maintainer: media-video <AT> gentoo.org |
44 |
Upstream: None specified |
45 |
Homepage: http://ffmpeg.org/ |
46 |
Location: /mnt/dev/gentoo-x86/media-video/ffmpeg |
47 |
Keywords: 2.8.10:0/54.56.56: alpha amd64 arm hppa ia64 ppc ppc64 sparc x86 |
48 |
Keywords: 2.8.11:0/54.56.56: ~alpha ~amd64 ~amd64-fbsd ~amd64-linux ~arm ~arm-linux ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-linux |
49 |
Keywords: 3.2.4:0/55.57.57: alpha amd64 arm hppa ia64 ppc ppc64 x86 |
50 |
Keywords: 3.2.5:0/55.57.57: |
51 |
Keywords: 3.2.6:0/55.57.57: ~alpha ~ia64 |
52 |
Keywords: 3.3.2:0/55.57.57: ~amd64 ~amd64-fbsd ~amd64-linux ~arm ~arm-linux ~arm64 ~hppa ~mips ~ppc ~ppc-macos ~ppc64 ~x64-macos ~x64-solaris ~x86 ~x86-fbsd ~x86-linux ~x86-macos ~x86-solaris |
53 |
Keywords: 9999:0/55.57.57: |
54 |
|
55 |
Before: |
56 |
RepoMan scours the neighborhood... |
57 |
KEYWORDS.dropped 4 |
58 |
media-video/ffmpeg/ffmpeg-3.2.4.ebuild: sparc |
59 |
media-video/ffmpeg/ffmpeg-3.2.5.ebuild: sparc |
60 |
media-video/ffmpeg/ffmpeg-3.2.6.ebuild: sparc |
61 |
media-video/ffmpeg/ffmpeg-3.3.2.ebuild: alpha ia64 sparc |
62 |
|
63 |
After: |
64 |
RepoMan scours the neighborhood... |
65 |
KEYWORDS.dropped 1 |
66 |
media-video/ffmpeg/ffmpeg-3.3.2.ebuild: alpha ia64 sparc |
67 |
|
68 |
X-Gentoo-Bug: 256189 |
69 |
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=256189 |
70 |
|
71 |
.../pym/repoman/modules/scan/keywords/keywords.py | 26 +++++++++++++++++----- |
72 |
repoman/pym/repoman/scanner.py | 2 +- |
73 |
2 files changed, 22 insertions(+), 6 deletions(-) |
74 |
|
75 |
diff --git a/repoman/pym/repoman/modules/scan/keywords/keywords.py b/repoman/pym/repoman/modules/scan/keywords/keywords.py |
76 |
index 7cb2fe912..1e9623906 100644 |
77 |
--- a/repoman/pym/repoman/modules/scan/keywords/keywords.py |
78 |
+++ b/repoman/pym/repoman/modules/scan/keywords/keywords.py |
79 |
@@ -26,6 +26,7 @@ class KeywordChecks(ScanBase): |
80 |
def prepare(self, **kwargs): |
81 |
'''Prepare the checks for the next package.''' |
82 |
self.slot_keywords = {} |
83 |
+ self.dropped_keywords = {} |
84 |
return False |
85 |
|
86 |
def check(self, **kwargs): |
87 |
@@ -57,6 +58,19 @@ class KeywordChecks(ScanBase): |
88 |
self.slot_keywords[pkg.slot].update(ebuild.archs) |
89 |
return False |
90 |
|
91 |
+ def check_dropped_keywords(self, **kwargs): |
92 |
+ '''Report on any dropped keywords for the latest ebuild in a slot |
93 |
+ |
94 |
+ @returns: boolean |
95 |
+ ''' |
96 |
+ for ebuild, arches in self.dropped_keywords.values(): |
97 |
+ if arches: |
98 |
+ self.qatracker.add_error( |
99 |
+ "KEYWORDS.dropped", "%s: %s" % ( |
100 |
+ ebuild, |
101 |
+ " ".join(sorted(arches)))) |
102 |
+ return False |
103 |
+ |
104 |
@staticmethod |
105 |
def _isKeywordStable(keyword): |
106 |
return not keyword.startswith("~") and not keyword.startswith("-") |
107 |
@@ -80,12 +94,9 @@ class KeywordChecks(ScanBase): |
108 |
if previous_keywords is None: |
109 |
self.slot_keywords[pkg.slot] = set() |
110 |
elif ebuild_archs and "*" not in ebuild_archs and not ebuild.live_ebuild: |
111 |
+ self.slot_keywords[pkg.slot].update(ebuild_archs) |
112 |
dropped_keywords = previous_keywords.difference(ebuild_archs) |
113 |
- if dropped_keywords: |
114 |
- self.qatracker.add_error( |
115 |
- "KEYWORDS.dropped", "%s: %s" % ( |
116 |
- ebuild.relative_path, |
117 |
- " ".join(sorted(dropped_keywords)))) |
118 |
+ self.dropped_keywords[pkg.slot] = (ebuild.relative_path, { arch for arch in dropped_keywords}) |
119 |
|
120 |
def _checkForInvalidKeywords(self, ebuild, xpkg, y_ebuild): |
121 |
myuse = ebuild.keywords |
122 |
@@ -131,3 +142,8 @@ class KeywordChecks(ScanBase): |
123 |
def runInEbuilds(self): |
124 |
'''Ebuild level scans''' |
125 |
return (True, [self.check]) |
126 |
+ |
127 |
+ @property |
128 |
+ def runInFinal(self): |
129 |
+ '''Final package level scans''' |
130 |
+ return (True, [self.check_dropped_keywords]) |
131 |
|
132 |
diff --git a/repoman/pym/repoman/scanner.py b/repoman/pym/repoman/scanner.py |
133 |
index 899975183..e13d4f68b 100644 |
134 |
--- a/repoman/pym/repoman/scanner.py |
135 |
+++ b/repoman/pym/repoman/scanner.py |
136 |
@@ -414,7 +414,7 @@ class Scanner(object): |
137 |
# initialize per pkg plugin final checks here |
138 |
# need to set it up for ==> self.modules_list or some other ordered list |
139 |
xpkg_complete = False |
140 |
- for mod in [('pkgmetadata', 'PkgMetadata')]: |
141 |
+ for mod in [('pkgmetadata', 'PkgMetadata'), ('keywords', 'KeywordChecks')]: |
142 |
if mod[0] and mod[1] not in self.modules: |
143 |
mod_class = MODULE_CONTROLLER.get_class(mod[0]) |
144 |
logging.debug("Initializing class name: %s", mod_class.__name__) |