diff options
author | Colin Walters <walters@verbum.org> | 2012-12-19 17:52:46 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-12-21 13:47:15 -0500 |
commit | 3832544ac40b5bbfcee3621cc5ab096ac64e578d (patch) | |
tree | d951a4240dda9cf8f2ee1df3d515546dc1768096 /src/ostree/ot-admin-builtin-diff.c | |
parent | 16d312e82f08f27bfa4d4f3dd4b0404ceab731de (diff) | |
download | ostree-3832544ac40b5bbfcee3621cc5ab096ac64e578d.tar.gz |
admin: Rework /ostree/deploy to support multiple independent operating systems
The real vision of OSTree is to "multiple versions of multiple
operating systems". Up until now, it's worked to install gnome-ostree
inside a host distribution, but several things don't work quite right
if you try to do completely different systems.
In the new model, there's the concept of an "osname" which encompasses
a few properties:
1) Its own /var
2) A set of trees deployed in /ostree/deploy/OSNAME/
3) Its own "current" and "previous" links.
Now it no longer really makes sense to boot with "ostree=current".
Instead, you specify e.g. "ostree=gnome/current".
This is an incompatible change to the deployment code - you will need
to run init-os gnome and redeploy.
All "ostree admin" subcommands now take an OSNAME argument.
Diffstat (limited to 'src/ostree/ot-admin-builtin-diff.c')
-rw-r--r-- | src/ostree/ot-admin-builtin-diff.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/ostree/ot-admin-builtin-diff.c b/src/ostree/ot-admin-builtin-diff.c index 7b9eb498..64c2bcc3 100644 --- a/src/ostree/ot-admin-builtin-diff.c +++ b/src/ostree/ot-admin-builtin-diff.c @@ -37,6 +37,7 @@ ot_admin_builtin_diff (int argc, char **argv, GFile *ostree_dir, GError **error) { GOptionContext *context; gboolean ret = FALSE; + const char *osname; ot_lobj GFile *repo_path = NULL; ot_lobj GFile *deployment = NULL; ot_lobj GFile *deploy_parent = NULL; @@ -47,7 +48,7 @@ ot_admin_builtin_diff (int argc, char **argv, GFile *ostree_dir, GError **error) ot_lobj GFile *new_etc_path = NULL; __attribute__((unused)) GCancellable *cancellable = NULL; - context = g_option_context_new ("[NAME] - Diff configuration for revision NAME"); + context = g_option_context_new ("OSNAME [REVISION] - Diff configuration for OSNAME"); g_option_context_add_main_entries (context, options, NULL); @@ -56,9 +57,17 @@ ot_admin_builtin_diff (int argc, char **argv, GFile *ostree_dir, GError **error) repo_path = g_file_get_child (ostree_dir, "repo"); - if (argc > 1) + if (argc < 2) { - deployment = ot_gfile_get_child_build_path (ostree_dir, "deploy", argv[1], NULL); + ot_util_usage_error (context, "OSNAME must be specified", error); + goto out; + } + + osname = argv[1]; + + if (argc > 2) + { + deployment = ot_gfile_get_child_build_path (ostree_dir, "deploy", osname, argv[2], NULL); if (!g_file_query_exists (deployment, NULL)) { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, @@ -68,7 +77,7 @@ ot_admin_builtin_diff (int argc, char **argv, GFile *ostree_dir, GError **error) } else { - if (!ot_admin_get_current_deployment (ostree_dir, &deployment, + if (!ot_admin_get_current_deployment (ostree_dir, osname, &deployment, cancellable, error)) goto out; } |