From 8d5450a1ad2402c0e5b764a5e033cd9134dd4d23 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Tue, 22 Jan 2008 16:14:48 +0000 Subject: 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 --- lbu-commit-html.lsp | 3 +++ lbu-controller.lua | 7 +++++-- lbu-model.lua | 10 ++++++---- lbu-status-html.lsp | 4 +--- 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 @@

Save to media

+
Remove existing apk.ovls from media
+
+

Attention!

By checking this box, you remove all existing archives from the when commiting (adding the '-d' flag to the commit action).
This needs to be done when you want/dont want to encrypt your archive and there already exists archives on the media.
There can only be one sort of arcive on the media.

Simulate/Test a commit
Actually Commit and save changes
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 @@
Archives will be saved to
-
Archives will be encrypted
-
yes (Using cipher: )
- +
(Using cipher: " ..view.status.DEFAULT_CIPHER .. ")") else io.write("No") end ?>

CHANGES SINCE LAST COMMIT

-- cgit v1.2.3