summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2009-07-17 11:24:47 +0000
committerTed Trask <ttrask01@yahoo.com>2009-07-17 11:24:47 +0000
commitd962635e52cc8f11764c7cde6a4ab073842ac72c (patch)
tree61ddd2bd1dfc89cac38462543a54fae0d15fde4f
parentb01c2bb9c8420f07ae2748aabda319506d0dd5ad (diff)
downloadacf-apk-tools-0.3.1.tar.bz2
acf-apk-tools-0.3.1.tar.xz
Fixed package upgrade to not add as top-level package. Bumped to 0.3.1v0.3.1
-rw-r--r--Makefile2
-rw-r--r--apk-loaded-html.lsp11
-rw-r--r--apk-model.lua13
3 files changed, 19 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 35fd038..c7603d1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
APP_NAME=apk-tools
PACKAGE=acf-$(APP_NAME)
-VERSION=0.3.0
+VERSION=0.3.1
APP_DIST=\
apk* \
diff --git a/apk-loaded-html.lsp b/apk-loaded-html.lsp
index e24ca00..68cda56 100644
--- a/apk-loaded-html.lsp
+++ b/apk-loaded-html.lsp
@@ -38,7 +38,7 @@
<DL>
<TABLE>
<TR style="background:#eee;font-weight:bold;">
- <% if session.permissions.apk.install then %>
+ <% if session.permissions.apk.install or session.permissions.apk.upgrade then %>
<TD style="padding-right:20px;white-space:nowrap;" class="header">Action</TD>
<% end %>
<TD style="padding-right:20px;white-space:nowrap;" class="header">Package Name</TD>
@@ -48,9 +48,14 @@
<% for i,packagetable in pairs(form.value.dependent.value) do %>
<TR>
- <% if session.permissions.apk.install then %>
+ <% if session.permissions.apk.install or session.permissions.apk.upgrade then %>
<TD style="padding-right:20px;white-space:nowrap;">
- <%= html.link{value = "install?package=" .. packagetable.name, label="Install"} %>
+ <% if session.permissions.apk.install then %>
+ <%= html.link{value = "install?package=" .. packagetable.name, label="Install "} %>
+ <% end %>
+ <% if session.permissions.apk.upgrade and packagetable.upgrade then %>
+ <%= html.link{value = "upgrade?package=" .. packagetable.name, label="Upgrade "} %>
+ <% end %>
</TD>
<% end %>
<TD><%= html.link{value = "details?package="..packagetable.name, label=packagetable.name} %></TD>
diff --git a/apk-model.lua b/apk-model.lua
index 3898b30..31ef54c 100644
--- a/apk-model.lua
+++ b/apk-model.lua
@@ -134,8 +134,10 @@ get_loaded_packages = function()
temp.name = name
temp.version = value.installed
temp.description = value.comment
+ if value.version and value.version > value.installed then
+ temp.upgrade = true
+ end
if toplevel[name] then
- temp.upgrade = upgrade_available(name)
top.value[#top.value+1] = temp
else
depend.value[#depend.value+1] = temp
@@ -152,7 +154,7 @@ get_available_packages = function()
-- available are all except same version installed
local available = cfe({ type="list", value={}, label="Available Packages" })
for name,value in pairs(repo) do
- if value.version ~= value.installed then
+ if value.version and value.version ~= value.installed then
local temp = {}
temp.name = name
temp.version = value.version
@@ -187,7 +189,12 @@ install_package = function(package,sessiondata)
end
upgrade_package = function(package)
- return cfe({ value=run_apk_cmd("add -u "..package), label="Result of Package Upgrade" })
+ -- Jump through hoops to upgrade package without making top level
+ local retval = run_apk_cmd("add -t temp -u "..package)
+ run_apk_cmd("del temp")
+ retval = string.gsub(retval, "Installing temp [^\n]+\n", "")
+ return cfe({ value=retval, label="Result of Package Upgrade" })
+-- return cfe({ value=run_apk_cmd("add -u "..package), label="Result of Package Upgrade" })
end
update_all = function()