admin-deploy: Add `--stateroot` as alias for `--os`
authorColin Walters <walters@verbum.org>
Thu, 17 Aug 2023 20:48:05 +0000 (16:48 -0400)
committerColin Walters <walters@verbum.org>
Thu, 17 Aug 2023 20:49:09 +0000 (16:49 -0400)
To further help deprecate the confusing "osname" terminology.

man/ostree-admin-deploy.xml
src/ostree/ot-admin-builtin-deploy.c
tests/admin-test.sh

index 0d73b8e10e7dd98a596de50b43cc9521ade3beca..8915ad2c0bca56050d3eea44c46255a729271a04 100644 (file)
@@ -65,11 +65,19 @@ License along with this library. If not, see <https://www.gnu.org/licenses/>.
         <title>Options</title>
 
         <variablelist>
+            <varlistentry>
+                <term><option>--stateroot</option>="STATEROOT"</term>
+
+                <listitem><para>
+                    Use a different operating system stateroot than the current one.
+                </para></listitem>
+            </varlistentry>
+
             <varlistentry>
                 <term><option>--os</option>="STATEROOT"</term>
 
                 <listitem><para>
-                    Use a different operating system root than the current one.
+                    Alias for <literal>--stateroot</literal>.
                 </para></listitem>
             </varlistentry>
 
index 00204ffdcb333f243dab5fb4dd1b817ef971606e..bfeb81d9050e0a9603c86b44198bf159f16b9751 100644 (file)
@@ -51,6 +51,8 @@ static char **opt_overlay_initrds;
 static GOptionEntry options[] = {
   { "os", 0, 0, G_OPTION_ARG_STRING, &opt_osname,
     "Use a different operating system root than the current one", "OSNAME" },
+  { "stateroot", 0, 0, G_OPTION_ARG_STRING, &opt_osname, "Target the provided stateroot",
+    "STATEROOT" },
   { "origin-file", 0, 0, G_OPTION_ARG_FILENAME, &opt_origin_path, "Specify origin file",
     "FILENAME" },
   { "no-prune", 0, 0, G_OPTION_ARG_NONE, &opt_no_prune, "Don't prune the repo when done", NULL },
index 9962e2edb2555cc42e3517395d041a3ae8de8a1b..e362162c5b6407232122272bb7a89a319f90578e 100644 (file)
@@ -97,7 +97,7 @@ assert_file_has_content_literal err.txt "Cannot stage deployment: Not currently
 echo "ok staging does not work when not booted"
 
 orig_mtime=$(stat -c '%.Y' sysroot/ostree/deploy)
-${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmain/x86_64-runtime
+${CMD_PREFIX} ostree admin deploy --stateroot=testos testos:testos/buildmain/x86_64-runtime
 new_mtime=$(stat -c '%.Y' sysroot/ostree/deploy)
 assert_not_streq "${orig_mtime}" "${new_mtime}"
 # Need a new bootversion, sine we now have two deployments