Move reset
out of experimental
This is relatively uncontroversial functionality that has already proved useful when helping folks debug their stuff. Let's promote it to the stable interface. Closes: #1682 Approved by: rfairley
This commit is contained in:
parent
03a92c0981
commit
ed2fefad85
@ -89,6 +89,9 @@ static RpmOstreeCommand commands[] = {
|
||||
rpmostree_builtin_uninstall },
|
||||
{ "override", RPM_OSTREE_BUILTIN_FLAG_LOCAL_CMD,
|
||||
"Manage base package overrides", rpmostree_builtin_override },
|
||||
{ "reset", RPM_OSTREE_BUILTIN_FLAG_SUPPORTS_PKG_INSTALLS,
|
||||
"Remove all mutations",
|
||||
rpmostree_builtin_reset },
|
||||
{ "refresh-md", 0,
|
||||
"Generate rpm repo metadata",
|
||||
rpmostree_builtin_refresh_md },
|
||||
|
@ -32,9 +32,9 @@ static RpmOstreeCommand ex_subcommands[] = {
|
||||
"Convert an OSTree commit into an rpm-ostree rojig", rpmostree_ex_builtin_commit2rojig },
|
||||
{ "rojig2commit", RPM_OSTREE_BUILTIN_FLAG_LOCAL_CMD,
|
||||
"Convert an rpm-ostree rojig into an OSTree commit", rpmostree_ex_builtin_rojig2commit },
|
||||
{ "reset", RPM_OSTREE_BUILTIN_FLAG_SUPPORTS_PKG_INSTALLS,
|
||||
"Remove all mutations",
|
||||
rpmostree_ex_builtin_reset },
|
||||
/* temporary aliases; nuke in next version */
|
||||
{ "reset", RPM_OSTREE_BUILTIN_FLAG_SUPPORTS_PKG_INSTALLS | RPM_OSTREE_BUILTIN_FLAG_HIDDEN,
|
||||
NULL, rpmostree_builtin_reset },
|
||||
{ NULL, 0, NULL, NULL }
|
||||
};
|
||||
|
||||
|
@ -46,11 +46,11 @@ static GOptionEntry option_entries[] = {
|
||||
};
|
||||
|
||||
gboolean
|
||||
rpmostree_ex_builtin_reset (int argc,
|
||||
char **argv,
|
||||
RpmOstreeCommandInvocation *invocation,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
rpmostree_builtin_reset (int argc,
|
||||
char **argv,
|
||||
RpmOstreeCommandInvocation *invocation,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
g_autoptr(GOptionContext) context = g_option_context_new ("");
|
||||
glnx_unref_object RPMOSTreeSysroot *sysroot_proxy = NULL;
|
||||
|
@ -49,6 +49,7 @@ BUILTINPROTO(install);
|
||||
BUILTINPROTO(uninstall);
|
||||
BUILTINPROTO(override);
|
||||
BUILTINPROTO(kargs);
|
||||
BUILTINPROTO(reset);
|
||||
BUILTINPROTO(start_daemon);
|
||||
BUILTINPROTO(ex);
|
||||
|
||||
|
@ -124,7 +124,7 @@ vm_cmd cat /usr/share/rpmostree-lua-override-test-expand > lua-override-expand.t
|
||||
diff -u install-langs.txt lua-override-expand.txt
|
||||
echo "ok script override"
|
||||
|
||||
vm_rpmostree ex reset
|
||||
vm_rpmostree reset
|
||||
vm_reboot
|
||||
vm_rpmostree cleanup -pr
|
||||
# File triggers are Fedora+
|
||||
|
@ -115,7 +115,7 @@ echo "ok livefs preserved rollback"
|
||||
|
||||
# Reset to rollback, undeploy pending
|
||||
reset() {
|
||||
vm_rpmostree ex reset
|
||||
vm_rpmostree reset
|
||||
vm_reboot
|
||||
vm_rpmostree cleanup -r
|
||||
vm_assert_status_jq '.deployments|length == 1' '.deployments[0]["live-replaced"]|not'
|
||||
|
@ -52,7 +52,7 @@ vm_assert_status_jq \
|
||||
echo "ok setup"
|
||||
|
||||
# check removing layering only
|
||||
vm_rpmostree ex reset --overlays
|
||||
vm_rpmostree reset --overlays
|
||||
vm_assert_status_jq \
|
||||
'.deployments[0]["packages"]|length == 0' \
|
||||
'.deployments[0]["requested-packages"]|length == 0' \
|
||||
@ -63,7 +63,7 @@ vm_rpmostree cleanup -p
|
||||
echo "ok reset overlays"
|
||||
|
||||
# check removing overrides only
|
||||
vm_rpmostree ex reset --overrides
|
||||
vm_rpmostree reset --overrides
|
||||
vm_assert_status_jq \
|
||||
'.deployments[0]["packages"]|length == 1' \
|
||||
'.deployments[0]["requested-packages"]|length == 1' \
|
||||
@ -74,7 +74,7 @@ vm_rpmostree cleanup -p
|
||||
echo "ok reset overrides"
|
||||
|
||||
# check stopping initramfs only
|
||||
vm_rpmostree ex reset --initramfs
|
||||
vm_rpmostree reset --initramfs
|
||||
vm_assert_status_jq \
|
||||
'.deployments[0]["packages"]|length == 1' \
|
||||
'.deployments[0]["requested-packages"]|length == 1' \
|
||||
@ -85,7 +85,7 @@ vm_rpmostree cleanup -p
|
||||
echo "ok reset initramfs"
|
||||
|
||||
# all together now
|
||||
vm_rpmostree ex reset
|
||||
vm_rpmostree reset
|
||||
vm_assert_status_jq \
|
||||
'.deployments[0]["packages"]|length == 0' \
|
||||
'.deployments[0]["requested-packages"]|length == 0' \
|
||||
@ -97,7 +97,7 @@ echo "ok reset EVERYTHING"
|
||||
|
||||
# reset everything and overlay at the same time
|
||||
vm_build_rpm a-new-package
|
||||
vm_rpmostree ex reset --install a-new-package
|
||||
vm_rpmostree reset --install a-new-package
|
||||
vm_assert_status_jq \
|
||||
'.deployments[0]["packages"]|length == 1' \
|
||||
'.deployments[0]["packages"]|index("a-new-package") >= 0' \
|
||||
|
Loading…
Reference in New Issue
Block a user