aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pkgcheck/checks/visibility.py21
-rw-r--r--testdata/data/repos/visibility/VisibilityCheck/OldPackageName/expected.json1
-rw-r--r--testdata/repos/visibility/VisibilityCheck/OldPackageName/OldPackageName-0.ebuild6
-rw-r--r--testdata/repos/visibility/profiles/updates/1Q-20241
4 files changed, 29 insertions, 0 deletions
diff --git a/src/pkgcheck/checks/visibility.py b/src/pkgcheck/checks/visibility.py
index 874d1bbf..050b923b 100644
--- a/src/pkgcheck/checks/visibility.py
+++ b/src/pkgcheck/checks/visibility.py
@@ -214,6 +214,23 @@ class NonsolvableDepsInExp(NonsolvableDeps):
_profile = "exp"
+class OldPackageName(results.PackageResult, results.Error):
+ """Package uses old name which is source of pkgmove.
+
+ Package is using ``${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, new_name: str, **kwargs):
+ super().__init__(**kwargs)
+ self.new_name = new_name
+
+ @property
+ def desc(self):
+ return f"package uses old name which is source of pkgmove, rename into {self.new_name!r}"
+
+
class VisibilityCheck(feeds.EvaluateDepSet, feeds.QueryCache, Check):
"""Visibility dependency scans.
@@ -232,6 +249,7 @@ class VisibilityCheck(feeds.EvaluateDepSet, feeds.QueryCache, Check):
NonsolvableDepsInDev,
NonsolvableDepsInExp,
DependencyMoved,
+ OldPackageName,
}
)
@@ -269,6 +287,9 @@ class VisibilityCheck(feeds.EvaluateDepSet, feeds.QueryCache, Check):
# vcs ebuild that better not be visible
yield from self.check_visibility_vcs(pkg)
+ if pkg.key in self.pkgmoves:
+ yield OldPackageName(self.pkgmoves[pkg.key], pkg=pkg)
+
suppressed_depsets = []
for attr in (x.lower() for x in pkg.eapi.dep_keys):
nonexistent = set()
diff --git a/testdata/data/repos/visibility/VisibilityCheck/OldPackageName/expected.json b/testdata/data/repos/visibility/VisibilityCheck/OldPackageName/expected.json
new file mode 100644
index 00000000..fcc053e4
--- /dev/null
+++ b/testdata/data/repos/visibility/VisibilityCheck/OldPackageName/expected.json
@@ -0,0 +1 @@
+{"__class__": "OldPackageName", "category": "VisibilityCheck", "package": "OldPackageName", "new_name": "stub/random-pkgname"}
diff --git a/testdata/repos/visibility/VisibilityCheck/OldPackageName/OldPackageName-0.ebuild b/testdata/repos/visibility/VisibilityCheck/OldPackageName/OldPackageName-0.ebuild
new file mode 100644
index 00000000..842db9dd
--- /dev/null
+++ b/testdata/repos/visibility/VisibilityCheck/OldPackageName/OldPackageName-0.ebuild
@@ -0,0 +1,6 @@
+EAPI=7
+DESCRIPTION="Ebuild with pkgmoved name"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+SLOT="0"
+LICENSE="BSD"
+KEYWORDS="~amd64"
diff --git a/testdata/repos/visibility/profiles/updates/1Q-2024 b/testdata/repos/visibility/profiles/updates/1Q-2024
index 518e4bf5..dfb9b553 100644
--- a/testdata/repos/visibility/profiles/updates/1Q-2024
+++ b/testdata/repos/visibility/profiles/updates/1Q-2024
@@ -1 +1,2 @@
move stub/old-name stub/stable
+move VisibilityCheck/OldPackageName stub/random-pkgname