public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: testdata/repos/network/profiles/, src/pkgcheck/checks/, ...
@ 2024-01-24 19:25 Arthur Zamarin
  0 siblings, 0 replies; only message in thread
From: Arthur Zamarin @ 2024-01-24 19:25 UTC (permalink / raw
  To: gentoo-commits

commit:     2b66a5ab1f678bcebc59b36abd9254123077c45b
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Fri Jan 19 04:16:50 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 23 19:57:59 2024 +0000
URL:        https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=2b66a5ab

compatibilty: remove reliance on repo.category_dirs

pkgcore's `category_dirs` is a fossil that shouldn't be
relied upon.  My recollection is this property was from
before `profiles/categories` existed, but it's just
a listdir() intersection against known directories.
PMS mandates categories be in `profiles/categories`, thus
that functionality breaks compatibility.

It will be removed from pkgcore in future semver breaks
for that reason.

Signed-off-by: Brian Harring <ferringb <AT> gmail.com>

 src/pkgcheck/checks/repo.py                      |  6 ++-
 testdata/repos/eapis-testing/profiles/categories |  2 +
 testdata/repos/eclass/profiles/categories        |  5 +++
 testdata/repos/network/profiles/categories       |  3 ++
 testdata/repos/overlay/profiles/categories       |  1 +
 testdata/repos/overlayed/profiles/categories     |  1 +
 testdata/repos/profiledir/profiles/categories    |  2 +
 testdata/repos/python/profiles/categories        |  8 ++++
 testdata/repos/standalone/profiles/categories    | 55 ++++++++++++++++++++++++
 testdata/repos/visibility/profiles/categories    |  8 ++++
 10 files changed, 89 insertions(+), 2 deletions(-)

diff --git a/src/pkgcheck/checks/repo.py b/src/pkgcheck/checks/repo.py
index 1dcc99ad..08abe802 100644
--- a/src/pkgcheck/checks/repo.py
+++ b/src/pkgcheck/checks/repo.py
@@ -82,10 +82,12 @@ class EmptyDirsCheck(GentooRepoCheck, RepoCheck):
         self.repo = self.options.target_repo
 
     def finish(self):
+        repo_p = pathlib.Path(self.repo.location)
         for cat, pkgs in sorted(self.repo.packages.items()):
             # ignore entries in profiles/categories with nonexistent dirs
-            if not pkgs and cat in self.repo.category_dirs:
-                yield EmptyCategoryDir(pkg=RawCPV(cat, None, None))
+            if not pkgs:
+                if (repo_p / cat).exists():
+                    yield EmptyCategoryDir(pkg=RawCPV(cat, None, None))
                 continue
             for pkg in sorted(pkgs):
                 if not self.repo.versions[(cat, pkg)]:

diff --git a/testdata/repos/eapis-testing/profiles/categories b/testdata/repos/eapis-testing/profiles/categories
new file mode 100644
index 00000000..077b068b
--- /dev/null
+++ b/testdata/repos/eapis-testing/profiles/categories
@@ -0,0 +1,2 @@
+EapiCheck
+MissingRemoteIdCheck

diff --git a/testdata/repos/eclass/profiles/categories b/testdata/repos/eclass/profiles/categories
new file mode 100644
index 00000000..a7c758c3
--- /dev/null
+++ b/testdata/repos/eclass/profiles/categories
@@ -0,0 +1,5 @@
+EapiCheck
+EclassParseCheck
+EclassUsageCheck
+InheritsCheck
+stub

diff --git a/testdata/repos/network/profiles/categories b/testdata/repos/network/profiles/categories
new file mode 100644
index 00000000..83f6db7f
--- /dev/null
+++ b/testdata/repos/network/profiles/categories
@@ -0,0 +1,3 @@
+FetchablesUrlCheck
+HomepageUrlCheck
+MetadataUrlCheck

diff --git a/testdata/repos/overlay/profiles/categories b/testdata/repos/overlay/profiles/categories
new file mode 100644
index 00000000..367e18ec
--- /dev/null
+++ b/testdata/repos/overlay/profiles/categories
@@ -0,0 +1 @@
+UnusedInMastersCheck

diff --git a/testdata/repos/overlayed/profiles/categories b/testdata/repos/overlayed/profiles/categories
new file mode 100644
index 00000000..39802f64
--- /dev/null
+++ b/testdata/repos/overlayed/profiles/categories
@@ -0,0 +1 @@
+stub

diff --git a/testdata/repos/profiledir/profiles/categories b/testdata/repos/profiledir/profiles/categories
new file mode 100644
index 00000000..5ab67d3f
--- /dev/null
+++ b/testdata/repos/profiledir/profiles/categories
@@ -0,0 +1,2 @@
+cat
+RedundantVersionCheck

diff --git a/testdata/repos/python/profiles/categories b/testdata/repos/python/profiles/categories
new file mode 100644
index 00000000..07e87fc9
--- /dev/null
+++ b/testdata/repos/python/profiles/categories
@@ -0,0 +1,8 @@
+app-arch
+dev-lang
+dev-python
+PythonCheck
+PythonCompatCheck
+PythonFetchableCheck
+RubyCompatCheck
+stub

diff --git a/testdata/repos/standalone/profiles/categories b/testdata/repos/standalone/profiles/categories
new file mode 100644
index 00000000..9a5bd29c
--- /dev/null
+++ b/testdata/repos/standalone/profiles/categories
@@ -0,0 +1,55 @@
+app-arch
+BadCommandsCheck
+CatBadlyFormedXml
+CatInvalidXml
+CatMetadataXmlEmptyElement
+CatMetadataXmlIndentation
+CatMetadataXmlInvalidCatRef
+CatMetadataXmlInvalidPkgRef
+DeclarationShadowedCheck
+DependencyCheck
+DescriptionCheck
+dev-lang
+dev-ruby
+DoCompressedFilesCheck
+DroppedKeywordsCheck
+EapiCheck
+EbuildReservedCheck
+EbuildUnquotedVariablesCheck
+EclassManualDepsCheck
+EclassUsageCheck
+EendMissingArgCheck
+EqualVersionsCheck
+GlobalUseCheck
+GlobCheck
+HomepageCheck
+InsintoCheck
+IuseCheck
+KeywordsCheck
+LicenseCheck
+LocalUseCheck
+ManifestCheck
+ManifestCollisionCheck
+MetadataVarCheck
+MissingSlotDepCheck
+MissingUnpackerDepCheck
+NonPosixCheck
+PackageMetadataXmlCheck
+PkgDirCheck
+PropertiesCheck
+ReadonlyVariableCheck
+RedundantDodirCheck
+RequiredUseCheck
+RestrictCheck
+RestrictTestCheck
+RustCheck
+SandboxCallCheck
+SourcingCheck
+SrcUriCheck
+StaleLiveCheck
+stub
+test
+VariableScopeCheck
+virtual
+VisibilityCheck
+WhitespaceCheck

diff --git a/testdata/repos/visibility/profiles/categories b/testdata/repos/visibility/profiles/categories
new file mode 100644
index 00000000..53471351
--- /dev/null
+++ b/testdata/repos/visibility/profiles/categories
@@ -0,0 +1,8 @@
+DependencyMoved
+DeprecatedDep
+NonsolvableDepsInDev
+NonsolvableDepsInExp
+NonsolvableDepsInStable
+stub
+UncheckableDep
+VisibilityCheck


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-24 19:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 19:25 [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: testdata/repos/network/profiles/, src/pkgcheck/checks/, Arthur Zamarin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox