From befe1f663711e7faab2f9c4bd55a1fb47e816b4e Mon Sep 17 00:00:00 2001 From: YGAS Date: Fri, 11 Mar 2022 12:44:19 +0800 Subject: [PATCH] update store --- applications/luci-app-store/Makefile | 15 ++++++++------- .../luci-app-store/luasrc/controller/store.lua | 2 +- .../luci-app-store/luasrc/view/store/main.htm | 6 +++--- applications/luci-app-store/root/bin/is-opkg | 10 ++++++++-- applications/luci-app-store/src/Makefile | 1 + 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/applications/luci-app-store/Makefile b/applications/luci-app-store/Makefile index c693ceb..9d126cd 100755 --- a/applications/luci-app-store/Makefile +++ b/applications/luci-app-store/Makefile @@ -7,23 +7,24 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI based ipk store LUCI_DESCRIPTION:=luci-app-store is a ipk store developed by LinkEase team -LUCI_DEPENDS:=+tar +coreutils +coreutils-stat +luci-lib-ipkg +curl +opkg +libuci-lua +mount-utils +LUCI_DEPENDS:=+curl +opkg +luci-lib-ipkg +tar +coreutils +coreutils-stat +libuci-lua +mount-utils LUCI_PKGARCH:=all -PKG_VERSION:=0.1.7 -PKG_RELEASE:=1 +PKG_VERSION:=0.1.8 +PKG_RELEASE:=3 ISTORE_UI_VERSION:=1.0 -ISTORE_UI_RELEASE:=8 -PKG_HASH:=574f57a726f60c47fc289b752ff41c903a7be91797a5dc4b7dd804a4db1750e5 +ISTORE_UI_RELEASE:=10-beta +PKG_HASH:=4c7e2e9d20fcb0fbc383a85d1d4dd99f796eb389263512879373dc826ef6b3d7 PKG_SOURCE_URL_FILE:=v$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE).tar.gz PKG_SOURCE:=istore-ui-$(PKG_SOURCE_URL_FILE) -PKG_SOURCE_URL:=https://github.com/YGAS/istore-ui/archive/refs/tags +PKG_SOURCE_URL:=https://github.com/linkease/istore-ui/archive/refs/tags PKG_MAINTAINER:=jjm2473 -TARGET_CONFIGURE_OPTS = FRONTEND_DIST="$(BUILD_DIR)/istore-ui-$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE)/app-store-ui/src/dist" APP_STORE_VERSION="$(PKG_VERSION)-$(PKG_RELEASE)" +TARGET_CONFIGURE_OPTS= FRONTEND_DIST="$(BUILD_DIR)/istore-ui-$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE)/app-store-ui/src/dist" APP_STORE_VERSION="$(PKG_VERSION)-$(PKG_RELEASE)" +TARGET_CONFIGURE_OPTS+= SED="$(SED)" define Package/luci-app-store/conffiles /etc/.app_store.id diff --git a/applications/luci-app-store/luasrc/controller/store.lua b/applications/luci-app-store/luasrc/controller/store.lua index c4a37ec..88cb886 100755 --- a/applications/luci-app-store/luasrc/controller/store.lua +++ b/applications/luci-app-store/luasrc/controller/store.lua @@ -623,4 +623,4 @@ function get_local_backup_dir_path() luci.http.prepare_content("application/json") luci.http.write_json(error_ret) end -end \ No newline at end of file +end diff --git a/applications/luci-app-store/luasrc/view/store/main.htm b/applications/luci-app-store/luasrc/view/store/main.htm index ca8f4f6..b1cd6e7 100755 --- a/applications/luci-app-store/luasrc/view/store/main.htm +++ b/applications/luci-app-store/luasrc/view/store/main.htm @@ -1,5 +1,5 @@ <%+header%> - + - + + <%+footer%> \ No newline at end of file diff --git a/applications/luci-app-store/root/bin/is-opkg b/applications/luci-app-store/root/bin/is-opkg index d24dbe4..9d6ad26 100755 --- a/applications/luci-app-store/root/bin/is-opkg +++ b/applications/luci-app-store/root/bin/is-opkg @@ -63,7 +63,7 @@ update() { update_if_outdate() { local idle_t=$((`date '+%s'` - `date -r ${IS_ROOT}/.last_force_ts '+%s' 2>/dev/null || echo '0'`)) - [ $idle_t -gt ${1:-120} ] || return 1 + [ $idle_t -gt ${1:-120} ] || return 2 update || return 1 touch ${IS_ROOT}/.last_force_ts return 0 @@ -87,7 +87,13 @@ do_self_upgrade() { if opkg_wrap info ${ISTORE_PKG} | grep -qF not-installed ; then true else - update_if_outdate || return 1 + update_if_outdate + local code=$? + [ "$code" = 1 ] && return 1 + if [ "$code" = 2 ] || ! opkg_wrap info ${ISTORE_PKG} | grep -qF not-installed; then + echo "already the latest version!" >&2 + return 1 + fi fi opkg_wrap upgrade ${ISTORE_PKG} } diff --git a/applications/luci-app-store/src/Makefile b/applications/luci-app-store/src/Makefile index f7c9639..7ffd344 100755 --- a/applications/luci-app-store/src/Makefile +++ b/applications/luci-app-store/src/Makefile @@ -3,5 +3,6 @@ compile: install: mkdir -p "$(DESTDIR)/www/luci-static" cp -a "$(FRONTEND_DIST)/luci-static/istore" "$(DESTDIR)/www/luci-static/" + $(SED) 's#\.js"#.js?v=$(APP_STORE_VERSION)"#g' "$(DESTDIR)/www/luci-static/istore/index.js" mkdir -p "$(DESTDIR)/etc" echo "$(APP_STORE_VERSION)" > "$(DESTDIR)/etc/.app_store.version"