summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/Makefile10
-rwxr-xr-xbuild/f_isoroot/f_repobuild/select_ubuntu_repo.sh4
2 files changed, 9 insertions, 5 deletions
diff --git a/build/Makefile b/build/Makefile
index c8fc79385..d4b981a9d 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -51,9 +51,13 @@ export REPOINFO := $(BUILD_BASE)/repo_info.sh
# Use snapshots
# Use nearby repositories
-export MIRROR_UBUNTU_URL := $(shell ./f_isoroot/f_repobuild/select_ubuntu_repo.sh --url)
-export MIRROR_UBUNTU := $(shell echo "$(MIRROR_UBUNTU_URL)" | cut -d'/' -f3 )
-export MIRROR_UBUNTU_ROOT := $(shell echo -n '/' ; echo "$(MIRROR_UBUNTU_URL)" | cut -d'/' -f4-)
+export MIRROR_UBUNTU_URL ?= $(shell ./f_isoroot/f_repobuild/select_ubuntu_repo.sh)
+export MIRROR_UBUNTU ?= $(shell echo "$(MIRROR_UBUNTU_URL)" | cut -d'/' -f3 )
+export MIRROR_UBUNTU_ROOT ?= $(shell echo -n '/' ; echo "$(MIRROR_UBUNTU_URL)" | cut -d'/' -f4-)
+ifeq (,$(MIRROR_UBUNTU_URL))
+$(warning $(shell ./f_isoroot/f_repobuild/select_ubuntu_repo.sh -d))
+$(error No sane Ubuntu mirror available)
+endif
export LATEST_MIRROR_ID_URL := http://$(shell ./select_closest_fuel_mirror.py)
diff --git a/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh b/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh
index 24bd42234..5618eb79b 100755
--- a/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh
+++ b/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh
@@ -69,14 +69,14 @@ if [ "$1" == "-d" ]; then
fi
# Hardcode for testing purposes
-DEBUG=1
+# DEBUG=1
TMPFILE=$(mktemp /tmp/mirrorsXXXXX)A
trap cleanup exit
# Generate a list of mirrors considered as "up"
curl -s https://launchpad.net/ubuntu/+archivemirrors | \
- grep -P -B8 "statusUP|statusSIX" | \
+ grep -P -B8 "statusUP|statusONE|statusSIX" | \
grep -o -P "(f|ht)tp.*\"" | \
sed 's/"$//' | sort | uniq > $TMPFILE