update store

This commit is contained in:
YGAS 2022-03-11 12:44:19 +08:00
parent 01a45b8b06
commit befe1f6637
5 changed files with 21 additions and 13 deletions

View File

@ -7,23 +7,24 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI based ipk store LUCI_TITLE:=LuCI based ipk store
LUCI_DESCRIPTION:=luci-app-store is a ipk store developed by LinkEase team 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 LUCI_PKGARCH:=all
PKG_VERSION:=0.1.7 PKG_VERSION:=0.1.8
PKG_RELEASE:=1 PKG_RELEASE:=3
ISTORE_UI_VERSION:=1.0 ISTORE_UI_VERSION:=1.0
ISTORE_UI_RELEASE:=8 ISTORE_UI_RELEASE:=10-beta
PKG_HASH:=574f57a726f60c47fc289b752ff41c903a7be91797a5dc4b7dd804a4db1750e5 PKG_HASH:=4c7e2e9d20fcb0fbc383a85d1d4dd99f796eb389263512879373dc826ef6b3d7
PKG_SOURCE_URL_FILE:=v$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE).tar.gz PKG_SOURCE_URL_FILE:=v$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE).tar.gz
PKG_SOURCE:=istore-ui-$(PKG_SOURCE_URL_FILE) 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 <jjm2473@gmail.com> PKG_MAINTAINER:=jjm2473 <jjm2473@gmail.com>
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 define Package/luci-app-store/conffiles
/etc/.app_store.id /etc/.app_store.id

View File

@ -623,4 +623,4 @@ function get_local_backup_dir_path()
luci.http.prepare_content("application/json") luci.http.prepare_content("application/json")
luci.http.write_json(error_ret) luci.http.write_json(error_ret)
end end
end end

View File

@ -1,5 +1,5 @@
<%+header%> <%+header%>
<link rel="stylesheet" href="/luci-static/istore/style.css"> <link rel="stylesheet" href="/luci-static/istore/style.css?v=<%=id.version%>">
<script> <script>
(function(){ (function(){
var vue_prefix="<%=prefix%>"; var vue_prefix="<%=prefix%>";
@ -19,6 +19,6 @@
<h2 name="content">应用商店 v<%=id.version%></h2> <h2 name="content">应用商店 v<%=id.version%></h2>
<div id="app"> <div id="app">
</div> </div>
<script type="module" crossorigin src="/luci-static/istore/index.js"></script> <script type="module" crossorigin src="/luci-static/istore/index.js?v=<%=id.version%>"></script>
<link rel="modulepreload" href="/luci-static/istore/vendor.js"> <link rel="modulepreload" href="/luci-static/istore/vendor.js?v=<%=id.version%>">
<%+footer%> <%+footer%>

View File

@ -63,7 +63,7 @@ update() {
update_if_outdate() { update_if_outdate() {
local idle_t=$((`date '+%s'` - `date -r ${IS_ROOT}/.last_force_ts '+%s' 2>/dev/null || echo '0'`)) 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 update || return 1
touch ${IS_ROOT}/.last_force_ts touch ${IS_ROOT}/.last_force_ts
return 0 return 0
@ -87,7 +87,13 @@ do_self_upgrade() {
if opkg_wrap info ${ISTORE_PKG} | grep -qF not-installed ; then if opkg_wrap info ${ISTORE_PKG} | grep -qF not-installed ; then
true true
else 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 fi
opkg_wrap upgrade ${ISTORE_PKG} opkg_wrap upgrade ${ISTORE_PKG}
} }

View File

@ -3,5 +3,6 @@ compile:
install: install:
mkdir -p "$(DESTDIR)/www/luci-static" mkdir -p "$(DESTDIR)/www/luci-static"
cp -a "$(FRONTEND_DIST)/luci-static/istore" "$(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" mkdir -p "$(DESTDIR)/etc"
echo "$(APP_STORE_VERSION)" > "$(DESTDIR)/etc/.app_store.version" echo "$(APP_STORE_VERSION)" > "$(DESTDIR)/etc/.app_store.version"