Index: Mk/Uses/cargo.mk =================================================================== --- Mk/Uses/cargo.mk +++ Mk/Uses/cargo.mk @@ -34,10 +34,20 @@ CARGO_DIST_SUBDIR?= rust/crates # Generate list of DISTFILES. +# Prefer canonical file extension .crate going forward +.if make(makesum) +CARGO_CRATE_EXT= .crate +.else +# If there is a rust/crates/*.tar.gz in distinfo keep using the old +# extension. We need to delay eval until the last moment for +# DISTINFO_FILE. We cache the command output to avoid multiple +# slow grep runs for every CARGO_CRATE_EXT access. +CARGO_CRATE_EXT= ${defined(_CARGO_CRATE_EXT_CACHE):?${_CARGO_CRATE_EXT_CACHE}:${:!if ${GREP} -q '\(${CARGO_DIST_SUBDIR}/.*\.tar\.gz\)' "${DISTINFO_FILE}" 2>/dev/null; then echo .tar.gz; else echo .crate; fi!:_=_CARGO_CRATE_EXT_CACHE}} +.endif .for _crate in ${CARGO_CRATES} # Resolving CRATESIO alias is very inefficient with many MASTER_SITES, consume MASTER_SITE_CRATESIO directly MASTER_SITES+= ${MASTER_SITE_CRATESIO:S,%SUBDIR%,${_crate:C/^([-_a-zA-Z0-9]+)-[0-9].*/\1/}/${_crate:C/^[-_a-zA-Z0-9]+-([0-9].*)/\1/},:S,$,:cargo_${_crate:C/[^a-zA-Z0-9_]//g},} -DISTFILES+= ${CARGO_DIST_SUBDIR}/${_crate}.tar.gz:cargo_${_crate:C/[^a-zA-Z0-9_]//g} +DISTFILES+= ${CARGO_DIST_SUBDIR}/${_crate}${CARGO_CRATE_EXT}:cargo_${_crate:C/[^a-zA-Z0-9_]//g} .endfor # Build dependencies. @@ -211,7 +221,7 @@ .for _crate in ${CARGO_CRATES} @${MV} ${WRKDIR}/${_crate} ${CARGO_VENDOR_DIR}/${_crate} @${PRINTF} '{"package":"%s","files":{}}' \ - $$(${SHA256} -q ${DISTDIR}/${CARGO_DIST_SUBDIR}/${_crate}.tar.gz) \ + $$(${SHA256} -q ${DISTDIR}/${CARGO_DIST_SUBDIR}/${_crate}${CARGO_CRATE_EXT}) \ > ${CARGO_VENDOR_DIR}/${_crate}/.cargo-checksum.json @if [ -r ${CARGO_VENDOR_DIR}/${_crate}/Cargo.toml.orig ]; then \ ${MV} ${CARGO_VENDOR_DIR}/${_crate}/Cargo.toml.orig \ Index: devel/cargo-c/Makefile =================================================================== --- devel/cargo-c/Makefile +++ devel/cargo-c/Makefile @@ -4,7 +4,7 @@ CATEGORIES= devel MASTER_SITES= CRATESIO # XXX Teach USES=cargo to have proper default -DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${EXTRACT_SUFX} +DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${CARGO_CRATE_EXT} MAINTAINER= jbeich@FreeBSD.org COMMENT= Cargo C-ABI helpers Index: devel/desed/Makefile =================================================================== --- devel/desed/Makefile +++ devel/desed/Makefile @@ -3,7 +3,7 @@ PORTREVISION= 6 CATEGORIES= devel MASTER_SITES= CRATESIO -DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${EXTRACT_SUFX} +DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${CARGO_CRATE_EXT} MAINTAINER= yuri@FreeBSD.org COMMENT= Demystify and debug sed scripts from the comfort of your terminal Index: devel/gbump/Makefile =================================================================== --- devel/gbump/Makefile +++ devel/gbump/Makefile @@ -3,7 +3,7 @@ PORTREVISION= 11 CATEGORIES= devel MASTER_SITES= CRATESIO -DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${EXTRACT_SUFX} +DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${CARGO_CRATE_EXT} MAINTAINER= nbari@tequila.io COMMENT= Git tag semantic version bumper Index: devel/racer/Makefile =================================================================== --- devel/racer/Makefile +++ devel/racer/Makefile @@ -4,7 +4,7 @@ DISTVERSION= 2.1.44 CATEGORIES= devel MASTER_SITES= CRATESIO -DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${EXTRACT_SUFX} +DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${CARGO_CRATE_EXT} MAINTAINER= rust@FreeBSD.org COMMENT= Rust code completion helper Index: devel/rust-bindgen/Makefile =================================================================== --- devel/rust-bindgen/Makefile +++ devel/rust-bindgen/Makefile @@ -4,7 +4,7 @@ MASTER_SITES= CRATESIO PKGNAMEPREFIX= rust- # XXX Teach USES=cargo to have proper default -DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${EXTRACT_SUFX} +DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${CARGO_CRATE_EXT} MAINTAINER= gecko@FreeBSD.org COMMENT= Generate Rust bindings from C (and some C++) code Index: devel/rust-cbindgen/Makefile =================================================================== --- devel/rust-cbindgen/Makefile +++ devel/rust-cbindgen/Makefile @@ -4,7 +4,7 @@ MASTER_SITES= CRATESIO PKGNAMEPREFIX= rust- # XXX Teach USES=cargo to have proper default -DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${EXTRACT_SUFX} +DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${CARGO_CRATE_EXT} MAINTAINER= gecko@FreeBSD.org COMMENT= Generate C bindings from Rust code Index: dns/doh-proxy/Makefile =================================================================== --- dns/doh-proxy/Makefile +++ dns/doh-proxy/Makefile @@ -5,7 +5,7 @@ PORTREVISION= 1 CATEGORIES= dns MASTER_SITES= CRATESIO -DISTFILES= ${DISTNAME}${EXTRACT_SUFX} +DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${CARGO_CRATE_EXT} MAINTAINER= mat@FreeBSD.org COMMENT= DNS-over-HTTP server proxy Index: dns/doh-proxy/distinfo =================================================================== --- dns/doh-proxy/distinfo +++ dns/doh-proxy/distinfo @@ -1,6 +1,6 @@ TIMESTAMP = 1614607864 -SHA256 (doh-proxy-0.3.8.tar.gz) = a92c4c48f6fdc42e8248669677b7378655a3f6629b23d086a18735879b638740 -SIZE (doh-proxy-0.3.8.tar.gz) = 16999 +SHA256 (rust/crates/doh-proxy-0.3.8.tar.gz) = a92c4c48f6fdc42e8248669677b7378655a3f6629b23d086a18735879b638740 +SIZE (rust/crates/doh-proxy-0.3.8.tar.gz) = 16999 SHA256 (rust/crates/ansi_term-0.11.0.tar.gz) = ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b SIZE (rust/crates/ansi_term-0.11.0.tar.gz) = 17087 SHA256 (rust/crates/anyhow-1.0.38.tar.gz) = afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1 Index: graphics/dssim/Makefile =================================================================== --- graphics/dssim/Makefile +++ graphics/dssim/Makefile @@ -4,7 +4,7 @@ CATEGORIES= graphics MASTER_SITES= CRATESIO # XXX Teach USES=cargo to have proper default -DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${EXTRACT_SUFX} +DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${CARGO_CRATE_EXT} MAINTAINER= jbeich@FreeBSD.org COMMENT= Image similarity comparison simulating human perception Index: multimedia/termplay/Makefile =================================================================== --- multimedia/termplay/Makefile +++ multimedia/termplay/Makefile @@ -3,7 +3,7 @@ PORTREVISION= 6 CATEGORIES= multimedia MASTER_SITES= CRATESIO -DISTFILES= ${DISTNAME}${EXTRACT_SUFX} +DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${CARGO_CRATE_EXT} MAINTAINER= yuri@FreeBSD.org COMMENT= Tool that converts images to ANSI sequences, plays videos in terminals Index: multimedia/termplay/distinfo =================================================================== --- multimedia/termplay/distinfo +++ multimedia/termplay/distinfo @@ -1,6 +1,6 @@ TIMESTAMP = 1596611248 -SHA256 (termplay-2.0.6.tar.gz) = 996343049484d479e980aad3659d096ad2665b8e8e7795332a431a99b97a67da -SIZE (termplay-2.0.6.tar.gz) = 20023 +SHA256 (rust/crates/termplay-2.0.6.tar.gz) = 996343049484d479e980aad3659d096ad2665b8e8e7795332a431a99b97a67da +SIZE (rust/crates/termplay-2.0.6.tar.gz) = 20023 SHA256 (rust/crates/adler32-1.0.4.tar.gz) = 5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2 SIZE (rust/crates/adler32-1.0.4.tar.gz) = 5105 SHA256 (rust/crates/ansi_term-0.11.0.tar.gz) = ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b Index: shells/starship/Makefile =================================================================== --- shells/starship/Makefile +++ shells/starship/Makefile @@ -3,7 +3,7 @@ PORTREVISION= 1 CATEGORIES= shells MASTER_SITES= CRATESIO -DISTFILES= ${DISTNAME}${EXTRACT_SUFX} +DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${CARGO_CRATE_EXT} MAINTAINER= yuri@FreeBSD.org COMMENT= Cross-shell prompt for astronauts Index: shells/starship/distinfo =================================================================== --- shells/starship/distinfo +++ shells/starship/distinfo @@ -1,6 +1,6 @@ TIMESTAMP = 1617081533 -SHA256 (starship-0.51.0.tar.gz) = f4d57fdd6c201a3115dd6122e0efc638388dea4d02634b92534513a2e7668b10 -SIZE (starship-0.51.0.tar.gz) = 160148 +SHA256 (rust/crates/starship-0.51.0.tar.gz) = f4d57fdd6c201a3115dd6122e0efc638388dea4d02634b92534513a2e7668b10 +SIZE (rust/crates/starship-0.51.0.tar.gz) = 160148 SHA256 (rust/crates/ahash-0.4.7.tar.gz) = 739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e SIZE (rust/crates/ahash-0.4.7.tar.gz) = 51474 SHA256 (rust/crates/aho-corasick-0.7.15.tar.gz) = 7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5 Index: sysutils/flowgger/Makefile =================================================================== --- sysutils/flowgger/Makefile +++ sysutils/flowgger/Makefile @@ -3,7 +3,7 @@ PORTREVISION= 4 CATEGORIES= sysutils MASTER_SITES= CRATESIO -DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${EXTRACT_SUFX} +DISTFILES= ${CARGO_DIST_SUBDIR}/${DISTNAME}${CARGO_CRATE_EXT} MAINTAINER= mikael@FreeBSD.org COMMENT= Fast data collector