aboutsummaryrefslogtreecommitdiffstats
path: root/build/f_isoroot/f_repobuild
diff options
context:
space:
mode:
authorMichal Skalski <mskalski@mirantis.com>2016-01-21 02:17:11 +0100
committerMichal Skalski <mskalski@mirantis.com>2016-01-21 16:16:35 +0100
commit394c79fe428faa9c50ed1db6d750b363b44130b9 (patch)
tree5d85301c6b29dfa34ac389d315d562a873b5c91b /build/f_isoroot/f_repobuild
parentf1cdd0c49d4495a59bd797ee7353cef816976d4a (diff)
Use mirrors snapshots
Add logic to fetch information about last suitable snapshot which can be used to download ubuntu packages. This is for example use to build community ISO [1]. This should help in case of snapshot switch [2]. [1] https://github.com/fuel-infra/jenkins-jobs/blob/master/servers/fuel-ci/8.0/builders/community.all.sh#L36-L40 [2] https://bugs.launchpad.net/fuel/+bug/1493390/comments/9 Change-Id: Id5a8d41278561473ea4844631bfefa0049e64dbc Signed-off-by: Michal Skalski <mskalski@mirantis.com>
Diffstat (limited to 'build/f_isoroot/f_repobuild')
-rwxr-xr-xbuild/f_isoroot/f_repobuild/select_ubuntu_repo.sh28
1 files changed, 25 insertions, 3 deletions
diff --git a/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh b/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh
index cb05fe136..992359afd 100755
--- a/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh
+++ b/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh
@@ -11,6 +11,19 @@ RSYNC="rsync -4 --contimeout 5 --no-motd --list-only"
# local mirror can be found after four attempts, the default archive
# is returned instead.
+return_url=0
+
+while [ "$1" != "" ]; do
+ case $1 in
+ -u | --url ) shift
+ return_url=1
+ ;;
+ # Shift all the parameters down by one
+ esac
+ shift
+done
+
+
cnt=0
while [ $cnt -lt 4 ]
do
@@ -21,13 +34,22 @@ do
then
if ! $RSYNC "${host}::ubuntu/Archive-Update-in-Progress*" &> /dev/null
then
- echo "$host"
- exit 0
+ if [ "$return_url" = "1" ]; then
+ echo "$url"
+ exit 0
+ else
+ echo "$host"
+ exit 0
+ fi
fi
fi
done
cnt=$[cnt + 1]
sleep 15
done
-echo "archive.ubuntu.com"
+if [ "$return_url" = "1" ]; then
+ echo "http://archive.ubuntu.com/ubuntu/"
+else
+ echo "archive.ubuntu.com"
+fi