Skip to content

Commit

Permalink
OldPackageName: new check for package named after old package name
Browse files Browse the repository at this point in the history
Resolves: #650
Signed-off-by: Arthur Zamarin <[email protected]>
  • Loading branch information
arthurzam committed Jan 17, 2024
1 parent 111aee8 commit c3407ae
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/pkgcheck/checks/visibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -232,6 +249,7 @@ class VisibilityCheck(feeds.EvaluateDepSet, feeds.QueryCache, Check):
NonsolvableDepsInDev,
NonsolvableDepsInExp,
DependencyMoved,
OldPackageName,
}
)

Expand Down Expand Up @@ -269,6 +287,9 @@ def feed(self, pkg):
# 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()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"__class__": "OldPackageName", "category": "VisibilityCheck", "package": "OldPackageName", "new_name": "stub/random-pkgname"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
EAPI=7
DESCRIPTION="Ebuild with pkgmoved name"
HOMEPAGE="https://github.com/pkgcore/pkgcheck"
SLOT="0"
LICENSE="BSD"
KEYWORDS="~amd64"
1 change: 1 addition & 0 deletions testdata/repos/visibility/profiles/updates/1Q-2024
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
move stub/old-name stub/stable
move VisibilityCheck/OldPackageName stub/random-pkgname

0 comments on commit c3407ae

Please sign in to comment.