diff options
author | Alexey Neyman <stilor@att.net> | 2017-01-13 09:53:27 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-13 09:53:27 -0800 |
commit | cbb045ab333df1047a6a9851c19c4b0b61442011 (patch) | |
tree | 0e886b4bcf6f54c9cb3b273c9ac511585f3959f6 /scripts/functions | |
parent | e282fd5551b35cba0c09b92efbe6fa17af7f80a8 (diff) | |
parent | 9f5a92a783eb33430a3c8e5518e7e1c723fe3a15 (diff) | |
download | crosstool-ng-cbb045ab333df1047a6a9851c19c4b0b61442011.tar.gz crosstool-ng-cbb045ab333df1047a6a9851c19c4b0b61442011.tar.bz2 crosstool-ng-cbb045ab333df1047a6a9851c19c4b0b61442011.zip |
Merge pull request #525 from stilor/linaro-download-location
Fix Linaro download locations
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 34 |
1 files changed, 34 insertions, 0 deletions
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 <component> <version> +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, |