From 9f5a92a783eb33430a3c8e5518e7e1c723fe3a15 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Wed, 11 Jan 2017 22:20:46 -0800 Subject: Unify fetching Linaro components. Add CT_GetLinaro, use it from gcc/binutils/gdb/glibc/newlib. Signed-off-by: Alexey Neyman --- scripts/functions | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'scripts/functions') diff --git a/scripts/functions b/scripts/functions index f687504d..35b38729 100644 --- a/scripts/functions +++ b/scripts/functions @@ -798,6 +798,40 @@ CT_GetFile() { return 1 } +# Get a component from Linaro archives. +# Usage: CT_GetLinaro +CT_GetLinaro() { + local comp="$1" + local version="$2" + local linaro_version + local yyyymm_p + local yymm + local base + + case "${version}" in + linaro-*) + linaro_version="${version#linaro-}" + ;; + *) + CT_Abort "Version ${version} is not a Linaro package" + ;; + esac + + # Recent releases reside in top of the directory tree; older releases + # are moved into the archive. Subdirectories are named differently + # in archive! + # In archive, some URLs also contain base component version + # (e.g. "gcc-linaro/4.9") while some do not (e.g. just "newlib-linaro"). + base="${linaro_version%%-*}" + # Strip base version, first two digits of the year and optional patchlevel + yymm="${linaro_version#*-??}" + yymm="${yymm%-*}" + CT_GetFile "${comp}-${version}" \ + "https://releases.linaro.org/components/toolchain/${comp}-linaro/${linaro_version}" \ + "https://releases.linaro.org/archive/${yymm}/components/toolchain/${comp}-linaro/${base}" \ + "https://releases.linaro.org/archive/${yymm}/components/toolchain/${comp}-linaro" +} + # Checkout from CVS, and build the associated tarball # The tarball will be called ${basename}.tar.bz2 # Prerequisite: either the server does not require password, -- cgit v1.2.3