From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4324415838C for ; Tue, 30 Jan 2024 16:43:42 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 360CB2BC07B; Tue, 30 Jan 2024 16:43:38 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E22782BC078 for ; Tue, 30 Jan 2024 16:43:37 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH] cargo.eclass: Output only the first create URI when PKGBUMPING Date: Tue, 30 Jan 2024 17:43:31 +0100 Message-ID: <20240130164332.469545-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 0b89c2ba-a16c-4608-a247-8a5814895d84 X-Archives-Hash: 7c1593eb5c3b60cf110acc0ca358d6af 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 --- 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