pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang/rust



Module Name:    pkgsrc
Committed By:   riastradh
Date:           Tue Nov 10 14:40:37 UTC 2026

Modified Files:
        pkgsrc/lang/rust: cargo.mk

Log Message:
lang/rust/cargo.mk: Make cargo-vendor-crates recipe more robust.

1. Fail if digest command fails for any reason.
2. Don't leave each final .json file around if interrupted.

No functional change intended in the success case.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 pkgsrc/lang/rust/cargo.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/rust/cargo.mk
diff -u pkgsrc/lang/rust/cargo.mk:1.50 pkgsrc/lang/rust/cargo.mk:1.51
--- pkgsrc/lang/rust/cargo.mk:1.50      Tue Nov 10 13:42:40 2026
+++ pkgsrc/lang/rust/cargo.mk   Tue Nov 10 14:40:37 2026
@@ -1,4 +1,4 @@
-# $NetBSD: cargo.mk,v 1.50 2026/11/10 13:42:40 riastradh Exp $
+# $NetBSD: cargo.mk,v 1.51 2026/11/10 14:40:37 riastradh Exp $
 #
 # Common logic that can be used by packages that depend on cargo crates
 # from crates.io. This lets existing pkgsrc infrastructure fetch and verify
@@ -77,9 +77,11 @@ cargo-vendor-crates:
        ${RUN}${PRINTF} "[source.crates-io]\nreplace-with = \"vendored-sources\"\n[source.vendored-sources]\ndirectory = \"${CARGO_VENDOR_DIR}\"\n" > ${WRKDIR}/.cargo/config.toml
        ${RUN}${MKDIR} ${CARGO_VENDOR_DIR}
 .for crate in ${CARGO_CRATE_DEPENDS}
-       ${RUN}${PRINTF} '{"package":"%s","files":{}}'   \
-         `${DIGEST} sha256 < ${_DISTDIR}/${crate}.crate` \
-         > ${CARGO_VENDOR_DIR}/${crate}/.cargo-checksum.json
+       ${RUN}digest=`${DIGEST} sha256 < ${_DISTDIR}/${crate}.crate` && \
+         ${PRINTF} '{"package":"%s","files":{}}' "$$digest" \
+           > ${CARGO_VENDOR_DIR}/${crate}/.cargo-checksum.json.tmp && \
+         ${MV} ${CARGO_VENDOR_DIR}/${crate}/.cargo-checksum.json.tmp \
+           ${CARGO_VENDOR_DIR}/${crate}/.cargo-checksum.json
 .endfor
 
 # Legacy name



Home | Main Index | Thread Index | Old Index