Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OldPackageNameDep: check for dependency using pkgmoved name #694

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/pkgcheck/checks/visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,25 @@ def desc(self):
return f"package uses old name which is source of pkgmove, rename into {self.new_name!r}"


class OldPackageNameDep(results.VersionResult, results.Error):
"""Package depends on old name which is source of pkgmove.

Package depends on ``${CATEGORY}/${PN}`` which is the source of a
pkgmove. It should be updated to the destination (new name) from
this repository or one of its master repositories.
"""

def __init__(self, attr: str, dep: str, new_name: str, **kwargs):
super().__init__(**kwargs)
self.attr = attr
self.dep = dep
self.new_name = new_name

@property
def desc(self):
return f"{self.attr}: {self.dep!r} uses old package name which is the source of a pkgmove, rename into {self.new_name!r}"


class VisibilityCheck(feeds.EvaluateDepSet, feeds.QueryCache, Check):
"""Visibility dependency scans.

Expand All @@ -250,6 +269,7 @@ class VisibilityCheck(feeds.EvaluateDepSet, feeds.QueryCache, Check):
NonsolvableDepsInExp,
DependencyMoved,
OldPackageName,
OldPackageNameDep,
}
)

Expand Down Expand Up @@ -295,6 +315,11 @@ def feed(self, pkg):
nonexistent = set()
try:
for orig_node in visit_atoms(pkg, getattr(pkg, attr)):
if orig_node.key in self.pkgmoves:
yield OldPackageNameDep(
attr, str(orig_node), self.pkgmoves[orig_node.key], pkg=pkg
)

node = orig_node.no_usedeps
if node not in self.query_cache:
if node in self.profiles.global_insoluble:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{"__class__": "OldPackageNameDep", "category": "DependencyMoved", "package": "DependencyMoved", "version": "0", "attr": "bdepend", "dep": ">=stub/old-name-2.71-r6:2.71", "new_name": "stub/stable"}
{"__class__": "OldPackageNameDep", "category": "DependencyMoved", "package": "DependencyMoved", "version": "0", "attr": "rdepend", "dep": "stub/old-name:2", "new_name": "stub/stable"}
{"__class__": "OldPackageNameDep", "category": "DependencyMoved", "package": "DependencyMoved", "version": "0", "attr": "rdepend", "dep": "~stub/old-name-2", "new_name": "stub/stable"}
{"__class__": "OldPackageNameDep", "category": "VisibilityCheck", "package": "OldPackageNameDep", "version": "0", "attr": "rdepend", "dep": "!VisibilityCheck/OldPackageName", "new_name": "stub/random-pkgname"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
EAPI=7
DESCRIPTION="Ebuild with pkgmoved dep"
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
SLOT="0"
LICENSE="BSD"
KEYWORDS="~amd64"

RDEPEND="!VisibilityCheck/OldPackageName"
Loading