update 2024-05-21 20:10:03

This commit is contained in:
actions-user 2024-05-21 20:10:03 +08:00
parent bff2f33388
commit 881a7368e3
2 changed files with 32 additions and 6 deletions

View File

@ -11,7 +11,7 @@ LUCI_DEPENDS:=+curl +opkg +luci-base +tar +coreutils +coreutils-stat +libuci-lua
LUCI_EXTRA_DEPENDS:=luci-lib-taskd (>=1.0.17) LUCI_EXTRA_DEPENDS:=luci-lib-taskd (>=1.0.17)
LUCI_PKGARCH:=all LUCI_PKGARCH:=all
PKG_VERSION:=0.1.14-3 PKG_VERSION:=0.1.16-1
# PKG_RELEASE MUST be empty for luci.mk # PKG_RELEASE MUST be empty for luci.mk
PKG_RELEASE:= PKG_RELEASE:=

View File

@ -7,7 +7,10 @@ DL_DIR=${IS_ROOT}/tmp/dl
LISTS_DIR_O=/tmp/opkg-lists LISTS_DIR_O=/tmp/opkg-lists
LISTS_DIR=${IS_ROOT}${LISTS_DIR_O} LISTS_DIR=${IS_ROOT}${LISTS_DIR_O}
OPKG_CONF_DIR=${IS_ROOT}/etc/opkg OPKG_CONF_DIR=${IS_ROOT}/etc/opkg
OPKG_CONF_DIR_M=${IS_ROOT}/etc/opkg_m
FEEDS_SERVER=https://istore.linkease.com/repo FEEDS_SERVER=https://istore.linkease.com/repo
FEEDS_SERVER_MIRRORS="https://repo.istoreos.com/repo"
DISABLE_MIRROR=false
ARCH=`sed -n -e 's/^Architecture: *\([^ ]\+\) *$/\1/p' /rom/usr/lib/opkg/info/libc.control /usr/lib/opkg/info/libc.control 2>/dev/null | head -1` ARCH=`sed -n -e 's/^Architecture: *\([^ ]\+\) *$/\1/p' /rom/usr/lib/opkg/info/libc.control /usr/lib/opkg/info/libc.control 2>/dev/null | head -1`
# for istore self upgrade # for istore self upgrade
@ -39,10 +42,33 @@ opkg_wrap() {
OPKG_CONF_DIR=${OPKG_CONF_DIR} opkg -f ${IS_ROOT}/etc/opkg.conf "$@" OPKG_CONF_DIR=${OPKG_CONF_DIR} opkg -f ${IS_ROOT}/etc/opkg.conf "$@"
} }
fcurl() { opkg_wrap_mirrors() {
curl --fail --show-error "$@" local server
local file
if ! $DISABLE_MIRROR; then
for server in $FEEDS_SERVER_MIRRORS ; do
rm -rf "${OPKG_CONF_DIR_M}" 2>/dev/null
mkdir -p "${OPKG_CONF_DIR_M}" 2>/dev/null
ls "${OPKG_CONF_DIR}/" | while read; do
file="$REPLY"
if [ -f "${OPKG_CONF_DIR}/$file" -a "${file: -5}" = ".conf" ]; then
sed "s#$FEEDS_SERVER/#$server/#g" "${OPKG_CONF_DIR}/$file" >"${OPKG_CONF_DIR_M}/$file"
touch -r "${OPKG_CONF_DIR}/$file" "${OPKG_CONF_DIR_M}/$file" 2>/dev/null
else
cp -a "${OPKG_CONF_DIR}/$file" "${OPKG_CONF_DIR_M}/"
fi
done
echo "Try mirror server $server"
OPKG_CONF_DIR=${OPKG_CONF_DIR_M} opkg -f ${IS_ROOT}/etc/opkg.conf "$@" && return 0
done
DISABLE_MIRROR=true
fi
echo "Try origin server $FEEDS_SERVER"
OPKG_CONF_DIR=${OPKG_CONF_DIR} opkg -f ${IS_ROOT}/etc/opkg.conf "$@"
} }
alias fcurl='curl -L --fail --show-error'
check_space() { check_space() {
local free="$((`stat -c '%a * %S' -f /` >> 20 ))" local free="$((`stat -c '%a * %S' -f /` >> 20 ))"
if [ "$free" -lt 1 ]; then if [ "$free" -lt 1 ]; then
@ -140,10 +166,10 @@ step_upgrade() {
fi fi
done done
if [ -n "$pkgs" ]; then if [ -n "$pkgs" ]; then
opkg_wrap upgrade $pkgs || return 1 opkg_wrap_mirrors upgrade $pkgs || return 1
fi fi
if [ -n "$metapkg" ]; then if [ -n "$metapkg" ]; then
opkg_wrap upgrade $metapkg || return 1 opkg_wrap_mirrors upgrade $metapkg || return 1
fi fi
return 0 return 0
} }
@ -186,7 +212,7 @@ case $action in
;; ;;
"install") "install")
check_space check_space
wrapped_in_update opkg_wrap install "$@" wrapped_in_update opkg_wrap_mirrors install "$@"
;; ;;
"upgrade") "upgrade")
new_upgrade "$@" new_upgrade "$@"