tech-pkg archive

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

Re: cargo fetch



> Hi,
> 
> I've similar case as Adam:
> 
> Works over Browser / Doesn't work over wget
> https://crates.io/api/v1/crates/serde/1.0.0/download
> 
> But below one works over wget and Browser:
> https://static.crates.io/crates/serde/serde-1.0.0.crate
> 
> Need to drop email to them asking for the reason.
> 
> Thanks,

Good find! :)

My patch, which can be applied when Marcin gets the answer from crates.io:


% cvs diff -u lang/rust/cargo.mk mk/fetch/sites.mk 
Index: lang/rust/cargo.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/rust/cargo.mk,v
retrieving revision 1.46
diff -u -r1.46 cargo.mk
--- lang/rust/cargo.mk 3 May 2026 13:55:03 -0000 1.46
+++ lang/rust/cargo.mk 1 Jun 2026 12:24:29 -0000
@@ -31,7 +31,7 @@
 #
 # will fetch https://github.com/foo/bar/ revision 12345
  -MASTER_SITES?= -${MASTER_SITE_CRATESIO}${PKGBASE}/${PKGVERSION_NOREV}/download
+MASTER_SITES?= ${MASTER_SITE_CRATESIO}${PKGBASE}/
   CHECK_SSP_SUPPORTED= no
  @@ -58,13 +58,7 @@
   .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.]+.*\+.*)$/\1/}/download
-.  else
-SITES.${crate}.crate+= -${MASTER_SITE_CRATESIO}${crate:C/-[0-9]+\.[0-9.]+.*$//}/${crate:C/^.*-([0-9]+\.[0-9.]+.*)$/\1/}/download
-.  endif
+SITES.${crate}.crate+= -${MASTER_SITE_CRATESIO}${crate:C/-[0-9]+\.[0-9.]+.*$//}/${crate}.crate
 EXTRACT_DIR.${crate}.crate?= ${CARGO_VENDOR_DIR}
 .endfor
  Index: mk/fetch/sites.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/fetch/sites.mk,v
retrieving revision 1.202
diff -u -r1.202 sites.mk
--- mk/fetch/sites.mk 6 Jan 2026 14:32:43 -0000 1.202
+++ mk/fetch/sites.mk 1 Jun 2026 12:24:29 -0000
@@ -191,7 +191,7 @@
  https://hackage.haskell.org/package/
   MASTER_SITE_CRATESIO+= \
- https://crates.io/api/v1/crates/
+ https://static.crates.io/crates/
   # The primary backup site.
 MASTER_SITE_BACKUP?= \


Home | Main Index | Thread Index | Old Index