summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-18 17:10:26 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-18 17:10:26 (EDT)
commitb60f2eac850d71e600ae149515fd94f554e267ee (patch)
tree5b213c4cd779ff0c6d49bacb94162d5fe97c09aa
parentd5fd4c18501b79b73f7c249b4f562233a1e82440 (diff)
profile_select_mirror(): New function
-rw-r--r--lib/profile.sh5
-rw-r--r--lib/profiles/proteanos.sh19
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/profile.sh b/lib/profile.sh
index 6cb8386..40888ea 100644
--- a/lib/profile.sh
+++ b/lib/profile.sh
@@ -87,6 +87,11 @@ profile_validate_archplat()
return 1
}
+profile_select_mirror()
+{
+ "prof_${profile}_select_mirror"
+}
+
profile_feeds()
{
local arch="${1}"
diff --git a/lib/profiles/proteanos.sh b/lib/profiles/proteanos.sh
index 0cc6a81..a7946a5 100644
--- a/lib/profiles/proteanos.sh
+++ b/lib/profiles/proteanos.sh
@@ -68,6 +68,25 @@ prof_proteanos_default_plat()
printf 'dev\n'
}
+prof_proteanos_select_mirror()
+{
+ local rand=
+ local mirror=
+
+ rand=$(date '+%S')
+ rand=$(($rand % 2))
+ case ${rand} in
+ 0)
+ mirror='http://mirror.gnu.dk/pub/proteanos'
+ ;;
+ 1)
+ mirror='http://mirror.oss.maxcdn.com/proteanos'
+ ;;
+ esac
+
+ printf '%s\n' "${mirror}"
+}
+
prof_proteanos_feeds()
{
local arch="${1}"