cli: Add RPMOSTREE_CLIENT_ID environment variable

Currently [zincati](https://github.com/coreos/zincati/) executes
`rpm-ostree deploy` via the CLI - that just shows up as `cli` as
an agent.  This makes it easier to highlight the fact that it's
actually zincati driving things.

Closes: #1880
Approved by: lucab
This commit is contained in:
Colin Walters 2019-08-06 16:20:54 +00:00 committed by Atomic Bot
parent 241c9f508f
commit 016c1c5e62

View File

@ -214,8 +214,8 @@ rpmostree_load_sysroot (gchar *sysroot,
g_autoptr(GError) local_error = NULL;
g_autoptr(GVariantBuilder) options_builder =
g_variant_builder_new (G_VARIANT_TYPE ("a{sv}"));
g_variant_builder_add (options_builder, "{sv}", "id",
g_variant_new_string (RPMOSTREE_CLI_ID));
const char *clientid = g_getenv ("RPMOSTREE_CLIENT_ID") ?: RPMOSTREE_CLI_ID;
g_variant_builder_add (options_builder, "{sv}", "id", g_variant_new_string (clientid));
g_autoptr(GVariant) res =
g_dbus_connection_call_sync (connection, bus_name, sysroot_objpath,
"org.projectatomic.rpmostree1.Sysroot",