Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Feb 2019 12:04:50 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r492993 - in head/Mk: . Uses
Message-ID:  <201902151204.x1FC4oto077513@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Fri Feb 15 12:04:50 2019
New Revision: 492993
URL: https://svnweb.freebsd.org/changeset/ports/492993

Log:
  Add a CRATESIO entry for crates.io to bsd.sites.mk
  
  Switch cargo.mk over to it.
  
  Differential Revision:	https://reviews.freebsd.org/D19133

Modified:
  head/Mk/Uses/cargo.mk
  head/Mk/bsd.sites.mk

Modified: head/Mk/Uses/cargo.mk
==============================================================================
--- head/Mk/Uses/cargo.mk	Fri Feb 15 11:24:01 2019	(r492992)
+++ head/Mk/Uses/cargo.mk	Fri Feb 15 12:04:50 2019	(r492993)
@@ -30,15 +30,12 @@ CARGO_VENDOR_DIR?=	${WRKSRC}/cargo-crates
 CARGO_CARGOTOML?=	${WRKSRC}/Cargo.toml
 CARGO_CARGOLOCK?=	${WRKSRC}/Cargo.lock
 
-# Define MASTER_SITES_CRATESIO for crates.io
-MASTER_SITES_CRATESIO=	https://crates.io/api/v1/crates
-
 # Save crates inside ${DISTDIR}/rust/crates by default.
 CARGO_DIST_SUBDIR?=	rust/crates
 
 # Generate list of DISTFILES.
 .for _crate in ${CARGO_CRATES}
-MASTER_SITES+=	${MASTER_SITES_CRATESIO}/${_crate:C/^(.*)-[0-9].*/\1/}/${_crate:C/^.*-([0-9].*)/\1/}/download?dummy=/:cargo_${_crate:S/-//g:S/.//g}
+MASTER_SITES+=	CRATESIO/${_crate:C/^(.*)-[0-9].*/\1/}/${_crate:C/^.*-([0-9].*)/\1/}:cargo_${_crate:S/-//g:S/.//g}
 DISTFILES+=	${CARGO_DIST_SUBDIR}/${_crate}.tar.gz:cargo_${_crate:S/-//g:S/.//g}
 .endfor
 

Modified: head/Mk/bsd.sites.mk
==============================================================================
--- head/Mk/bsd.sites.mk	Fri Feb 15 11:24:01 2019	(r492992)
+++ head/Mk/bsd.sites.mk	Fri Feb 15 12:04:50 2019	(r492993)
@@ -130,6 +130,10 @@ MASTER_SITE_CRAN+= \
 MASTER_SITE_CRAN_ARCHIVE+= ${MASTER_SITE_CRAN:S,$,Archive/${PORTNAME}/,}
 .endif
 
+.if !defined(IGNORE_MASTER_SITE_CRATESIO)
+MASTER_SITE_CRATESIO+=	https://crates.io/api/v1/crates/%SUBDIR%/download?dummy=/
+.endif
+
 .if !defined(IGNORE_MASTER_SITE_DEBIAN)
 MASTER_SITE_DEBIAN+= \
 	http://cdn.debian.net/debian/%SUBDIR%/ \
@@ -1240,6 +1244,7 @@ MASTER_SITES_SUBDIRS=	APACHE_COMMONS_BINARIES:${PORTNA
 			APACHE_JAKARTA:${PORTNAME:S,-,/,}/source \
 			BERLIOS:${PORTNAME:tl}.berlios \
 			CHEESESHOP:source/${DISTNAME:C/(.).*/\1/}/${DISTNAME:S/-${DISTVERSIONFULL}$//} \
+			CRATESIO:${PORTNAME}/${DISTVERSIONFULL} \
 			DEBIAN:pool/main/${PORTNAME:C/^((lib)?.).*$/\1/}/${PORTNAME} \
 			FARSIGHT:${PORTNAME} \
 			FESTIVAL:${PORTVERSION} \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902151204.x1FC4oto077513>