diff options
author | Michael Hope <michael.hope@linaro.org> | 2010-09-11 21:36:24 +1200 |
---|---|---|
committer | Michael Hope <michael.hope@linaro.org> | 2010-09-11 21:36:24 +1200 |
commit | 5a82a4186134981c85f6f4d8b45d735cbb3a6997 (patch) | |
tree | 7f58de06ed715950bf39a232bf0c228e4e610873 | |
parent | 74191d48cafb6a3995999b019764607eb1608cbb (diff) |
Pulled fetching out into a function with stamps to prevent extra download checks.
-rwxr-xr-x | summon-arm-toolchain | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/summon-arm-toolchain b/summon-arm-toolchain index 9dc59a4..6e2748f 100755 --- a/summon-arm-toolchain +++ b/summon-arm-toolchain @@ -35,6 +35,15 @@ GCCFLAGS= GDBFLAGS= BINUTILFLAGS= +# Fetch a versioned file from a URL +function fetch { + if [ ! -e ${STAMPS}/$1.fetch ]; then + echo "Downloading $1 sources..." + wget -c --no-passive-ftp $2 + touch ${STAMPS}/$1.fetch + fi +} + case "$(uname)" in Linux) echo "Found Linux OS." @@ -56,17 +65,10 @@ mkdir -p ${STAMPS} ${SOURCES} cd ${SOURCES} -echo "Downloading binutils sources..." -wget -c http://ftp.gnu.org/gnu/binutils/${BINUTILS}.tar.bz2 - -echo "Downloading gcc sources..." -wget -c http://ftp.gnu.org/gnu/gcc/${GCC}/${GCC}.tar.bz2 - -echo "Downloading newlib sources..." -wget -c --no-passive-ftp ftp://sources.redhat.com/pub/newlib/${NEWLIB}.tar.gz - -echo "Downloading gdb sources..." -wget -c http://ftp.gnu.org/gnu/gdb/${GDB}.tar.bz2 +fetch ${BINUTILS} http://ftp.gnu.org/gnu/binutils/${BINUTILS}.tar.bz2 +fetch ${GCC} ${GCC_URL} +fetch ${NEWLIB} ftp://sources.redhat.com/pub/newlib/${NEWLIB}.tar.gz +fetch ${GDB} http://ftp.gnu.org/gnu/gdb/${GDB}.tar.bz2 if [ ${LIBSTM32_EN} != 0 ]; then if [ ! -e libcmsis-${LIBCMSIS}.tar.bz2 ]; then |