lib/repo-refs: Include remote refs when using collections
When working with collections it can be useful to see remote refs rather than just local and mirrored ones. This commit changes the "ostree refs -c" output to include remote refs, and includes remote refs with collection IDs in summary file generation as well. The former behavior is consistent with how "ostree refs" works, and the latter behavior is useful in facilitating P2P updates even when mirrors haven't been configured. To accomplish this, OstreeRepoListRefsExtFlags was extended with an EXCLUDE_REMOTES flag. This was done rather than an INCLUDE_REMOTES flag so that existing calls to ostree_repo_list_refs_ext continue to have the same behavior. This flag was added to ostree_repo_list_collection_refs (which is an experimental API break). Also, add unit tests for the "refs -c" and summary file behavior, and update relevant tests. Closes: #1069 Approved by: cgwalters
This commit is contained in:
1 parent
95bac299e5
commit
7ed881baa7
12 files changed
+180
-77
No files matched your search
@@ -475,10 +475,12 @@ gboolean ostree_repo_list_refs (OstreeRepo *self,
|
||||
* OstreeRepoListRefsExtFlags:
|
||||
* @OSTREE_REPO_LIST_REFS_EXT_NONE: No flags.
|
||||
* @OSTREE_REPO_LIST_REFS_EXT_ALIASES: Only list aliases. Since: 2017.10
|
||||
* @OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES: Exclude remote refs. Since: 2017.11
|
||||
*/
|
||||
typedef enum {
|
||||
OSTREE_REPO_LIST_REFS_EXT_NONE = 0,
|
||||
OSTREE_REPO_LIST_REFS_EXT_ALIASES = 1,
|
||||
OSTREE_REPO_LIST_REFS_EXT_ALIASES = (1 << 0),
|
||||
OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES = (1 << 1),
|
||||
} OstreeRepoListRefsExtFlags;
|
||||
|
||||
_OSTREE_PUBLIC
|
||||
@@ -1190,11 +1192,12 @@ gchar *ostree_repo_resolve_keyring_for_collection (OstreeRepo *self,
|
||||
GError **error);
|
||||
|
||||
_OSTREE_PUBLIC
|
||||
gboolean ostree_repo_list_collection_refs (OstreeRepo *self,
|
||||
const char *match_collection_id,
|
||||
GHashTable **out_all_refs,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
gboolean ostree_repo_list_collection_refs (OstreeRepo *self,
|
||||
const char *match_collection_id,
|
||||
GHashTable **out_all_refs,
|
||||
OstreeRepoListRefsExtFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
|
||||
|
||||
|
||||
Reference in new issue
Block a user