From nobody Mon Oct 09 14:38:04 2023 X-Original-To: dev-commits-ports-all@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 4S41q10BGcz4wjBr; Mon, 9 Oct 2023 14:38:05 +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 4S41q06Hx5z3HW4; Mon, 9 Oct 2023 14:38:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696862284; 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=gCV3qN4lnWspphDD5egd7DNJ0olir3j4Qcl99fqhgRM=; b=kiyzNtS6OEaVuXYg28P8Vu5gniIA+48CcA858jmRFudgG2DquyBEY9sZUPNTbtORW/rgDY LsEaDUTS28xYcyTghF11OFB0RnV/RNH7LgZuuf6Gq8a2oiKNoRxx4u10XyyqIkugEwdJvX 0m9HuYf+MUb4pfjp7/i8OtQBJ7SMZ8ZXAPa2q1OtMzZcfSeO+Xt4itDDCi7PqyITwzBC1R B54eY+89C2OYzs7Rsd+mGKFz73PRLL9FgjMDrb8HGCsxb5r17Qx+Y5qB5rViEmd36CjOFp eSRkWq0T8TRlJhTGHP0krlVCyfXQD4p2I/8ltcBWiuy6D3t+LlxXO+LW3HZQGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696862284; a=rsa-sha256; cv=none; b=WQO+rySvnRpcYrGJjSB6eox8L1/JqAeT/ZUzg4tslR+RuCFZsoHxZYPXPqz6BJa9hZHLOX ofeT5Ry3qQ1qecepB6m3wfuepQZBblu7FP8+cp039vGPShVh9p6sOx6tTQfgqhCqefUOhS JgxcsSFdUlEBZxy/aHo0tJhd1xzB2xDdDcCUDZeyNAHw2SB+ST/Dvz4Df0FSgEozC0uHyP 7gaWE72n5e/rhKm2HwhUTNXVXojmjGGdJoDwgEk8TUpv67EUiJfzSbNBVkd+wv0nkUc8Th dZs1dVC+OLkuk/ki8UFtZUFXKcx8MYgmJSu/ghlPnuttxPaKwlJCvpeVXVRI6A== 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=1696862284; 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=gCV3qN4lnWspphDD5egd7DNJ0olir3j4Qcl99fqhgRM=; b=cMQ0AMmzqg+LcWb6iYHZti8ODw9o6aYqaT8+UfS97aSW6SIovfSCmtgdr9n31iG1T6gXod HfJsCrE+cj36LW+GfaKkRsU4dgNaI76ZePhS2mxtgfrdExbm1axU9MgRdQnfAPQwaZExKm ANCdX7aI/Jf6k2zirGKDGGIg7IgXp5HyEh6nh5gQqtSanGbsxk16mmmVYocnLcejiRClTh aUgBGSA+2dzYHKJjEX/nhM6FzqkcUFx/4grrjKzXx9VPVrBtrOac02BJpd90fOttWFH43N zBVy3+Cc66QlchStKN/bmZRVGjiAoSfGVFPTQmbn/U5EJ+kDO54rRK2Qsnt9vQ== 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 4S41q05Ltlz107k; Mon, 9 Oct 2023 14:38:04 +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 399Ec4Of005643; Mon, 9 Oct 2023 14:38:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 399Ec45n005640; Mon, 9 Oct 2023 14:38:04 GMT (envelope-from git) Date: Mon, 9 Oct 2023 14:38:04 GMT Message-Id: <202310091438.399Ec45n005640@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Mikael Urankar Subject: git: 1e4912593433 - 2023Q4 - Mk/Scripts/cargo-crates-git-configure.awk: Generate the patch.crates-io section after parsing all the Cargo.toml files List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@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/2023Q4 X-Git-Reftype: branch X-Git-Commit: 1e49125934332178017a2508fa182865b47d890f Auto-Submitted: auto-generated The branch 2023Q4 has been updated by mikael: URL: https://cgit.FreeBSD.org/ports/commit/?id=1e49125934332178017a2508fa182865b47d890f commit 1e49125934332178017a2508fa182865b47d890f Author: Mikael Urankar AuthorDate: 2023-10-08 16:36:11 +0000 Commit: Mikael Urankar CommitDate: 2023-10-09 14:38:00 +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 (cherry picked from commit 8fae936cf5a65db050d6b0950a912a4f028e34d8) --- 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) }