summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-01-03 23:07:13 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-01-04 19:39:07 -0500
commit403b4f20e5cfd2d2c0348de076effd3ddb616844 (patch)
tree99032ddbbbe9b80dcb4362d3736d692a692fcf7e /src
parentf1487a80edac9e8f651f7bf2970e8fa4d2a9e971 (diff)
librefetch: replace MIRROR with MIRRORS (but doesn't update the docs)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/librefetch/librefetch16
-rw-r--r--src/librefetch/librefetch.conf5
2 files changed, 16 insertions, 5 deletions
diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch
index 3d7f667..61fc3ad 100755
--- a/src/librefetch/librefetch
+++ b/src/librefetch/librefetch
@@ -120,7 +120,7 @@ main() {
local dst="${extra_opts[1]:-${src##*/}}"
# Don't canonicalize $src unless mode =~ download, and we've validated
- # that $MIRROR is configured.
+ # that $MIRRORS is configured.
# Canonicalize $dst
dst="$(readlink -m -- "$dst")"
@@ -129,15 +129,23 @@ main() {
if [[ $mode =~ download ]]; then
load_files librefetch
- check_vars librefetch MIRROR DOWNLOADER || return 1
+ check_vars librefetch MIRRORS DOWNLOADER || return 1
# Canonicalize $src
if [[ "$src" == libre://* ]]; then
- src="${MIRROR}/${src#libre://}"
+ src="${MIRRORS[0]}/${src#libre://}"
fi
# check to see if $src is a candidate for create mode
- if [[ "$src" != "$MIRROR"* ]]; then
+ local inmirror=false;
+ local mirror
+ for mirror in "${MIRRORS[@]}"; do
+ if [[ "$src" == "$mirror"* ]]; then
+ inmirror=true
+ break
+ fi
+ done
+ if ! $inmirror; then
# inhibit create
mode=download
fi
diff --git a/src/librefetch/librefetch.conf b/src/librefetch/librefetch.conf
index ce328d8..6948e8d 100644
--- a/src/librefetch/librefetch.conf
+++ b/src/librefetch/librefetch.conf
@@ -1,2 +1,5 @@
-MIRROR='https://repo.parabolagnulinux.org/other/'
+MIRRORS=(
+ 'https://repo.parabolagnulinux.org/sources/'
+ 'https://repo.parabolagnulinux.org/other/'
+)
DOWNLOADER='/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'