git: 7fb087ab6ed9 - main - Uses/cargo: Try to simplify cargo-crates-merge usage

From: Tobias Kortkamp <tobik_at_FreeBSD.org>
Date: Sat, 23 Apr 2022 07:49:24 UTC
The branch main has been updated by tobik:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7fb087ab6ed9ab8aa6e888c2ef77314cd057a631

commit 7fb087ab6ed9ab8aa6e888c2ef77314cd057a631
Author:     Tobias Kortkamp <tobik@FreeBSD.org>
AuthorDate: 2022-04-15 08:45:54 +0000
Commit:     Tobias Kortkamp <tobik@FreeBSD.org>
CommitDate: 2022-04-23 07:40:45 +0000

    Uses/cargo: Try to simplify cargo-crates-merge usage
    
    Always start with a clean work directory state and end with one
    too. Automatically run makesum too.
---
 Mk/Uses/cargo.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk
index 0e31eef26778..ed6d2c8cfc42 100644
--- a/Mk/Uses/cargo.mk
+++ b/Mk/Uses/cargo.mk
@@ -391,13 +391,15 @@ cargo-crates-licenses: configure
 # cargo-crates-merge will in-place update CARGO_CRATES in the port
 # based on the crates list from Cargo.lock.  If there is no Cargo.lock
 # for some reason, try and generate it first.
-cargo-crates-merge: cargo-crates-generate-lockfile
+cargo-crates-merge:
 	@if ! type portedit > /dev/null 2>&1; then \
 		${ECHO_MSG} "===> Please install \"ports-mgmt/portfmt\""; exit 1; \
 	fi
+	@${MAKE} clean cargo-crates-generate-lockfile
 	@f="${MASTERDIR}/Makefile"; [ -r "${MASTERDIR}/Makefile.crates" ] && f="${MASTERDIR}/Makefile.crates"; \
 		${_CARGO_AWK} ${SCRIPTSDIR}/cargo-crates.awk ${CARGO_CARGOLOCK} | \
 			portedit merge -i $$f; \
-		${ECHO_MSG} "CARGO_CRATES in $$f was updated"
+		${MAKE} clean makesum; \
+		${ECHO_MSG} "${DISTINFO_FILE} and CARGO_CRATES in $$f were updated";
 
 .endif