From: "Arthur Zamarin" <arthurzam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: src/pkgcheck/checks/, tests/checks/
Date: Sat, 4 Mar 2023 05:59:12 +0000 (UTC) [thread overview]
Message-ID: <1677909416.861c24ab76bfc36de2ca80a8375866e4123dc51a.arthurzam@gentoo> (raw)
commit: 861c24ab76bfc36de2ca80a8375866e4123dc51a
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 4 05:56:56 2023 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 4 05:56:56 2023 +0000
URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=861c24ab
StableRequestCheck: ignore version not keyworded for arches
packages that are not keyworded for relevant arches but keyworded to
another arch, were not ignored by the check. This patch fixes that.
Resolves: https://github.com/pkgcore/pkgcheck/issues/544
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
src/pkgcheck/checks/stablereq.py | 5 +++++
tests/checks/test_stablereq.py | 9 +++++++++
2 files changed, 14 insertions(+)
diff --git a/src/pkgcheck/checks/stablereq.py b/src/pkgcheck/checks/stablereq.py
index 57e41a84..be8e2c7f 100644
--- a/src/pkgcheck/checks/stablereq.py
+++ b/src/pkgcheck/checks/stablereq.py
@@ -71,6 +71,7 @@ class StableRequestCheck(GentooRepoCheck):
pkg_keywords.update(pkg.keywords)
if stable_pkg_keywords := {x for x in pkg_keywords if x[0] not in {"-", "~"}}:
+ keyworded_pkg_keywords = {"~" + x for x in stable_pkg_keywords}
for slot, pkgs in sorted(pkg_slotted.items()):
slot_keywords = set().union(*(pkg.keywords for pkg in pkgs))
stable_slot_keywords = slot_keywords.intersection(stable_pkg_keywords)
@@ -79,6 +80,10 @@ class StableRequestCheck(GentooRepoCheck):
if stable_pkg_keywords.intersection(pkg.keywords):
break
+ # stop if not keyworded for stable
+ if not keyworded_pkg_keywords.intersection(pkg.keywords):
+ break
+
try:
match = next(self.modified_repo.itermatch(pkg.versioned_atom))
except StopIteration:
diff --git a/tests/checks/test_stablereq.py b/tests/checks/test_stablereq.py
index 43f4380b..efb94b7a 100644
--- a/tests/checks/test_stablereq.py
+++ b/tests/checks/test_stablereq.py
@@ -118,6 +118,15 @@ class TestStableRequestCheck(ReportTestCase):
expected = StableRequest("1", ["~amd64"], 30, pkg=VersionedCPV("cat/pkg-2"))
assert r == expected
+ def test_unkeyworded_new_pkg(self):
+ self.parent_repo.create_ebuild("cat/pkg-1", keywords=["amd64"])
+ self.parent_git_repo.add_all("cat/pkg-1")
+ self.parent_repo.create_ebuild("cat/pkg-2", keywords=["~x86"])
+ self.parent_git_repo.add_all("cat/pkg-2")
+ self.child_git_repo.run(["git", "pull", "origin", "main"])
+ self.init_check(future=30)
+ self.assertNoReport(self.check, self.source)
+
def test_moved_category(self):
self.parent_repo.create_ebuild("cat/pkg-1", keywords=["amd64"])
self.parent_git_repo.add_all("cat/pkg-1")
next reply other threads:[~2023-03-04 5:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-04 5:59 Arthur Zamarin [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-01-16 12:17 [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: src/pkgcheck/checks/, tests/checks/ Arthur Zamarin
2024-03-07 16:06 Arthur Zamarin
2023-07-15 8:52 Arthur Zamarin
2023-03-11 7:14 Arthur Zamarin
2023-03-05 17:13 Arthur Zamarin
2023-01-21 9:46 Arthur Zamarin
2023-01-20 20:47 Arthur Zamarin
2022-11-26 11:47 Arthur Zamarin
2022-11-26 11:47 Arthur Zamarin
2022-10-28 13:34 Arthur Zamarin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1677909416.861c24ab76bfc36de2ca80a8375866e4123dc51a.arthurzam@gentoo \
--to=arthurzam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox