Commit 172e1da0 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner

pkg: Return more complete control structure

The pkg_examine now returns everything that is needed to plug it into
the global status structure.
parent cbfaa8bb
......@@ -24,6 +24,7 @@ local ipairs = ipairs
local pcall = pcall
local require = require
local next = next
local tostring = tostring
local unpack = unpack
local io = io
local os = os
......@@ -457,6 +458,10 @@ function pkg_examine(dir)
if err then
error(err)
end
-- Complete the control structure
control.files = files
control.Conffiles = conffiles
control["Installed-Time"] = tostring(os.time())
return files, dirs, conffiles, control
end
......
......@@ -326,6 +326,9 @@ function test_pkg_unpack()
assert_table_equal({
["/etc/config/updater"] = "30843ef73412c8f6b4212c00724a1cc8"
}, conffiles)
-- We want to take it out, the time changes every time
assert_not_nil(control["Installed-Time"])
control["Installed-Time"] = nil
assert_table_equal({
Package = "updater",
Version = "129",
......@@ -335,7 +338,9 @@ function test_pkg_unpack()
Architecture = "mpc85xx",
["Installed-Size"] = "14773",
Description = "updater",
Depends = {"libc", "vixie-cron", "openssl-util", "libatsha204", "curl", "cert-backup", "opkg", "bzip2", "cznic-cacert-bundle"}
Depends = {"libc", "vixie-cron", "openssl-util", "libatsha204", "curl", "cert-backup", "opkg", "bzip2", "cznic-cacert-bundle"},
Conffiles = conffiles,
files = files
}, control)
local test_root = mkdtemp()
table.insert(tmp_dirs, test_root)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment