CBI: Free dependencies

This commit is contained in:
Steven Barth 2009-11-23 13:09:52 +00:00
parent 8163cc8e67
commit 565cc95f0d
2 changed files with 11 additions and 3 deletions

View file

@ -65,9 +65,9 @@ function cbi_d_check(deps) {
var istat = true;
reverse = false;
for (var j in deps[i]) {
if (j.slice(-8) == "!reverse") {
if (j == "!reverse") {
reverse = true;
} else if (j.slice(-8) == "!default") {
} else if (j == "!default") {
def = true;
istat = false;
} else {

View file

@ -34,8 +34,16 @@ $Id$
cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option..d.add%>", {
<%-
for k,v in pairs(d.deps) do
local depk
if k:find("!", 1, true) then
depk = string.format('"%s"', k)
elseif k:find(".", 1, true) then
depk = string.format('"cbid.%s"', k)
else
depk = string.format('"cbid.%s.%s.%s"', self.config, section, k)
end
-%>
<%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%>
<%-= depk .. ":" .. string.format("%q", v)-%>
<%-if next(d.deps, k) then-%>,<%-end-%>
<%-
end