From owner-svn-ports-all@freebsd.org Thu Dec 5 06:42:23 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 883E11BDF19; Thu, 5 Dec 2019 06:42:23 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47T5k72xdBz3Mbv; Thu, 5 Dec 2019 06:42:23 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48AD7CEFD; Thu, 5 Dec 2019 06:42:23 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xB56gNvJ044046; Thu, 5 Dec 2019 06:42:23 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xB56gNtd044045; Thu, 5 Dec 2019 06:42:23 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <201912050642.xB56gNtd044045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Thu, 5 Dec 2019 06:42:23 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r519063 - head/Mk/Scripts X-SVN-Group: ports-head X-SVN-Commit-Author: tobik X-SVN-Commit-Paths: head/Mk/Scripts X-SVN-Commit-Revision: 519063 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Dec 2019 06:42:23 -0000 Author: tobik Date: Thu Dec 5 06:42:22 2019 New Revision: 519063 URL: https://svnweb.freebsd.org/changeset/ports/519063 Log: Mk/Uses/cargo.mk: Support new Cargo.lock format The new format [1,2] dropped the [metadata] table. As a consequence our cargo-crates.awk script no longer outputs CARGO_CRATES. We can get the crate list from the various [[package]] tables instead. This should work with the new as well as the old format. [1] https://github.com/rust-lang/cargo/pull/7070 [2] https://github.com/rust-lang/cargo/pull/7579 PR: 242416 Reported by: jbeich Modified: head/Mk/Scripts/cargo-crates.awk Modified: head/Mk/Scripts/cargo-crates.awk ============================================================================== --- head/Mk/Scripts/cargo-crates.awk Thu Dec 5 04:12:20 2019 (r519062) +++ head/Mk/Scripts/cargo-crates.awk Thu Dec 5 06:42:22 2019 (r519063) @@ -6,6 +6,9 @@ BEGIN { gl_tuple_len = 0 crates_len = 0 package_name = "" + crate_name = "" + crate_version = "" + crate_source = "" gitlab_sites["https://gitlab.com"] = 1 gitlab_sites["https://gitlab.freedesktop.org"] = 1 @@ -13,19 +16,37 @@ BEGIN { gitlab_sites["https://gitlab.redox-os.org"] = 1 } -/^"checksum .* .* \(registry\+.*\)" = ".*"/ { - # $2: crate - # $3: version - # $4: url - # $6: checksum - crates[crates_len++] = sprintf("%s-%s", $2, $3) -} - /^name = ".*"/ { + crate_name = $3 + gsub(/"/, "", crate_name) + package_name = $3 gsub("[^a-zA-Z_]", "", package_name) } +/^version = ".*"/ { + crate_version = $3 + gsub(/"/, "", crate_version) +} + +/^source = ".*"/ { + crate_source = $3 + gsub(/"/, "", crate_source) +} + +/^\[\[package\]\]$/ { + add_crate() +} + +function add_crate() { + if (crate_source == "registry+https://github.com/rust-lang/crates.io-index") { + crates[crates_len++] = sprintf("%s-%s", crate_name, crate_version) + } + crate_name = "" + crate_version = "" + crate_source = "" +} + function split_url(s) { # scheme:[//[user[:password]@]host[:port]][/path][?query][#fragment] split(s, url_scheme, "://") @@ -112,6 +133,8 @@ function print_array(start, arr, arrlen) { } END { + add_crate() + if (gh_tuple_len > 0 && ENVIRON["USE_GITHUB"] == "") { printf "USE_GITHUB=\tnodefault\n" }