diff options
3 files changed, 37 insertions, 0 deletions
diff --git a/src/pkgcheck/checks/visibility.py b/src/pkgcheck/checks/visibility.py index 050b923b..bddbbe64 100644 --- a/src/pkgcheck/checks/visibility.py +++ b/src/pkgcheck/checks/visibility.py @@ -231,6 +231,25 @@ class OldPackageName(results.PackageResult, results.Error): 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. @@ -250,6 +269,7 @@ class VisibilityCheck(feeds.EvaluateDepSet, feeds.QueryCache, Check): NonsolvableDepsInExp, DependencyMoved, OldPackageName, + OldPackageNameDep, } ) @@ -295,6 +315,11 @@ class VisibilityCheck(feeds.EvaluateDepSet, feeds.QueryCache, Check): 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: diff --git a/testdata/data/repos/visibility/VisibilityCheck/OldPackageNameDep/expected.json b/testdata/data/repos/visibility/VisibilityCheck/OldPackageNameDep/expected.json new file mode 100644 index 00000000..f4451628 --- /dev/null +++ b/testdata/data/repos/visibility/VisibilityCheck/OldPackageNameDep/expected.json @@ -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"} diff --git a/testdata/repos/visibility/VisibilityCheck/OldPackageNameDep/OldPackageNameDep-0.ebuild b/testdata/repos/visibility/VisibilityCheck/OldPackageNameDep/OldPackageNameDep-0.ebuild new file mode 100644 index 00000000..fc165544 --- /dev/null +++ b/testdata/repos/visibility/VisibilityCheck/OldPackageNameDep/OldPackageNameDep-0.ebuild @@ -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" |