summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-01-22 16:14:48 +0000
committerMika Havela <mika.havela@gmail.com>2008-01-22 16:14:48 +0000
commit8d5450a1ad2402c0e5b764a5e033cd9134dd4d23 (patch)
tree276631edba7b2c34399d8702c2f66bb48f09d3a5
parent3928babbc55caa5c8b3914fa0a4c26a916c0dbbb (diff)
downloadacf-alpine-conf-8d5450a1ad2402c0e5b764a5e033cd9134dd4d23.tar.bz2
acf-alpine-conf-8d5450a1ad2402c0e5b764a5e033cd9134dd4d23.tar.xz
Added functionallity when activating/deactivating encryption and there already exists a apkovl on the media.
This commit option doesn't look nice, but it works. Need to figure out a better way of doing this. git-svn-id: svn://svn.alpinelinux.org/acf/alpine-conf/trunk@627 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--lbu-commit-html.lsp3
-rw-r--r--lbu-controller.lua7
-rw-r--r--lbu-model.lua10
-rw-r--r--lbu-status-html.lsp4
4 files changed, 15 insertions, 9 deletions
diff --git a/lbu-commit-html.lsp b/lbu-commit-html.lsp
index 6164739..ffba7a4 100644
--- a/lbu-commit-html.lsp
+++ b/lbu-commit-html.lsp
@@ -22,6 +22,9 @@
<H2>Save to media</h2>
<form name="cmd" action="" method="POST">
<dl>
+ <dt>Remove existing apk.ovls from media</dt>
+ <dd><input type="checkbox" class="checkbox" name="lbucleanmedia" >
+<p class=attention>Attention!</p><p>By checking this box, you remove all existing archives from the <?= view.status.LBU_MEDIA ?> when commiting (adding the '-d' flag to the commit action).<br>This needs to be done when you want/dont want to encrypt your archive and there already exists archives on the media.<BR>There can only be one sort of arcive on the media.</dd>
<dt>Simulate/Test a commit</dt>
<dd><input type=submit class="submit" name="lbusimulate" value="simulate" ></dd>
<dt>Actually Commit and save changes</dt>
diff --git a/lbu-controller.lua b/lbu-controller.lua
index bd08d1d..c13bc5c 100644
--- a/lbu-controller.lua
+++ b/lbu-controller.lua
@@ -63,14 +63,17 @@ end
function commit(self)
local cmdresult
local url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller
+ local cmdflag = nil
+ if (self.clientdata.lbucleanmedia) then cmdflag = "-d" else cmdflag = "" end
if (self.clientdata.lbusimulate) then
- cmdresult = self.model:getsimulate()
+ cmdresult = self.model:getsimulate(cmdflag)
end
if (self.clientdata.lbucommit) then
- cmdresult = self.model:getcommit()
+ cmdresult = self.model:getcommit(cmdflag)
end
return ( {status = self.model:getstatus(),
cmdresult = cmdresult,
+ cmdflag = cmdflag,
clientdata = self.clientdata,
url = url, } )
end
diff --git a/lbu-model.lua b/lbu-model.lua
index e239496..b0f5cf7 100644
--- a/lbu-model.lua
+++ b/lbu-model.lua
@@ -109,11 +109,13 @@ function list(self)
return ret
end
-function getcommit()
- return getLbuCommit("-v")
+function getcommit(self, flag)
+ if flag ~= "-d" then flag = "" end
+ return getLbuCommit("-v " .. flag)
end
-function getsimulate()
- return getLbuCommit("-n")
+function getsimulate(self, flag)
+ if flag ~= "-d" then flag = "" end
+ return getLbuCommit("-n " .. flag)
end
function getconfig ()
diff --git a/lbu-status-html.lsp b/lbu-status-html.lsp
index 796212b..856a050 100644
--- a/lbu-status-html.lsp
+++ b/lbu-status-html.lsp
@@ -16,10 +16,8 @@
<dt>Archives will be saved to</dt>
<dd><?= view.status.LBU_MEDIA ?></DD>
<? end ?>
-<? if (view.status.ENCRYPTION) then ?>
<dt>Archives will be encrypted</dt>
- <dd>yes <I>(Using cipher: <?= view.status.DEFAULT_CIPHER or "unknown" ?>)</I></DD>
-<? end ?>
+ <dd><? if (view.status.ENCRYPTION) then io.write("yes <I>(Using cipher: " ..view.status.DEFAULT_CIPHER .. ")</I>") else io.write("No") end ?></DD>
</dl>
<H2>CHANGES SINCE LAST COMMIT</H2>