public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH] cargo.eclass: Output only the first create URI when PKGBUMPING
Date: Tue, 30 Jan 2024 17:43:31 +0100	[thread overview]
Message-ID: <20240130164332.469545-1-mgorny@gentoo.org> (raw)

Modify cargo_set_crate_uris to output only the first crate URI when
PKGBUMPING is set for the current ebuild.  This makes pkgdiff-mg much
faster on Rust packages, as it does not have to fetch all the hundreds
of crates that aren't part of the diff anyway.  This is an improved
version of 92001837418f3a50e6571c0f533520b42f90d488, as the original
attempted not to output any URIs, and therefore could create empty
groups in SRC_URI that are invalid.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/cargo.eclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 3bdbb5e3ec64..0f2da982f60c 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -193,6 +193,11 @@ _cargo_set_crate_uris() {
 		fi
 		url="https://crates.io/api/v1/crates/${name}/${version}/download -> ${name}-${version}.crate"
 		CARGO_CRATE_URIS+="${url} "
+
+		# when invoked by pkgbump, avoid fetching all the crates
+		# we just output the first one, to avoid creating empty groups
+		# in SRC_URI
+		[[ ${PKGBUMPING} == ${PVR} ]] && return
 	done
 
 	if declare -p GIT_CRATES &>/dev/null; then
-- 
2.43.0



                 reply	other threads:[~2024-01-30 16:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240130164332.469545-1-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox