On Wed, 2022-07-06 at 02:24 +0200, Alessandro Barbieri wrote: > Il giorno mar 5 lug 2022 alle ore 09:16 Robert Greener > ha > scritto: > > To fix this, I propose to change SRC_URI to use either src/contrib > > or > > src/contrib/Archive (where old packages will be). However, the > > drawback > > of this is that we only use the main CRAN. As there are many > > mirrors to > > search, it would be impractial to search them all before searching > > the > > archive. > > I think all the changes are fine. > > The devmanual say: > > There are two valid cases for using thirdpartymirrors: > >    1. providing multiple download locations for mirror- or fetch- > restricted >    packages, >    2. dealing with upstreams that distribute their distfiles via a > network >    of mirrors without a primary download location or a bouncer > service. > > In any other case, the primary location must be used instead. The > distfiles > will be mirrored onto Gentoo infrastructure > ; > in that > case, the benefit to using third-party mirror list does not outweigh > the > burden of maintaining it. > > > So I think in this case we can drop the mirror list and go with the > hack of > listing both live and archive Anna (CyberTailor) (cc'd), made the point off list, that the multiple SRC_URIs as a backup is undefined in PMS, so it can't be relied on. We could get the sources directly in src_unpack (it may be better refactored into its own function, but just left as is for now). See the patch at the end. However, I don't really like this, as it makes the ebuild live, but it's not really a live ebuild. Also we lose the manifest... The other option would be to require an UPDATE_DATE variable to be set in the ebuilds, this could then be used like so:  SRC_URI="https://cran.microsoft.com/snapshot/${UPDATE_DATE}/src/contrib/${PN}_${PV}.tar.gz" Where UPDATE_DATE=YYYY-MM-DD. This is a service provided by Microsoft that snapshots CRAN everyday at midnight UTC. This link will always resolve. I think this might the easiest solution, though would require updating the ebuilds in dev-R/*. What do you think? diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass index aed8cce84..8a464c325 100644 --- a/eclass/R-packages.eclass +++ b/eclass/R-packages.eclass @@ -21,14 +21,14 @@ esac EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_postinst -SRC_URI="mirror://cran/src/contrib/${PN}_${PV}.tar.gz" HOMEPAGE="https://cran.r-project.org/package=${PN}" SLOT="0" DEPEND="dev-lang/R" RDEPEND="${DEPEND}" -BDEPEND="sys-apps/pkgcore" +BDEPEND="sys-apps/pkgcore net-misc/wget" +PROPERTIES="live" # @FUNCTION: _movelink # @INTERNAL @@ -45,9 +45,16 @@ _movelink() { # @FUNCTION: R-packages_src_unpack # @DESCRIPTION: -# function to unpack R packages into the right folder +# function to download and unpack R packages into the right folder R-packages_src_unpack() { - unpack ${A} + einfo "Trying live CRAN" + wget "https://cran.r-project.org/src/contrib/${PN}_${PV}.tar.gz" || { + einfo "Trying CRAN Archive" + wget "https://cran.r-project.org/src/contrib/Archive/${PN}/${PN}_${PV}.tar.gz" || die + } + + unpack "${WORKDIR}/${PN}_${PV}.tar.gz" + if [[ -d "${PN//_/.}" ]] && [[ ! -d "${P}" ]]; then mv "${PN//_/.}" "${P}" || die fi -- 2.35.1 -- Robert