Use _ instead of - in extra options

The later allows for more comfortable specification, both in our code
and in the configuration scripts, because it doesn't require quotes
around the field name.
parent a246151f
......@@ -421,19 +421,19 @@ deps::
Additional dependencies for the package. The dependencies are merged
together as if all the sources were put into a table (eg. all of
them must be fulfilled). There's no way to remove dependencies.
order-after::
order-before::
order_after::
order_before::
Usually, all dependencies of a package are installed before the
package. Sometimes, it may be desirable to break this order and
these options allow that. Both of them list packages after or before
which the current package shall be installed, in a table. This
allows breaking dependency cycles. These options are mere hint, the
updater may decide to not follow them if it is not possible to
satisfy. Note that this has effect only on running the pre-* and
post-* scripts and hooks, since all the files of all updated
satisfy. Note that this has effect only on running the pre_* and
post_* scripts and hooks, since all the files of all updated
packages are merged into the system together.
pre-*::
post-*::
pre_*::
post_*::
A hook to be run after or before a step. The value may be a single
function or a table of functions. All the functions (from the table
or merged from multiple `Package` commands) are run, in unspecified
......@@ -578,7 +578,7 @@ repository::
the name corresponds to the time the package has been installed and
that repository may be unavailable now or the name represent a
different repository.
install-time::
install_time::
Unix timestamp specifying when the package has been installed, in
UTC.
......
......@@ -197,12 +197,12 @@ function pkg_aggregate()
tp = 'package',
name = name,
deps = {},
["order-after"] = {},
["order-before"] = {},
["pre-install"] = {},
["pre-remove"] = {},
["post-install"] = {},
["post-remove"] = {},
order_after = {},
order_before = {},
pre_install = {},
pre_remove = {},
post_install = {},
post_remove = {},
reboot = false,
abi_change = {}
}
......@@ -223,12 +223,12 @@ function pkg_aggregate()
end
-- TODO: We need to make the deps canonical somehow for this to work properly.
set_merge("deps")
set_merge("order-after")
set_merge("order-before")
set_merge("pre-install")
set_merge("pre-remove")
set_merge("post-install")
set_merge("post-remove")
set_merge("order_after")
set_merge("order_before")
set_merge("pre_install")
set_merge("pre_remove")
set_merge("post_install")
set_merge("post_remove")
set_merge("abi_change")
local reboot_vals = {
[false] = 0,
......
......@@ -213,7 +213,7 @@ function test_pkg_merge()
requests.known_packages = {
{
tp = 'package',
["order-after"] = "abc",
order_after = "abc",
name = 'xyz',
reboot = 'finished',
deps = "abc"
......@@ -250,7 +250,7 @@ function test_pkg_merge()
candidates = {{Package = "xyz"}},
modifier = {
name = "xyz",
["order-after"] = {abc = true},
order_after = {abc = true},
deps = utils.arr2set({"abc", "another", "xyz"}),
reboot = "finished"
}
......@@ -262,12 +262,12 @@ function test_pkg_merge()
tp = "package",
abi_change = {},
deps = {},
["order-after"] = {},
["order-before"] = {},
["post-install"] = {},
["post-remove"] = {},
["pre-install"] = {},
["pre-remove"] = {},
order_after = {},
order_before = {},
post_install = {},
post_remove = {},
pre_install = {},
pre_remove = {},
reboot = false
}
for _, pkg in pairs(exp) do
......
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