Skip to content

Commit

Permalink
Bump v1.4.2
Browse files Browse the repository at this point in the history
* Fix luci update
* Fix mktemp command
  • Loading branch information
kuoruan committed Sep 23, 2017
1 parent 3c64038 commit fc350fd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-kcptun
PKG_VERSION:=1.4.1
PKG_VERSION:=1.4.2
PKG_RELEASE:=1

PKG_LICENSE:=Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion luasrc/model/cbi/kcptun/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ o.placeholder = translate("Check Kcptun")
o.btnclick = "check_update('kcptun', this);"

o = s:option(Button, "_check_luci", translate("Check Luci"),
translate("You need to reload current page after update luci. Note that translation will not be updated."))
translate("You may need to reload current page after update luci. Note that translation will not be updated."))
o.template = "kcptun/button"
o.inputstyle = "apply"
o.placeholder = translate("Check Luci")
Expand Down
8 changes: 4 additions & 4 deletions luasrc/model/kcptun.lua
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ function download_kcptun(url)

sys.call("/bin/rm -f /tmp/kcptun_download.*")

local tmp_file = util.trim(util.exec("mktemp -u kcptun_download.XXXXXX"))
local tmp_file = util.trim(util.exec("mktemp -u -t kcptun_download.XXXXXX"))

local result = exec(wget, {
"-O", tmp_file, url, _unpack(wget_args) }, nil, wget_time_out) == 0
Expand Down Expand Up @@ -441,9 +441,9 @@ function update_luci(url)
}
end

sys.call("/bin/rm -f /tmp/luci_kcptun.*")
sys.call("/bin/rm -f /tmp/luci_kcptun.*.ipk")

local tmp_file = util.trim(util.exec("mktemp -u luci_kcptun.XXXXXX"))
local tmp_file = util.trim(util.exec("mktemp -u -t luci_kcptun.XXXXXX")) .. ".ipk"

local result = exec("/usr/bin/wget", {
"-O", tmp_file, url, _unpack(wget_args) }, nil, wget_time_out) == 0
Expand All @@ -456,7 +456,7 @@ function update_luci(url)
}
end

result = exec("opkg", {
result = exec("/bin/opkg", {
"install", "--force-reinstall", "--force-overwrite", tmp_file }) == 0

if not result then
Expand Down
10 changes: 5 additions & 5 deletions luasrc/view/kcptun/status.htm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
}
}

function on_request_success(btn) {
function on_update_success(btn) {
add_remove_page_notice(false);

var success = '<%:Update Success.%>';
Expand Down Expand Up @@ -189,7 +189,7 @@
}, function (x, res) {
if (x && x.status == 200) {
if (json.code == 0) {
on_request_success(btn);
on_update_success(btn);
} else {
on_request_error(btn, json);
}
Expand All @@ -213,7 +213,7 @@
});
}

function do_luci_update(type, btn) {
function do_luci_update(btn) {
btn.disabled = true;
btn.value = '<%:Processing...%>';

Expand All @@ -223,13 +223,13 @@

(new XHR()).get(luci_update_url, {
token: token_str,
url: luci_info ? luci_info.url.download : ''
url: luci_info ? luci_info.url.luci : ''
}, function(x, json) {
btn.disabled = false;
btn.value = btn.placeholder;
if (x && x.status == 200) {
if (json.code == 0) {
on_request_success(btn);
on_update_success(btn);
} else {
on_request_error(btn, json);
}
Expand Down
2 changes: 1 addition & 1 deletion po/templates/kcptun.pot
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ msgid "Update in progress. Are you sure to close window?"
msgstr ""

msgid ""
"You need to reload current page after update luci. Note that translation "
"You may need to reload current page after update luci. Note that translation "
"will not be updated."
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions po/zh-cn/kcptun.po
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ msgid "Update in progress. Are you sure to close window?"
msgstr "正在更新,确定关闭窗口?"

msgid ""
"You need to reload current page after update luci. Note that translation "
"You may need to reload current page after update luci. Note that translation "
"will not be updated."
msgstr "更新 luci 之后你需要手动刷新当前页面。注意:翻译不会被更新"
msgstr "更新 luci 之后你可能需要手动刷新当前页面。注意:翻译不会被更新"

msgid "acknodelay"
msgstr ""
Expand Down

0 comments on commit fc350fd

Please sign in to comment.