From 0fb993cd2d6b470180d2524856190d0733a5d66b Mon Sep 17 00:00:00 2001 From: Cameron Nemo Date: Tue, 2 Aug 2022 14:57:56 -0700 Subject: [PATCH] xbps-src: fetch from CRAN archive CRAN has a lovely practice of moving the latest releases into an archive after a new release is made. So when pillar 1.6.0 is released, for example, version 1.5.1 gets moved into the archive. Add the CRAN archive as a mirror to handle this case. See below for an example: => R-cran-pillar-1.5.1_1: running do-fetch hook: 00-distfiles ... => R-cran-pillar-1.5.1_1: fetching distfile 'pillar_1.5.1.tar.gz' from 'https://cran.r-project.org/src/contrib/Archive/pillar'... --- common/environment/build-style/R-cran.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/environment/build-style/R-cran.sh b/common/environment/build-style/R-cran.sh index ded66793396b..1fbdb5af08c4 100644 --- a/common/environment/build-style/R-cran.sh +++ b/common/environment/build-style/R-cran.sh @@ -5,4 +5,10 @@ wrksrc="${XBPS_BUILDDIR}/${pkgname#R-cran-}" # default to cran if [ -z "$distfiles" ]; then distfiles="https://cran.r-project.org/src/contrib/${pkgname#R-cran-}_${version//r/-}.tar.gz" + # Old releases get put into archive, and removed from above location. + # Use the archive as a fallback to handle that case. + _archive="https://cran.r-project.org/src/contrib/Archive/${pkgname#R-cran-}" + if [[ "$XBPS_DISTFILES_MIRROR" != *"$_archive"* ]]; then + XBPS_DISTFILES_MIRROR+=" $_archive" + fi fi