mirror of
https://github.com/kenzok8/small-package.git
synced 2026-02-04 13:57:45 +08:00
update 2026-01-21 11:29:13
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-amlogic
|
PKG_NAME:=luci-app-amlogic
|
||||||
PKG_VERSION:=3.1.282
|
PKG_VERSION:=3.1.283
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0 License
|
PKG_LICENSE:=GPL-2.0 License
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ else
|
|||||||
|
|
||||||
# Intelligent File Discovery
|
# Intelligent File Discovery
|
||||||
plugin_file_name=""
|
plugin_file_name=""
|
||||||
lang_file_name=""
|
lang_file_list=""
|
||||||
|
|
||||||
# Method 1: Use GitHub API if 'jq' is installed (Preferred Method)
|
# Method 1: Use GitHub API if 'jq' is installed (Preferred Method)
|
||||||
if command -v jq >/dev/null 2>&1; then
|
if command -v jq >/dev/null 2>&1; then
|
||||||
@@ -129,7 +129,7 @@ else
|
|||||||
if [[ -n "${asset_list}" ]]; then
|
if [[ -n "${asset_list}" ]]; then
|
||||||
# Discover exact filenames using regular expressions from the asset list
|
# Discover exact filenames using regular expressions from the asset list
|
||||||
plugin_file_name="$(echo "${asset_list}" | tr ' ' '\n' | grep -oE "^luci-app-amlogic.*${package_manager}$" | head -n 1)"
|
plugin_file_name="$(echo "${asset_list}" | tr ' ' '\n' | grep -oE "^luci-app-amlogic.*${package_manager}$" | head -n 1)"
|
||||||
lang_file_name="$(echo "${asset_list}" | tr ' ' '\n' | grep -oE "^luci-i18n-amlogic-zh-cn.*${package_manager}$" | head -n 1)"
|
lang_file_list=($(echo "${asset_list}" | tr ' ' '\n' | grep -oE "^luci-i18n-amlogic.*${package_manager}$"))
|
||||||
else
|
else
|
||||||
tolog "Warning: Failed to fetch data from GitHub API." "1"
|
tolog "Warning: Failed to fetch data from GitHub API." "1"
|
||||||
fi
|
fi
|
||||||
@@ -138,29 +138,26 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Validation and Download
|
# Validation and Download
|
||||||
if [[ -z "${plugin_file_name}" || -z "${lang_file_name}" ]]; then
|
if [[ -z "${plugin_file_name}" || "${#lang_file_list[@]}" -eq "0" ]]; then
|
||||||
tolog "02.03.2 Could not discover plugin(.${package_manager}) in the release. Aborting." "1"
|
tolog "02.03.2 Could not discover plugin(.${package_manager}) in the release. Aborting." "1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tolog "Found plugin file: ${plugin_file_name}"
|
tolog "Found plugin file: ${plugin_file_name}"
|
||||||
tolog "Found language file: ${lang_file_name}"
|
tolog "Found language file: $(echo ${lang_file_list[@]} | xargs)"
|
||||||
|
|
||||||
plugin_full_url="${download_repo}/${latest_version}/${plugin_file_name}"
|
|
||||||
lang_full_url="${download_repo}/${latest_version}/${lang_file_name}"
|
|
||||||
|
|
||||||
# Download the language pack
|
|
||||||
tolog "02.04 Downloading language pack..."
|
|
||||||
curl -fsSL "${lang_full_url}" -o "${TMP_CHECK_DIR}/${lang_file_name}"
|
|
||||||
if [[ "${?}" -ne "0" ]]; then
|
|
||||||
tolog "02.04 Language pack download failed." "1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Download the main plugin file
|
# Download the main plugin file
|
||||||
tolog "02.05 Downloading main plugin..."
|
plugin_full_url="${download_repo}/${latest_version}/${plugin_file_name}"
|
||||||
|
tolog "02.04 Downloading main plugin..."
|
||||||
curl -fsSL "${plugin_full_url}" -o "${TMP_CHECK_DIR}/${plugin_file_name}"
|
curl -fsSL "${plugin_full_url}" -o "${TMP_CHECK_DIR}/${plugin_file_name}"
|
||||||
if [[ "${?}" -ne "0" ]]; then
|
[[ "${?}" -ne "0" ]] && tolog "02.04 Plugin [ ${plugin_file_name} ] download failed." "1"
|
||||||
tolog "02.05 Plugin download failed." "1"
|
|
||||||
fi
|
# Download language packs
|
||||||
|
for langfile in "${lang_file_list[@]}"; do
|
||||||
|
lang_full_url="${download_repo}/${latest_version}/${langfile}"
|
||||||
|
tolog "02.05 Downloading language pack [ ${langfile} ]..."
|
||||||
|
curl -fsSL "${lang_full_url}" -o "${TMP_CHECK_DIR}/${langfile}"
|
||||||
|
[[ "${?}" -ne "0" ]] && tolog "02.05 Language pack [ ${langfile} ] download failed." "1"
|
||||||
|
done
|
||||||
|
|
||||||
sync && sleep 2
|
sync && sleep 2
|
||||||
fi
|
fi
|
||||||
@@ -168,7 +165,6 @@ fi
|
|||||||
tolog "03. The plug is ready, you can update."
|
tolog "03. The plug is ready, you can update."
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
#echo '<a href=upload>Update</a>' >$START_LOG
|
|
||||||
tolog '<input type="button" class="cbi-button cbi-button-reload" value="Update" onclick="return amlogic_plugin(this)"/> Latest version: '${latest_version}'' "1"
|
tolog '<input type="button" class="cbi-button cbi-button-reload" value="Update" onclick="return amlogic_plugin(this)"/> Latest version: '${latest_version}'' "1"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user