Skip to content

Commit

Permalink
DeprecatedDep: fix mishandling of slotted deprecates
Browse files Browse the repository at this point in the history
Resolves: #642
Signed-off-by: Arthur Zamarin <[email protected]>
  • Loading branch information
arthurzam committed Dec 10, 2023
1 parent 4bda26a commit 4776408
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/pkgcheck/checks/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ def feed(self, pkg):
if not atom.blocks and self.deprecated(atom):
# verify all matching packages are deprecated
pkgs = self.options.search_repo.match(atom.no_usedeps)
if all(self.deprecated(x.versioned_atom) for x in pkgs):
if all(map(self.deprecated, pkgs)):
deprecated[attr].add(atom)

if in_or_restriction and atom.slot_operator == "=":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{"__class__": "DeprecatedDep", "category": "DeprecatedDep", "package": "nonoptional", "version": "0", "attr": "RDEPEND", "atoms": ["stub/deprecated"]}
{"__class__": "DeprecatedDep", "category": "DeprecatedDep", "package": "optional", "version": "0", "attr": "RDEPEND", "atoms": ["stub/deprecated"]}
{"__class__": "DeprecatedDep", "category": "DeprecatedDep", "package": "nonoptional", "version": "0", "attr": "RDEPEND", "atoms": ["stub/deprecated:0"]}
{"__class__": "DeprecatedDep", "category": "DeprecatedDep", "package": "optional", "version": "0", "attr": "RDEPEND", "atoms": ["stub/deprecated:0"]}
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ diff -Naur visibility/DeprecatedDep/nonoptional/nonoptional-0.ebuild fixed/Depre
SLOT="0"
LICENSE="BSD"
KEYWORDS="~amd64"
-RDEPEND="stub/deprecated"
-RDEPEND="stub/deprecated:0"
+RDEPEND="stub/unstable"
diff -Naur visibility/DeprecatedDep/optional/optional-0.ebuild fixed/DeprecatedDep/optional/optional-0.ebuild
--- visibility/DeprecatedDep/optional/optional-0.ebuild 2019-12-26 20:39:13.559577724 -0700
+++ fixed/DeprecatedDep/optional/optional-0.ebuild 2019-12-26 20:39:47.650758627 -0700
@@ -6,5 +6,5 @@
KEYWORDS="~amd64"
RDEPEND="
!stub/deprecated
- || ( stub/unstable stub/deprecated )
!stub/deprecated:0
- || ( stub/unstable stub/deprecated:0 )
+ stub/unstable
"
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ HOMEPAGE="https://github.com/pkgcore/pkgcheck"
SLOT="0"
LICENSE="BSD"
KEYWORDS="~amd64"
RDEPEND="stub/deprecated"
RDEPEND="stub/deprecated:0"
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ SLOT="0"
LICENSE="BSD"
KEYWORDS="~amd64"
RDEPEND="
!stub/deprecated
|| ( stub/unstable stub/deprecated )
!stub/deprecated:0
|| ( stub/unstable stub/deprecated:0 )
"
1 change: 1 addition & 0 deletions testdata/repos/visibility/profiles/eapi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5
2 changes: 1 addition & 1 deletion testdata/repos/visibility/profiles/package.deprecated
Original file line number Diff line number Diff line change
@@ -1 +1 @@
stub/deprecated
stub/deprecated:0

0 comments on commit 4776408

Please sign in to comment.