commit:     e4bbab1cd0cd5138799f6b15011c398e28181c38
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 22 15:58:22 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Nov 22 18:28:43 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=e4bbab1c

eclass: Update for RUST_DEPEND

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 src/pkgcheck/checks/eclass.py                                  |  6 +++---
 .../standalone/EclassManualDepsCheck/RustMissingDeps/fix.patch |  2 +-
 .../repos/standalone/dev-lang/rust-bin/rust-bin-1.81.0.ebuild  |  4 ++++
 .../repos/standalone/dev-lang/rust-bin/rust-bin-1.82.0.ebuild  |  4 ++++
 testdata/repos/standalone/dev-lang/rust/rust-1.81.0.ebuild     |  4 ++++
 testdata/repos/standalone/dev-lang/rust/rust-1.82.0.ebuild     |  4 ++++
 testdata/repos/standalone/eclass/cargo.eclass                  |  2 ++
 testdata/repos/standalone/eclass/rust.eclass                   | 10 ++++++++++
 testdata/repos/standalone/virtual/rust/rust-0.ebuild           |  2 --
 9 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/src/pkgcheck/checks/eclass.py b/src/pkgcheck/checks/eclass.py
index 52bcea6e..f806e50e 100644
--- a/src/pkgcheck/checks/eclass.py
+++ b/src/pkgcheck/checks/eclass.py
@@ -516,9 +516,9 @@ class RubyMissingDeps(results.VersionResult, 
results.Warning):
 
 
 class RustMissingDeps(results.VersionResult, results.Warning):
-    """Package sets ``CARGO_OPTIONAL`` but does not depend on 
``virtual/rust``."""
+    """Package sets ``CARGO_OPTIONAL`` but does not use ``${RUST_DEPEND}``."""
 
-    desc = "sets CARGO_OPTIONAL but does not depend on virtual/rust"
+    desc = "sets CARGO_OPTIONAL but does not use ${RUST_DEPEND}"
 
 
 class TmpfilesMissingDeps(results.VersionResult, results.Warning):
@@ -542,7 +542,7 @@ class EclassManualDepsCheck(Check):
 
     dependencies = (
         # eclass, variable, one of deps, class
-        ("cargo", "CARGO_OPTIONAL", {"virtual/rust"}, RustMissingDeps),
+        ("cargo", "CARGO_OPTIONAL", {"dev-lang/rust", "dev-lang/rust-bin"}, 
RustMissingDeps),
         ("go-module", "GO_OPTIONAL", {"dev-lang/go"}, GoMissingDeps),
         (
             "ruby-ng",

diff --git 
a/testdata/data/repos/standalone/EclassManualDepsCheck/RustMissingDeps/fix.patch
 
b/testdata/data/repos/standalone/EclassManualDepsCheck/RustMissingDeps/fix.patch
index 08394782..5d75114e 100644
--- 
a/testdata/data/repos/standalone/EclassManualDepsCheck/RustMissingDeps/fix.patch
+++ 
b/testdata/data/repos/standalone/EclassManualDepsCheck/RustMissingDeps/fix.patch
@@ -6,4 +6,4 @@ diff -Naur 
standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-1.eb
  LICENSE="BSD"
  SLOT="0"
 +
-+BDEPEND="virtual/rust"
++BDEPEND="${RUST_DEPEND}"

diff --git a/testdata/repos/standalone/dev-lang/rust-bin/rust-bin-1.81.0.ebuild 
b/testdata/repos/standalone/dev-lang/rust-bin/rust-bin-1.81.0.ebuild
new file mode 100644
index 00000000..2c6d4628
--- /dev/null
+++ b/testdata/repos/standalone/dev-lang/rust-bin/rust-bin-1.81.0.ebuild
@@ -0,0 +1,4 @@
+DESCRIPTION="Stub ebuild"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck";
+LICENSE="BSD"
+SLOT="${PV}"

diff --git a/testdata/repos/standalone/dev-lang/rust-bin/rust-bin-1.82.0.ebuild 
b/testdata/repos/standalone/dev-lang/rust-bin/rust-bin-1.82.0.ebuild
new file mode 100644
index 00000000..2c6d4628
--- /dev/null
+++ b/testdata/repos/standalone/dev-lang/rust-bin/rust-bin-1.82.0.ebuild
@@ -0,0 +1,4 @@
+DESCRIPTION="Stub ebuild"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck";
+LICENSE="BSD"
+SLOT="${PV}"

diff --git a/testdata/repos/standalone/dev-lang/rust/rust-1.81.0.ebuild 
b/testdata/repos/standalone/dev-lang/rust/rust-1.81.0.ebuild
new file mode 100644
index 00000000..2c6d4628
--- /dev/null
+++ b/testdata/repos/standalone/dev-lang/rust/rust-1.81.0.ebuild
@@ -0,0 +1,4 @@
+DESCRIPTION="Stub ebuild"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck";
+LICENSE="BSD"
+SLOT="${PV}"

diff --git a/testdata/repos/standalone/dev-lang/rust/rust-1.82.0.ebuild 
b/testdata/repos/standalone/dev-lang/rust/rust-1.82.0.ebuild
new file mode 100644
index 00000000..2c6d4628
--- /dev/null
+++ b/testdata/repos/standalone/dev-lang/rust/rust-1.82.0.ebuild
@@ -0,0 +1,4 @@
+DESCRIPTION="Stub ebuild"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck";
+LICENSE="BSD"
+SLOT="${PV}"

diff --git a/testdata/repos/standalone/eclass/cargo.eclass 
b/testdata/repos/standalone/eclass/cargo.eclass
index 217dc8e8..04deb1f4 100644
--- a/testdata/repos/standalone/eclass/cargo.eclass
+++ b/testdata/repos/standalone/eclass/cargo.eclass
@@ -1,5 +1,7 @@
 # cargo eclass
 
+inherit rust
+
 CARGO_CRATE_URIS=${CRATES}
 
 cargo_crate_uris() { :; }

diff --git a/testdata/repos/standalone/eclass/rust.eclass 
b/testdata/repos/standalone/eclass/rust.eclass
new file mode 100644
index 00000000..b85f9bde
--- /dev/null
+++ b/testdata/repos/standalone/eclass/rust.eclass
@@ -0,0 +1,10 @@
+# rust eclass
+
+RUST_DEPEND="
+       || (
+               dev-lang/rust-bin:1.82.0
+               dev-lang/rust:1.82.0
+               dev-lang/rust-bin:1.81.0
+               dev-lang/rust:1.81.0
+       )
+"

diff --git a/testdata/repos/standalone/virtual/rust/rust-0.ebuild 
b/testdata/repos/standalone/virtual/rust/rust-0.ebuild
deleted file mode 100644
index 9c2ce2e9..00000000
--- a/testdata/repos/standalone/virtual/rust/rust-0.ebuild
+++ /dev/null
@@ -1,2 +0,0 @@
-DESCRIPTION="Stub ebuild"
-SLOT="0"

Reply via email to