X-Git-Url: http://git.onelab.eu/?p=util-vserver.git;a=blobdiff_plain;f=Makefile;h=eab086dae7106ae89ce43363ec1a81f5a8cbc185;hp=d89b9669189c5f9934da9b6f5de4246af4da7c64;hb=HEAD;hpb=9a2ee3bdab6975de9d6643cf423f5c4894694e88 diff --git a/Makefile b/Makefile index d89b966..eab086d 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,12 @@ -# $Id$ -# $URL$ # WEBFETCH := wget SHA1SUM := sha1sum ALL += util-vserver -util-vserver-URL := http://build.planet-lab.org/third-party/util-vserver-0.30.216-pre2912.tar.bz2 -util-vserver-SHA1SUM := e0751e8ecb4b8661b1cadd294bfb6e68a2221d93 -util-vserver := $(notdir $(util-vserver-URL)) +util-vserver := util-vserver-0.30.216-pre3038.tar.bz2 +util-vserver-SHA1SUM := 9a0d784ea27422a480df9a3a65710fd27b1c0881 +util-vserver-URL1 := http://build.planet-lab.org/third-party/$(util-vserver) +util-vserver-URL2 := http://mirror.onelab.eu/third-party/$(util-vserver) all: $(ALL) .PHONY: all @@ -15,9 +14,11 @@ all: $(ALL) ############################## define download_target $(1): $($(1)) -.PHONY: $($(1)) +.PHONY: $(1) $($(1)): - @if [ ! -e "$($(1))" ] ; then echo "$(WEBFETCH) $($(1)-URL)" ; $(WEBFETCH) $($(1)-URL) ; fi + @if [ ! -e "$($(1))" ] ; then \ + { echo Using primary; echo "$(WEBFETCH) $($(1)-URL1)" ; $(WEBFETCH) $($(1)-URL1) ; } || \ + { echo Using secondary; echo "$(WEBFETCH) $($(1)-URL2)" ; $(WEBFETCH) $($(1)-URL2) ; } ; fi @if [ ! -e "$($(1))" ] ; then echo "Could not download source file: $($(1)) does not exist" ; exit 1 ; fi @if test "$$$$($(SHA1SUM) $($(1)) | awk '{print $$$$1}')" != "$($(1)-SHA1SUM)" ; then \ echo "sha1sum of the downloaded $($(1)) does not match the one from 'Makefile'" ; \