From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-971717-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CFD511396D0 for <garchives@archives.gentoo.org>; Sat, 9 Sep 2017 13:29:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 230F2E0D76; Sat, 9 Sep 2017 13:29:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F3531E0D76 for <gentoo-commits@lists.gentoo.org>; Sat, 9 Sep 2017 13:29:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E98C234170B for <gentoo-commits@lists.gentoo.org>; Sat, 9 Sep 2017 13:29:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AC1B89063 for <gentoo-commits@lists.gentoo.org>; Sat, 9 Sep 2017 13:29:13 +0000 (UTC) From: "Dirkjan Ochtman" <djc@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Dirkjan Ochtman" <djc@gentoo.org> Message-ID: <1504963619.22e6f49add5eb11715f230a50790c0eecf4f5f1f.djc@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/cargo.eclass X-VCS-Directories: eclass/ X-VCS-Committer: djc X-VCS-Committer-Name: Dirkjan Ochtman X-VCS-Revision: 22e6f49add5eb11715f230a50790c0eecf4f5f1f X-VCS-Branch: master Date: Sat, 9 Sep 2017 13:29:13 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 6e2cdb84-357c-4cff-854f-144293e8c408 X-Archives-Hash: 5b585a5c09424fe6543c29b669e18df4 commit: 22e6f49add5eb11715f230a50790c0eecf4f5f1f Author: Dirkjan Ochtman <djc <AT> gentoo <DOT> org> AuthorDate: Sat Sep 9 13:26:59 2017 +0000 Commit: Dirkjan Ochtman <djc <AT> gentoo <DOT> org> CommitDate: Sat Sep 9 13:26:59 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=22e6f49a eclass: improve cargo.eclass to better handle pre-release versions (fixes bug 630428) eclass/cargo.eclass | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index b08aa9e28aa..f805deba70c 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -31,9 +31,14 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo" cargo_crate_uris() { local crate for crate in "$@"; do - local name version url + local name version url pretag name="${crate%-*}" version="${crate##*-}" + pretag="[a-zA-Z]+" + if [[ $version =~ $pretag ]]; then + version="${name##*-}-${version}" + name="${name%-*}" + fi url="https://crates.io/api/v1/crates/${name}/${version}/download -> ${crate}.crate" echo "${url}" done