30 lines
974 B
Text
30 lines
974 B
Text
|
local tArgs = {...}
|
||
|
local packages = config.load("/etc/tpm/package.dat")
|
||
|
local packageInstalled = config.load("/etc/tpm/packageInstalled.dat")
|
||
|
|
||
|
if not security.getSU() then
|
||
|
exception.throw("RestrictedOpsException")
|
||
|
return
|
||
|
end
|
||
|
|
||
|
if not packages then
|
||
|
kerneldraw.printAppInfo("tpm", "package.dat is missing or corrupt")
|
||
|
log.writeMessage("package.dat unable to be traversed")
|
||
|
return
|
||
|
elseif not packageInstalled then
|
||
|
shell.executeScript("/etc/scripts/tpm-recache.tsf")
|
||
|
end
|
||
|
|
||
|
if search.findValue(tArgs, "available") then
|
||
|
kerneldraw.printAppInfo("tpm", "Traversing package.dat")
|
||
|
for k, v in pairs(packages) do
|
||
|
kerneldraw.printAppInfo("tpm", "Found package identifier "..v.name)
|
||
|
end
|
||
|
elseif search.findValue(tArgs, "installed") then
|
||
|
kerneldraw.printAppInfo("tpm", "Traversing packageInstalled.dat")
|
||
|
for k, v in pairs(packageInstalled) do
|
||
|
kerneldraw.printAppInfo("tpm", "Found package identifier "..v)
|
||
|
end
|
||
|
else
|
||
|
kerneldraw.printAppInfo("tpm", "Specify listing type")
|
||
|
end
|