Make P2P API public (no longer experimental)

Currently the API that allows P2P operations (e.g. pulling an ostree ref
from a LAN or USB source) is hidden behind the configure flag
--enable-experimental-api. This commit makes the API public and makes
that flag essentially a no-op (leaving it in place in case we want to
use it again in the future). The P2P API has been tested over the last
several months and proven to work.

This means that since we're no longer using the "experimental" feature
flag, P2P builds of Flatpak will fail when using versions of OSTree from
this commit onwards, until Flatpak is patched in the near future. If you
want to build Flatpak < 0.11.8 with P2P enabled and link against OSTree
2018.6, you'll have to patch Flatpak.  However, since Flatpak won't yet
have a hard dependency on OSTree 2018.6, it needs a new way to determine
if the P2P API in OSTree is available, so this commit adds a "p2p"
feature flag. This way the feature set is more semantically correct than
if we had continued to use the "experimental" feature flag.

In addition to making the P2P API public, this commit makes the P2P unit
tests run by default, removes the f27-experimental CI instance that's no
longer needed, changes a few man pages to reflect the changes, and
updates the bash completion script to accept the new commands and
options.

Closes: #1596
Approved by: cgwalters
This commit is contained in:
Matthew Leeds authored and Atomic Bot committed 2018-06-04 19:20:10 +00:00
1 parent f1d9196076
commit 8fbf19c9f5
48 files changed
+347 -513

No files matched your search

+5 -27
View File
@@ -41,14 +41,12 @@
#include "ostree-remote-private.h"
#include "ot-fs-utils.h"
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
#include "ostree-repo-finder.h"
#include "ostree-repo-finder-config.h"
#include "ostree-repo-finder-mount.h"
#ifdef HAVE_AVAHI
#include "ostree-repo-finder-avahi.h"
#endif /* HAVE_AVAHI */
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
#include <gio/gunixinputstream.h>
#include <sys/statvfs.h>
@@ -904,15 +902,11 @@ fetch_ref_contents (OtPullData *pull_data,
if (pull_data->remote_repo_local != NULL && ref->collection_id != NULL)
{
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (!ostree_repo_resolve_collection_ref (pull_data->remote_repo_local,
ref, FALSE,
OSTREE_REPO_RESOLVE_REV_EXT_NONE,
&ret_contents, cancellable, error))
return FALSE;
#else /* if !OSTREE_ENABLE_EXPERIMENTAL_API */
g_assert_not_reached ();
#endif /* !OSTREE_ENABLE_EXPERIMENTAL_API */
}
else if (pull_data->remote_repo_local != NULL)
{
@@ -1586,7 +1580,6 @@ _ostree_repo_verify_bindings (const char *collection_id,
if (collection_id != NULL)
{
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
const char *collection_id_binding;
if (!g_variant_lookup (metadata,
OSTREE_COMMIT_META_KEY_COLLECTION_BINDING,
@@ -1601,14 +1594,11 @@ _ostree_repo_verify_bindings (const char *collection_id,
"metadata, while the remote it came from has "
"collection ID ‘%s’",
collection_id_binding, collection_id);
#endif
}
return TRUE;
}
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
/* Reads the collection-id of a given remote from the repo
* configuration.
*/
@@ -1692,7 +1682,7 @@ check_remote_matches_collection_id (OstreeRepo *repo,
*
* Returns: (transfer full): #OstreeRemote containing the GPG keyring for
* @collection_id
* Since: 2017.8
* Since: 2018.6
*/
OstreeRemote *
ostree_repo_resolve_keyring_for_collection (OstreeRepo *self,
@@ -1763,8 +1753,6 @@ ostree_repo_resolve_keyring_for_collection (OstreeRepo *self,
}
}
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
#ifdef HAVE_LIBCURL_OR_LIBSOUP
/* Look at a commit object, and determine whether there are
@@ -1822,9 +1810,7 @@ scan_commit_object (OtPullData *pull_data,
* branch, otherwise we requested a commit checksum without specifying a branch.
*/
g_autofree char *remote_collection_id = NULL;
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
remote_collection_id = get_remote_repo_collection_id (pull_data);
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
if (!_ostree_repo_verify_bindings (remote_collection_id,
(ref != NULL) ? ref->ref_name : NULL,
commit, error))
@@ -4619,8 +4605,6 @@ ostree_repo_pull_with_options (OstreeRepo *self,
return ret;
}
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
/* Structure used in ostree_repo_find_remotes_async() which stores metadata
* about a given OSTree commit. This includes the metadata from the commit
* #GVariant, plus some working state which is used to work out which remotes
@@ -4903,7 +4887,7 @@ static void find_remotes_cb (GObject *obj,
*
* This will use the thread-default #GMainContext, but will not iterate it.
*
* Since: 2017.8
* Since: 2018.6
*/
void
ostree_repo_find_remotes_async (OstreeRepo *self,
@@ -5639,7 +5623,7 @@ error:
* Returns: (transfer full) (array zero-terminated=1): a potentially empty array
* of #OstreeRepoFinderResults, followed by a %NULL terminator element; or
* %NULL on error
* Since: 2017.8
* Since: 2018.6
*/
OstreeRepoFinderResult **
ostree_repo_find_remotes_finish (OstreeRepo *self,
@@ -5719,7 +5703,7 @@ copy_option (GVariantDict *master_options,
* milliseconds, if any; only values higher than 0 are valid
* * `append-user-agent` (`s`): Additional string to append to the user agent
*
* Since: 2017.8
* Since: 2018.6
*/
void
ostree_repo_pull_from_remotes_async (OstreeRepo *self,
@@ -5920,7 +5904,7 @@ ostree_repo_pull_from_remotes_async (OstreeRepo *self,
* ostree_repo_pull_from_remotes_async().
*
* Returns: %TRUE on success, %FALSE otherwise
* Since: 2017.8
* Since: 2018.6
*/
gboolean
ostree_repo_pull_from_remotes_finish (OstreeRepo *self,
@@ -5935,8 +5919,6 @@ ostree_repo_pull_from_remotes_finish (OstreeRepo *self,
return g_task_propagate_boolean (G_TASK (result), error);
}
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
/**
* ostree_repo_remote_fetch_summary_with_options:
* @self: Self
@@ -6089,8 +6071,6 @@ ostree_repo_remote_fetch_summary_with_options (OstreeRepo *self,
return FALSE;
}
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
void
ostree_repo_find_remotes_async (OstreeRepo *self,
const OstreeCollectionRef * const *refs,
@@ -6158,6 +6138,4 @@ ostree_repo_pull_from_remotes_finish (OstreeRepo *self,
return FALSE;
}
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
#endif /* HAVE_LIBCURL_OR_LIBSOUP */