diff --git a/luci-app-store/Makefile b/luci-app-store/Makefile index 10713823..6cbe3a4e 100644 --- a/luci-app-store/Makefile +++ b/luci-app-store/Makefile @@ -13,7 +13,7 @@ LUCI_DEPENDS+=$(if $(CONFIG_USE_APK),+apk +luci-compat,+opkg) LUCI_EXTRA_DEPENDS:=luci-lib-taskd (>=1.0.19) LUCI_PKGARCH:=all -PKG_VERSION:=0.2.0-r1 +PKG_VERSION:=0.2.0-r2 # PKG_RELEASE MUST be empty for luci.mk PKG_RELEASE:= diff --git a/luci-app-store/root/usr/libexec/istore/mirror-bin/curl b/luci-app-store/root/usr/libexec/istore/mirror-bin/curl index 80335d67..dbe9d3fc 100755 --- a/luci-app-store/root/usr/libexec/istore/mirror-bin/curl +++ b/luci-app-store/root/usr/libexec/istore/mirror-bin/curl @@ -7,10 +7,18 @@ export PATH="$newpath" # if url starts with $IS_ORIG_SERVER, replace it with $IS_MIRROR_SERVER if [ -n "$IS_ORIG_SERVER" ] && [ -n "$IS_MIRROR_SERVER" ]; then - for i in "$@"; do - if [[ "$i" == "$IS_ORIG_SERVER"* ]]; then - set -- "${@/$i/$IS_MIRROR_SERVER${i#$IS_ORIG_SERVER}}" - fi + n=$# + while [ "$n" -gt 0 ]; do + i="$1" + shift + case "$i" in + "$IS_ORIG_SERVER"/*.apk|\ + "$IS_ORIG_SERVER"/*.ipk) + i="$IS_MIRROR_SERVER/${i#$IS_ORIG_SERVER/}" + ;; + esac + set -- "$@" "$i" + n=$((n - 1)) done fi export -n IS_ORIG_SERVER IS_MIRROR_SERVER diff --git a/luci-app-store/root/usr/libexec/istore/mirror-bin/wget b/luci-app-store/root/usr/libexec/istore/mirror-bin/wget index 62cf8f38..c3446518 100755 --- a/luci-app-store/root/usr/libexec/istore/mirror-bin/wget +++ b/luci-app-store/root/usr/libexec/istore/mirror-bin/wget @@ -7,10 +7,18 @@ export PATH="$newpath" # if url starts with $IS_ORIG_SERVER, replace it with $IS_MIRROR_SERVER if [ -n "$IS_ORIG_SERVER" ] && [ -n "$IS_MIRROR_SERVER" ]; then - for i in "$@"; do - if [[ "$i" == "$IS_ORIG_SERVER"* ]]; then - set -- "${@/$i/$IS_MIRROR_SERVER${i#$IS_ORIG_SERVER}}" - fi + n=$# + while [ "$n" -gt 0 ]; do + i="$1" + shift + case "$i" in + "$IS_ORIG_SERVER"/*.apk|\ + "$IS_ORIG_SERVER"/*.ipk) + i="$IS_MIRROR_SERVER/${i#$IS_ORIG_SERVER/}" + ;; + esac + set -- "$@" "$i" + n=$((n - 1)) done fi export -n IS_ORIG_SERVER IS_MIRROR_SERVER