-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is essentially the `dnf`/`yum` equivalent for rpm-ostree. To complete the picture, we're missing the `-C` equivalent as well for all the commands that make use of this metadata. Though `makecache` on its own should be particularly helpful in test environment provisioning where one may have cached metadata available to inject and just wants rpm-ostree to sanity check it.
- Loading branch information
Showing
14 changed files
with
325 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* Copyright (C) 2017 Jonathan Lebon <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published | ||
* by the Free Software Foundation; either version 2 of the licence or (at | ||
* your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General | ||
* Public License along with this library; if not, write to the | ||
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, | ||
* Boston, MA 02111-1307, USA. | ||
*/ | ||
|
||
#include "config.h" | ||
|
||
#include <string.h> | ||
#include <glib-unix.h> | ||
|
||
#include "rpmostree-builtins.h" | ||
#include "rpmostree-util.h" | ||
#include "rpmostree-libbuiltin.h" | ||
#include "rpmostree-dbus-helpers.h" | ||
|
||
#include <libglnx.h> | ||
|
||
static char *opt_osname; | ||
|
||
static GOptionEntry option_entries[] = { | ||
{ "os", 0, 0, G_OPTION_ARG_STRING, &opt_osname, "Operate on provided OSNAME", "OSNAME" }, | ||
{ NULL } | ||
}; | ||
|
||
static GVariant * | ||
get_args_variant (void) | ||
{ | ||
GVariantDict dict; | ||
g_variant_dict_init (&dict, NULL); | ||
return g_variant_dict_end (&dict); | ||
} | ||
|
||
int | ||
rpmostree_builtin_makecache (int argc, | ||
char **argv, | ||
RpmOstreeCommandInvocation *invocation, | ||
GCancellable *cancellable, | ||
GError **error) | ||
{ | ||
g_autoptr(GOptionContext) context = g_option_context_new (""); | ||
glnx_unref_object RPMOSTreeOS *os_proxy = NULL; | ||
glnx_unref_object RPMOSTreeSysroot *sysroot_proxy = NULL; | ||
g_autofree char *transaction_address = NULL; | ||
_cleanup_peer_ GPid peer_pid = 0; | ||
|
||
if (!rpmostree_option_context_parse (context, | ||
option_entries, | ||
&argc, &argv, | ||
invocation, | ||
cancellable, | ||
NULL, NULL, | ||
&sysroot_proxy, | ||
&peer_pid, | ||
error)) | ||
return EXIT_FAILURE; | ||
|
||
if (argc < 1 || argc > 2) | ||
{ | ||
rpmostree_usage_error (context, "Too few or too many arguments", error); | ||
return EXIT_FAILURE; | ||
} | ||
|
||
if (!rpmostree_load_os_proxy (sysroot_proxy, opt_osname, | ||
cancellable, &os_proxy, error)) | ||
return EXIT_FAILURE; | ||
|
||
if (!rpmostree_os_call_make_cache_sync (os_proxy, | ||
get_args_variant (), | ||
&transaction_address, | ||
cancellable, | ||
error)) | ||
return EXIT_FAILURE; | ||
|
||
if (!rpmostree_transaction_get_response_sync (sysroot_proxy, | ||
transaction_address, | ||
cancellable, | ||
error)) | ||
return EXIT_FAILURE; | ||
|
||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.