-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
app: add 'makecache' command #1035
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d62abc4
libpriv/core: log repo info when downloading rpmmd
jlebon 09949bd
app: add 'refresh-md' command
jlebon 1f0b9f2
app: add -C flag to always use cached metadata
jlebon 17cbcf8
tests/libvm: use rsync and add yumrepo mode
jlebon 14dd63a
tests/vmcheck: add test for refresh-md and --cache-only
jlebon 76d0481
fixup! app: add 'refresh-md' command
jlebon fff9a14
fixup! tests/vmcheck: add test for refresh-md and --cache-only
jlebon 1302079
fixup! tests/vmcheck: add test for refresh-md and --cache-only
jlebon 9ef939f
fixup! app: add 'refresh-md' command
jlebon 3f85d1a
fixup! tests/vmcheck: add test for refresh-md and --cache-only
jlebon 4eec99e
fixup! tests/vmcheck: add test for refresh-md and --cache-only
jlebon cb328b5
fixup! tests/vmcheck: add test for refresh-md and --cache-only
jlebon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,97 @@ | ||
/* 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 char *opt_force; | ||
|
||
static GOptionEntry option_entries[] = { | ||
{ "os", 0, 0, G_OPTION_ARG_STRING, &opt_osname, "Operate on provided OSNAME", "OSNAME" }, | ||
{ "force", 'f', 0, G_OPTION_ARG_NONE, &opt_force, "Expire current cache", NULL }, | ||
{ NULL } | ||
}; | ||
|
||
static GVariant * | ||
get_args_variant (void) | ||
{ | ||
GVariantDict dict; | ||
g_variant_dict_init (&dict, NULL); | ||
g_variant_dict_insert (&dict, "force", "b", opt_force); | ||
return g_variant_dict_end (&dict); | ||
} | ||
|
||
int | ||
rpmostree_builtin_refresh_md (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_refresh_md_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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah...but what about the ostree side? The option makes sense there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I was mostly going off of the
--cache-only
naming from the compose side. I suppose we'll have to have a new switch there too for unified core re. ostree caching? Would be nice to keep it consistent across those commands.