pkgcheck
pkgcheck copied to clipboard
UnknownManifest/EmptyPackageDir not reported for ebuild-less package
In ::gentoo, e8812cf3de296cbf347557b4df493ba7dfd744e6 dropped all ebuilds for media-gfx/realesrgan-ncnn-vulkan
, but surprisingly, pkgcheck does not warn with UnknownManifest (or anything):
$ git checkout e8812cf3de296cbf347557b4df493ba7dfd744e6~1
$ cd media-gfx/realesrgan-ncnn-vulkan
$ pkgcheck scan
<nothing>
Going off ancient memory without looking at code, most of pkgcheck's package-related sources rely on ebuilds existing in order for the package to be included by the related iterators. To make it work for empty/nonexistent packages, you'd have to add a new source that wraps the package
class in pkgcore, iterating over all potential pkg dirs, while adding enough of a "virtual package" interface for pkgcheck results to render properly. IIRC, some checks do virtualize pkg objects similar to this, but imo in this case it doesn't feel worth it.
Rather than doing all that unnecessary work, empty package (and category) dirs should already be flagged via results (e.g. EmptyPackageDir, and if that didn't trigger it's probably a bug in the related check related to detecting potential package dirs.
Rather than doing all that unnecessary work, empty package (and category) dirs should already be flagged via results (e.g. EmptyPackageDir, and if that didn't trigger it's probably a bug in the related check related to detecting potential package dirs.
This feels obvious now you said it, doh. Thank you! I'd forgot EmptyPackageDir exists.
So some findings:
$ cd media-gfx/realesrgan-ncnn-vulkan
$ pkgcheck scan -c EmptyDirsCheck
pkgcheck scan: error: no matching checks available for category scope
Because EmptyDirsCheck
is a repo level check, it won't be run when inside the dir. But When I run this scan in repo root, it flags them:
$ pkgcheck scan -c EmptyDirsCheck
repo
EmptyPackageDir: empty package directory: dev-python/generic
EmptyPackageDir: empty package directory: media-gfx/realesrgan-ncnn-vulkan
But I do notice that this a GentooRepoCheck
, so ran only for ::gentoo
tree. I think we should convert the results to Error level, as I think this is wrong for gentoo tree to have empty category or empty package.