Declarative system changes
声明性系统更改

For historical reasons, the build side of rpm-ostree is fully declarative; it accepts treefiles as input. The client side is imperative, with a CLI and DBus API.
基于历史原因,rpm-ostree 的构建端是完全声明性的;它接受 treefiles 作为输入。客户端是命令式的,具有 CLI 和 DBus API。

The goal of this feature is to unify things by supporting declarative client-side changes. The current implementation just exposes treefiles. Instead of typing e.g. rpm-ostree install foo, you can add treefiles into /etc/rpm-ostree/origin.d, and invoke rpm-ostree ex rebuild to declaratively reconcile the system to that state.
此功能的目标是通过支持声明性客户端端更改来统一事物。当前的实现只是暴露了 treefiles。您可以将 treefiles 添加到 /etc/rpm-ostree/origin.d 中,而不是输入例如 rpm-ostree install foo ,然后调用 rpm-ostree ex rebuild 来声明性地将系统调整到该状态。

For more background on this, see https://github.com/coreos/rpm-ostree/issues/2326
有关更多背景信息,请参阅 https://github.com/coreos/rpm-ostree/issues/2326

Example: Installing and removing packages as an atomic unit
示例:将软件包安装和卸载作为一个原子单元

$ mkdir -p /etc/rpm-ostree/origin.d
$ cat > /etc/rpm-ostree/origin.d/mycustom.yaml <<EOF
packages:
  - vim
  - NetworkManager-wifi
override-remove:
  - moby-engine
EOF
$ rpm-ostree ex rebuild

Previously, this required a CLI invocation like
以前,这需要像这样的 CLI 调用

$ rpm-ostree override remove moby-engine --install vim --install NetworkManager-wifi

which is comparatively awkward and not very discoverable.
相对尴尬且不太容易发现。

Note: Origin files are consumed after use
注意:原始文件在使用后被消耗。

In the current design, these origin files are deleted after they are successfully used. The idea behind this is to avoid adding leftover files into the generated “image” state.
在当前设计中,这些原始文件在成功使用后被删除。这样做的想法是避免将剩余文件添加到生成的“图像”状态中。

This semantic is still being debated and may change in the future.
这个语义仍在讨论中,可能会在未来发生变化。