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:           Fri Apr  4 21:29:22 UTC 2025

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

Log Message:
lang/rust/cargo.mk: Fix distfile URLs for `+' sub-versions.

For example, with curl-sys-0.4.75+curl-8.10.0, the URL should be

https://crates.io/api/v1/crates/curl-sys/0.4.75+curl-8.10.0/download

but the current logic instead produces

https://crates.io/api/v1/crates/curl-sys/8.10.0/download

which goes nowhere.

Proposed on tech-pkg@:
https://mail-index.NetBSD.org/tech-pkg/2025/03/16/msg030612.html


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 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.40 pkgsrc/lang/rust/cargo.mk:1.41
--- pkgsrc/lang/rust/cargo.mk:1.40      Sun Nov 24 16:13:42 2024
+++ pkgsrc/lang/rust/cargo.mk   Fri Apr  4 21:29:22 2025
@@ -1,4 +1,4 @@
-# $NetBSD: cargo.mk,v 1.40 2024/11/24 16:13:42 he Exp $
+# $NetBSD: cargo.mk,v 1.41 2025/04/04 21:29:22 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
@@ -33,7 +33,13 @@ CARGO_WRKSRC?=               ${WRKSRC}
 DISTFILES?=                    ${DEFAULT_DISTFILES}
 .for crate in ${CARGO_CRATE_DEPENDS}
 DISTFILES+=                    ${crate}.crate
+.  if ${crate:M*+*}
+# E.g., for `curl-sys-0.4.75+curl-8.10.0', we use the URL:
+# https://crates.io/api/v1/crates/curl-sys/0.4.77+curl-8.10.1/download
+SITES.${crate}.crate+=         -${MASTER_SITE_CRATESIO}${crate:C/-[0-9]+\.[0-9.]+.*$//}/${crate:C/^.*-([0-9]+\.[0-9.]+.*\+.*-[0-9]+\.[0-9]+.*)$/\1/}/download
+.  else
 SITES.${crate}.crate+=         -${MASTER_SITE_CRATESIO}${crate:C/-[0-9]+\.[0-9.]+.*$//}/${crate:C/^.*-([0-9]+\.[0-9.]+.*)$/\1/}/download
+.  endif
 EXTRACT_DIR.${crate}.crate?=   ${CARGO_VENDOR_DIR}
 .endfor
 



Home | Main Index | Thread Index | Old Index