From nobody Sun Oct 8 16:41:20 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S3Sbj0KNTz4wWFQ; Sun, 8 Oct 2023 16:41:21 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S3Sbh70fWz3Sw9; Sun, 8 Oct 2023 16:41:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696783281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y6JbidzeeBfxZjSkbWBlQelZaz1Qrxs5sCTCarqUCJw=; b=lnlNKHLaSeBnJvnyzKmUwR3s3Lxa3GjEZDH7Q4Nl9+rQlR+H1aR7EzOaqBZLFYBTdbRyro LxKHYvDXlwLbRj51MAc606XAxqcARuWEPonoPTwiGBvqdhKhxsH/3L1YcNbevYRn36w8Vh /6/iCo3lv0JZKQ4kn3sN4af1XBjpO+T+a8oSvLZayYJemObz4NiR25Wy+W06jBP511DVog NguXaI1UZqg9clVDFu5ocYxSEZVi7oOKxH5JyDU1qXbyvEuXDMwg+jmOV+7pux7xhsDor6 lkJOtnkxUmvAWUZ6k/pEvzL/vin/aTMQ3pYDCo8DUWnbPB6cZSf9Y1rcD8+xtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696783281; a=rsa-sha256; cv=none; b=hU949EMrqBBMpfy9r94HMKlNEW8tk1F+CUa6G+B1EeFbFXrlOJZcckNuPgYc5gox1B5opI 84rpxB04IF0gK8Ggp0ZVx9FK0++lNywBKe3djKM1GwAkPo6tZvA/UJZ+lYxoyXSzQjvx/m MqcH86OppSP2PgI7uKfoYtHcf/6kSq8Vr+raO7IxD6p5Bze9iZssS1ODdqBIkx+jrvniOq V7skDN0bPDHi+fr9b+PbSvjFw/4LbpkVlDTL0B6Jh3ZZfXm9JQ7lO5k3DGtc2sGuiXs9mm Gzij7BFH4fS+kSEowDkWN5/pRayFRi+uLRiOwgCK0IcckV/mxkBAD6vXZe6ikw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696783281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y6JbidzeeBfxZjSkbWBlQelZaz1Qrxs5sCTCarqUCJw=; b=m49RxZ2C90bEukil8LJrEkfMmFdx63Xo2kwr/hrD6b7ZEehS/96FLAvgUszb0eLO5V97WV 2l2dorY4gllbm1udmJLTqTg/eqa965fa+yE77/C2HljzUukswwdae2Ea/Kd5nqZtnERAW3 a7ED37wVnXd5kR8ux0fDzU7Z6XEv2SMZMZMGICij4ZUXh7+kUvein20ZsCHhir6MDdcZ2Y Dk3ecUrHOo12Bo/tyST+oeAng+0WkcuT4Umwdds8LDpNnByT/8ws+HtxCffC90tmnJzX7I vdWCb2CarJtzLiugwoyDMpSrRrRN6ioS1iEZPPA+ERQ48dIvkeY5IJgOKm4HLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S3Sbh6473z65Q; Sun, 8 Oct 2023 16:41:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 398GfKmx017456; Sun, 8 Oct 2023 16:41:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 398GfKhU017453; Sun, 8 Oct 2023 16:41:20 GMT (envelope-from git) Date: Sun, 8 Oct 2023 16:41:20 GMT Message-Id: <202310081641.398GfKhU017453@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mikael Urankar Subject: git: 8fae936cf5a6 - main - Mk/Scripts/cargo-crates-git-configure.awk: Generate the patch.crates-io section after parsing all the Cargo.toml files List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mikael X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8fae936cf5a65db050d6b0950a912a4f028e34d8 Auto-Submitted: auto-generated The branch main has been updated by mikael: URL: https://cgit.FreeBSD.org/ports/commit/?id=8fae936cf5a65db050d6b0950a912a4f028e34d8 commit 8fae936cf5a65db050d6b0950a912a4f028e34d8 Author: Mikael Urankar AuthorDate: 2023-10-08 16:36:11 +0000 Commit: Mikael Urankar CommitDate: 2023-10-08 16:41:17 +0000 Mk/Scripts/cargo-crates-git-configure.awk: Generate the patch.crates-io section after parsing all the Cargo.toml files If we have multiple Cargo.toml files with the same crates in the [patch.crates-io] section we will end up with crates defined mutiple times and cargo will refuse to proceed. Write this section after parsing all the Cargo.toml files. PR: 273280 Reviewed by: tobik --- Mk/Scripts/cargo-crates-git-configure.awk | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Mk/Scripts/cargo-crates-git-configure.awk b/Mk/Scripts/cargo-crates-git-configure.awk index ade8718e44f6..bb2884479d22 100644 --- a/Mk/Scripts/cargo-crates-git-configure.awk +++ b/Mk/Scripts/cargo-crates-git-configure.awk @@ -90,8 +90,8 @@ function find_replaced_crates(input, output, in_patch_crates_io, line, cols) { close(output) } -function add_crates_io_patches( header_printed, cmd, cargotoml, source, crates) { - header_printed = 0 +function add_crates_io_patches( print_header, local_crates, cmd, cargotoml, source, crates) { + print_header = 0 # --exclude-dir not supported on FreeBSD < 13 # cmd = GREP " --include='*/Cargo.toml' --exclude-dir='" CARGO_VENDOR_DIR "' -Flr 'patch.crates-io' " WRKSRC cmd = FIND " " WRKSRC " -name Cargo.toml -not -path '" CARGO_VENDOR_DIR "/*' -exec " GREP " -Flr 'patch.crates-io' {} \\\+" @@ -106,16 +106,20 @@ function add_crates_io_patches( header_printed, cmd, cargotoml, source, crates) split(source_crates[source], crates) for (j in crates) { if (replaced_crates[crates[j]]) { - if (!header_printed) { - printf("[patch.crates-io]\n") - header_printed = 1 - } - printf("%s = { path = '%s' }\n", crates[j], get_source_dir(source, crates[j])) + print_header = 1 + local_crates[crates[j]] = get_source_dir(source, crates[j]) } } } } } + if (print_header == 1) { + printf("[patch.crates-io]\n") + + for (i in local_crates) { + printf("%s = { path = '%s' }\n", i, local_crates[i]) + } + } close(cmd) }