knows of 2 places where to pull sources in case of network outage at planet-lab.org
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Sun, 6 Nov 2011 12:01:39 +0000 (13:01 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Sun, 6 Nov 2011 12:01:39 +0000 (13:01 +0100)
Makefile
sources

index 4149dee..8249c4a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,4 @@
 #
-# $Id$
-# $URL$
-#
 CURL   ?= $(shell if test -f /usr/bin/curl ; then echo "curl -H Pragma: -O -R -S --fail --show-error" ; fi)
 WGET   ?= $(shell if test -f /usr/bin/wget ; then echo "wget -nd -m" ; fi)
 CLIENT ?= $(if $(CURL),$(CURL),$(if $(WGET),$(WGET)))
@@ -35,16 +32,21 @@ endif
 define get_sources_sha1
 $(shell cat sources 2>/dev/null | awk 'gensub("^.*/", "", 1, $$2) == "$@" { print $$1; exit; }')
 endef
-define get_sources_url
+define get_sources_url1
 $(shell cat sources 2>/dev/null | awk 'gensub("^.*/", "", 1, $$2) == "$@" { print $$2; exit; }')
 endef
+define get_sources_url2
+$(shell cat sources 2>/dev/null | awk 'gensub("^.*/", "", 1, $$2) == "$@" { print $$3; exit; }')
+endef
 SOURCEFILES := $(shell cat sources 2>/dev/null | awk '{ print gensub("^.*/", "", 1, $$2) }')
 SOURCE_RPM := $(firstword $(SOURCEFILES))
 
 sources: $(SOURCEFILES) $(TARGETS)
 
 $(SOURCEFILES): #FORCE
-       @if [ ! -e "$@" ] ; then echo "$(CLIENT) $(get_sources_url)" ; $(CLIENT) $(get_sources_url) ; fi
+       @if [ ! -e "$@" ] ; then \
+        { echo Using primary; echo "$(CLIENT) $(get_sources_url1)" ; $(CLIENT) $(get_sources_url1) ; } || \
+        { echo Using secondary; echo "$(CLIENT) $(get_sources_url2)" ; $(CLIENT) $(get_sources_url2) ; } ; fi
        @if [ ! -e "$@" ] ; then echo "Could not download source file: $@ does not exist" ; exit 1 ; fi
        @if test "$$(sha1sum $@ | awk '{print $$1}')" != "$(get_sources_sha1)" ; then \
            echo "sha1sum of the downloaded $@ does not match the one from 'sources' file" ; \
diff --git a/sources b/sources
index 3bf4952..e76ccb3 100644 (file)
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-6ff9ca24d2fb0bb8061d9b1b3598f9c2064c6d4b  http://build.planet-lab.org/third-party/kernel-2.6.32-131.0.15.el6.src.rpm
-e1f1c2d54325f128bf031bed791f08b2ddae988f  http://build.planet-lab.org/third-party/patch-2.6.32-131.0.15.el6-vs2.3.0.36.29.6.diff
+6ff9ca24d2fb0bb8061d9b1b3598f9c2064c6d4b  http://build.planet-lab.org/third-party/kernel-2.6.32-131.0.15.el6.src.rpm http://mirror.onelab.eu/third-party/kernel-2.6.32-131.0.15.el6.src.rpm
+e1f1c2d54325f128bf031bed791f08b2ddae988f  http://build.planet-lab.org/third-party/patch-2.6.32-131.0.15.el6-vs2.3.0.36.29.6.diff http://mirror.onelab.eu/third-party/patch-2.6.32-131.0.15.el6-vs2.3.0.36.29.6.diff