Browse Source

Look for already downloaded files in DISTDIR (/var/cache/destfiles)

buildbot.dabbelt.com recently failed because it was unable to fetch
the downloaded files fast enough because mirrors.kernel.org was being
slow.  This patch allows me to cache the downloaded files somewhere to
avoid these sorts of network problems.

This should also be generally useful for other people who build the
toolchain regularly.
pull/32/head
Palmer Dabbelt 11 years ago
parent
commit
ebf58cc308
  1. 3
      Makefile.in

3
Makefile.in

@ -8,6 +8,7 @@ binutils_version := 2.25
glibc_version := 2.21
newlib_version := 1.18.0
DISTDIR ?= /var/cache/distfiles
GNU_MIRROR := http://mirrors.kernel.org/gnu
gcc_url := $(GNU_MIRROR)/gcc/gcc-$(gcc_version)/gcc-$(gcc_version).tar.gz
binutils_url := $(GNU_MIRROR)/binutils/binutils-$(binutils_version).tar.gz
@ -32,7 +33,7 @@ linux: stamps/build-gcc-linux-stage2
$(addprefix src/original-,$(PACKAGES)):
mkdir -p src
rm -rf $@ $(subst original-,,$@)-*
cd src && @FETCHER@ $($(subst src/original-,,$@)_url) | tar zxf -
cd src && (cat $(DISTDIR)/$(subst src/original-,,$@)-$($(subst src/original-,,$@)_version).tar.gz || @FETCHER@ $($(subst src/original-,,$@)_url)) | tar zxf -
mv $(subst original-,,$@)-$($(subst src/original-,,$@)_version) $@
$(addprefix src/,$(PACKAGES)): src/%: src/original-%

Loading…
Cancel
Save