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 2018-05-22 15:55:14 -07:00 committed by Atomic Bot
parent f1d9196076
commit 8fbf19c9f5
48 changed files with 347 additions and 513 deletions

View File

@ -81,17 +81,6 @@ tests:
inherit: true
context: f28-experimental-api
env:
CONFIGOPTS: '--enable-experimental-api'
tests:
- ci/build-check.sh
---
inherit: true
context: f28-minimal
env:
CONFIGOPTS: '--without-curl --without-soup --disable-gtk-doc --disable-man

View File

@ -86,17 +86,6 @@ tests:
inherit: true
context: f28-experimental-api
env:
CONFIGOPTS: '--enable-experimental-api'
tests:
- ci/build-check.sh
---
inherit: true
context: f28-minimal
env:
CONFIGOPTS: '--without-curl --without-soup --disable-gtk-doc --disable-man

View File

@ -38,10 +38,6 @@ libostree_public_headers = \
src/libostree/ostree-deployment.h \
src/libostree/ostree-bootconfig-parser.h \
src/libostree/ostree-repo-deprecated.h \
$(NULL)
if ENABLE_EXPERIMENTAL_API
libostree_public_headers += \
src/libostree/ostree-ref.h \
src/libostree/ostree-remote.h \
src/libostree/ostree-repo-finder.h \
@ -50,7 +46,6 @@ libostree_public_headers += \
src/libostree/ostree-repo-finder-mount.h \
src/libostree/ostree-repo-finder-override.h \
$(NULL)
endif
# This one is generated via configure.ac, and the gtk-doc
# code hence needs to look in the builddir.

View File

@ -140,6 +140,13 @@ libostree_1_la_SOURCES = \
src/libostree/ostree-gpg-verify-result.c \
src/libostree/ostree-gpg-verify-result-private.h \
src/libostree/ostree-autocleanups.h \
src/libostree/ostree-bloom.c \
src/libostree/ostree-bloom-private.h \
src/libostree/ostree-repo-finder.c \
src/libostree/ostree-repo-finder-avahi.c \
src/libostree/ostree-repo-finder-config.c \
src/libostree/ostree-repo-finder-mount.c \
src/libostree/ostree-repo-finder-override.c \
$(NULL)
if USE_LIBARCHIVE
libostree_1_la_SOURCES += src/libostree/ostree-libarchive-input-stream.h \
@ -154,26 +161,13 @@ libostree_1_la_SOURCES += \
$(NULL)
endif
libostree_experimental_headers = \
src/libostree/ostree-ref.h \
src/libostree/ostree-remote.h \
src/libostree/ostree-repo-finder.h \
src/libostree/ostree-repo-finder-avahi.h \
src/libostree/ostree-repo-finder-config.h \
src/libostree/ostree-repo-finder-mount.h \
src/libostree/ostree-repo-finder-override.h \
$(NULL)
if !ENABLE_EXPERIMENTAL_API
libostree_1_la_SOURCES += $(libostree_experimental_headers)
else # if ENABLE_EXPERIMENTAL_API
libostree_1_la_SOURCES += \
src/libostree/ostree-bloom.c \
src/libostree/ostree-bloom-private.h \
src/libostree/ostree-repo-finder.c \
src/libostree/ostree-repo-finder-avahi.c \
src/libostree/ostree-repo-finder-config.c \
src/libostree/ostree-repo-finder-mount.c \
src/libostree/ostree-repo-finder-override.c \
$(NULL)
endif
if USE_AVAHI
libostree_1_la_SOURCES += \
@ -181,20 +175,15 @@ libostree_1_la_SOURCES += \
src/libostree/ostree-repo-finder-avahi-private.h \
$(NULL)
endif # USE_AVAHI
endif
symbol_files = $(top_srcdir)/src/libostree/libostree-released.sym
if BUILDOPT_IS_DEVEL_BUILD
symbol_files += $(top_srcdir)/src/libostree/libostree-devel.sym
endif
if ENABLE_EXPERIMENTAL_API
symbol_files += $(top_srcdir)/src/libostree/libostree-experimental.sym
endif
# http://blog.jgc.org/2007/06/escaping-comma-and-space-in-gnu-make.html
wl_versionscript_arg = -Wl,--version-script=
EXTRA_DIST += \
$(top_srcdir)/src/libostree/libostree-devel.sym \
$(top_srcdir)/src/libostree/libostree-experimental.sym \
$(top_srcdir)/src/libostree/libostree-released.sym \
$(NULL)
@ -216,12 +205,10 @@ libostree_1_la_CFLAGS += $(OT_DEP_LIBARCHIVE_CFLAGS)
libostree_1_la_LIBADD += $(OT_DEP_LIBARCHIVE_LIBS)
endif
if ENABLE_EXPERIMENTAL_API
if USE_AVAHI
libostree_1_la_CFLAGS += $(OT_DEP_AVAHI_CFLAGS)
libostree_1_la_LIBADD += $(OT_DEP_AVAHI_LIBS)
endif
endif
if BUILDOPT_LIBSYSTEMD
libostree_1_la_CFLAGS += $(LIBSYSTEMD_CFLAGS)

View File

@ -28,11 +28,12 @@ ostree-admin-status.1 ostree-admin-set-origin.1 ostree-admin-switch.1 \
ostree-admin-undeploy.1 ostree-admin-upgrade.1 ostree-admin-unlock.1 \
ostree-admin-pin.1 \
ostree-admin.1 ostree-cat.1 ostree-checkout.1 ostree-checksum.1 \
ostree-commit.1 ostree-export.1 ostree-gpg-sign.1 ostree-config.1 \
ostree-diff.1 ostree-fsck.1 ostree-init.1 ostree-log.1 ostree-ls.1 \
ostree-prune.1 ostree-pull-local.1 ostree-pull.1 ostree-refs.1 \
ostree-remote.1 ostree-reset.1 ostree-rev-parse.1 ostree-show.1 \
ostree-summary.1 ostree-static-delta.1
ostree-commit.1 ostree-create-usb.1 ostree-export.1 ostree-gpg-sign.1 \
ostree-config.1 ostree-diff.1 ostree-find-remotes.1 ostree-fsck.1 \
ostree-init.1 ostree-log.1 ostree-ls.1 ostree-prune.1 ostree-pull-local.1 \
ostree-pull.1 ostree-refs.1 ostree-remote.1 ostree-reset.1 \
ostree-rev-parse.1 ostree-show.1 ostree-summary.1 \
ostree-static-delta.1
if BUILDOPT_TRIVIAL_HTTPD
man1_files += ostree-trivial-httpd.1
else
@ -44,10 +45,6 @@ if BUILDOPT_FUSE
man1_files += rofiles-fuse.1
endif
if ENABLE_EXPERIMENTAL_API
man1_files += ostree-find-remotes.1 ostree-create-usb.1
endif
man5_files = ostree.repo.5 ostree.repo-config.5
man1_MANS = $(addprefix man/,$(man1_files))

View File

@ -29,8 +29,10 @@ ostree_SOURCES = src/ostree/main.c \
src/ostree/ot-builtin-checkout.c \
src/ostree/ot-builtin-checksum.c \
src/ostree/ot-builtin-commit.c \
src/ostree/ot-builtin-create-usb.c \
src/ostree/ot-builtin-diff.c \
src/ostree/ot-builtin-export.c \
src/ostree/ot-builtin-find-remotes.c \
src/ostree/ot-builtin-fsck.c \
src/ostree/ot-builtin-gpg-sign.c \
src/ostree/ot-builtin-init.c \
@ -60,8 +62,6 @@ nodist_ostree_SOURCES = \
if ENABLE_EXPERIMENTAL_API
ostree_SOURCES += \
src/ostree/ot-builtin-create-usb.c \
src/ostree/ot-builtin-find-remotes.c \
$(NULL)
endif

View File

@ -54,7 +54,11 @@ dist_uninstalled_test_scripts = tests/test-symbols.sh tests/coccinelle.sh
# This overrides the glib-tap.mk emphasis on doing both, if we'd
# used e.g. `dist_test_scripts`.
dist_test_scripts = $(NULL)
test_programs = $(NULL)
test_programs = \
tests/test-bloom \
tests/test-repo-finder-config \
tests/test-repo-finder-mount \
$(NULL)
_installed_or_uninstalled_test_scripts = \
tests/test-basic.sh \
tests/test-basic-user.sh \
@ -119,9 +123,6 @@ _installed_or_uninstalled_test_scripts = \
tests/test-summary-update.sh \
tests/test-summary-view.sh \
tests/test-no-initramfs.sh \
$(NULL)
experimental_test_scripts = \
tests/test-create-usb.sh \
tests/test-find-remotes.sh \
tests/test-fsck-collections.sh \
@ -133,8 +134,12 @@ experimental_test_scripts = \
tests/test-summary-collections.sh \
tests/test-pull-collections.sh \
$(NULL)
experimental_test_scripts = \
$(NULL)
test_extra_programs = \
tests/get-byte-order \
tests/repo-finder-mount \
$(NULL)
tests_get_byte_order_SOURCES = tests/get-byte-order.c
@ -147,7 +152,6 @@ tests_repo_finder_mount_LDADD = $(common_tests_ldadd) libostreetest.la
if ENABLE_EXPERIMENTAL_API
_installed_or_uninstalled_test_scripts += $(experimental_test_scripts)
test_extra_programs += tests/repo-finder-mount
else
EXTRA_DIST += $(experimental_test_scripts)
endif
@ -240,17 +244,9 @@ _installed_or_uninstalled_test_programs = tests/test-varint tests/test-ot-unix-u
tests/test-gpg-verify-result tests/test-checksum tests/test-lzma tests/test-rollsum \
tests/test-basic-c tests/test-sysroot-c tests/test-pull-c tests/test-repo
if ENABLE_EXPERIMENTAL_API
test_programs += \
tests/test-bloom \
tests/test-repo-finder-config \
tests/test-repo-finder-mount \
$(NULL)
if USE_AVAHI
test_programs += tests/test-repo-finder-avahi
endif
endif
# An interactive tool
noinst_PROGRAMS += tests/test-rollsum-cli

View File

@ -1,101 +0,0 @@
<SECTION>
<FILE>ostree-ref</FILE>
OstreeCollectionRef
ostree_collection_ref_new
ostree_collection_ref_dup
ostree_collection_ref_free
ostree_collection_ref_hash
ostree_collection_ref_equal
OstreeCollectionRefv
ostree_collection_ref_dupv
ostree_collection_ref_freev
<SUBSECTION Standard>
ostree_collection_ref_get_type
</SECTION>
<SECTION>
<FILE>ostree-remote</FILE>
OstreeRemote
ostree_remote_ref
ostree_remote_unref
ostree_remote_get_name
ostree_remote_get_url
<SUBSECTION Standard>
ostree_remote_get_type
</SECTION>
<SECTION>
<FILE>ostree-repo-experimental</FILE>
ostree_repo_find_remotes_async
ostree_repo_find_remotes_finish
ostree_repo_pull_from_remotes_async
ostree_repo_pull_from_remotes_finish
ostree_repo_resolve_keyring_for_collection
OSTREE_REPO_METADATA_REF
</SECTION>
<SECTION>
<FILE>ostree-repo-finder</FILE>
OstreeRepoFinder
ostree_repo_finder_resolve_async
ostree_repo_finder_resolve_finish
ostree_repo_finder_resolve_all_async
ostree_repo_finder_resolve_all_finish
OstreeRepoFinderResult
ostree_repo_finder_result_new
ostree_repo_finder_result_dup
ostree_repo_finder_result_free
ostree_repo_finder_result_compare
OstreeRepoFinderResultv
ostree_repo_finder_result_freev
<SUBSECTION Standard>
ostree_repo_finder_get_type
ostree_repo_finder_result_get_type
</SECTION>
<SECTION>
<FILE>ostree-repo-finder-avahi</FILE>
OstreeRepoFinderAvahi
ostree_repo_finder_avahi_new
ostree_repo_finder_avahi_start
ostree_repo_finder_avahi_stop
<SUBSECTION Standard>
ostree_repo_finder_avahi_get_type
</SECTION>
<SECTION>
<FILE>ostree-repo-finder-config</FILE>
OstreeRepoFinderConfig
ostree_repo_finder_config_new
<SUBSECTION Standard>
ostree_repo_finder_config_get_type
</SECTION>
<SECTION>
<FILE>ostree-repo-finder-mount</FILE>
OstreeRepoFinderMount
ostree_repo_finder_mount_new
<SUBSECTION Standard>
ostree_repo_finder_mount_get_type
</SECTION>
<SECTION>
<FILE>ostree-repo-finder-override</FILE>
OstreeRepoFinderOverride
ostree_repo_finder_override_new
ostree_repo_finder_override_add_uri
<SUBSECTION Standard>
ostree_repo_finder_override_get_type
</SECTION>
<SECTION>
<FILE>ostree-misc-experimental</FILE>
ostree_repo_get_collection_id
ostree_repo_set_collection_id
ostree_validate_collection_id
ostree_repo_list_collection_refs
ostree_repo_remote_list_collection_refs
ostree_repo_set_collection_ref_immediate
ostree_repo_transaction_set_collection_ref
ostree_repo_resolve_collection_ref
</SECTION>

View File

@ -558,3 +558,105 @@ OSTREE_TYPE_SYSROOT_UPGRADER
ostree_sysroot_upgrader_get_type
ostree_sysroot_upgrader_flags_get_type
</SECTION>
<SECTION>
<FILE>ostree-ref</FILE>
OstreeCollectionRef
ostree_collection_ref_new
ostree_collection_ref_dup
ostree_collection_ref_free
ostree_collection_ref_hash
ostree_collection_ref_equal
OstreeCollectionRefv
ostree_collection_ref_dupv
ostree_collection_ref_freev
<SUBSECTION Standard>
ostree_collection_ref_get_type
</SECTION>
<SECTION>
<FILE>ostree-remote</FILE>
OstreeRemote
ostree_remote_ref
ostree_remote_unref
ostree_remote_get_name
ostree_remote_get_url
<SUBSECTION Standard>
ostree_remote_get_type
</SECTION>
<SECTION>
<FILE>ostree-repo-experimental</FILE>
ostree_repo_find_remotes_async
ostree_repo_find_remotes_finish
ostree_repo_pull_from_remotes_async
ostree_repo_pull_from_remotes_finish
ostree_repo_resolve_keyring_for_collection
OSTREE_REPO_METADATA_REF
</SECTION>
<SECTION>
<FILE>ostree-repo-finder</FILE>
OstreeRepoFinder
ostree_repo_finder_resolve_async
ostree_repo_finder_resolve_finish
ostree_repo_finder_resolve_all_async
ostree_repo_finder_resolve_all_finish
OstreeRepoFinderResult
ostree_repo_finder_result_new
ostree_repo_finder_result_dup
ostree_repo_finder_result_free
ostree_repo_finder_result_compare
OstreeRepoFinderResultv
ostree_repo_finder_result_freev
<SUBSECTION Standard>
ostree_repo_finder_get_type
ostree_repo_finder_result_get_type
</SECTION>
<SECTION>
<FILE>ostree-repo-finder-avahi</FILE>
OstreeRepoFinderAvahi
ostree_repo_finder_avahi_new
ostree_repo_finder_avahi_start
ostree_repo_finder_avahi_stop
<SUBSECTION Standard>
ostree_repo_finder_avahi_get_type
</SECTION>
<SECTION>
<FILE>ostree-repo-finder-config</FILE>
OstreeRepoFinderConfig
ostree_repo_finder_config_new
<SUBSECTION Standard>
ostree_repo_finder_config_get_type
</SECTION>
<SECTION>
<FILE>ostree-repo-finder-mount</FILE>
OstreeRepoFinderMount
ostree_repo_finder_mount_new
<SUBSECTION Standard>
ostree_repo_finder_mount_get_type
</SECTION>
<SECTION>
<FILE>ostree-repo-finder-override</FILE>
OstreeRepoFinderOverride
ostree_repo_finder_override_new
ostree_repo_finder_override_add_uri
<SUBSECTION Standard>
ostree_repo_finder_override_get_type
</SECTION>
<SECTION>
<FILE>ostree-misc-experimental</FILE>
ostree_repo_get_collection_id
ostree_repo_set_collection_id
ostree_validate_collection_id
ostree_repo_list_collection_refs
ostree_repo_remote_list_collection_refs
ostree_repo_set_collection_ref_immediate
ostree_repo_transaction_set_collection_ref
ostree_repo_resolve_collection_ref
</SECTION>

View File

@ -120,12 +120,25 @@ __ostree_compreply_oses() {
fi
}
# Find refs associated with the given collection ID under $repo_path.
__ostree_compreply_collection_refs() {
local collection_id=( $1 )
refs=$( ostree refs --repo $repo_path --collections $collection_id 2>/dev/null | cut -d ' ' -f 2 | sed -e 's/)$//' )
COMPREPLY+=( $( compgen -W "$refs" -- "$cur" ) )
}
# Find refs under $repo_path.
__ostree_compreply_refs() {
refs=$( ostree refs --repo $repo_path 2>/dev/null )
COMPREPLY+=( $( compgen -W "$refs" -- "$cur" ) )
}
# Find collection IDs under $repo_path.
__ostree_compreply_collection_ids() {
collection_ids=$( ostree refs --repo $repo_path --collections 2>/dev/null | cut -d ',' -f 1 | sed -e 's/^(//' | sort | uniq )
COMPREPLY+=( $( compgen -W "$collection_ids" -- "$cur" ) )
}
# Find remotes under $repo_path.
__ostree_compreply_remotes() {
remotes=$( ostree remote list --repo $repo_path 2> /dev/null )
@ -410,6 +423,49 @@ _ostree_config() {
return 0
}
_ostree_create_usb() {
local boolean_options="
$main_boolean_options
--disable-fsync
"
local options_with_args="
--destination-repo
--repo
"
local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
case "$prev" in
--destination-repo|--repo)
__ostree_compreply_dirs_only
return 0
;;
$options_with_args_glob )
return 0
;;
esac
case "$cur" in
-*)
local all_options="$boolean_options $options_with_args"
__ostree_compreply_all_options
;;
*)
local argpos=$( __ostree_pos_first_nonflag $( __ostree_to_alternatives "$options_with_args" ) )
if [ $cword -eq $argpos ]; then
__ostree_compreply_dirs_only
elif [ $cword -gt $argpos ] && [ $(((cword - argpos) % 2)) -eq 1 ]; then
__ostree_compreply_collection_ids
elif [ $cword -gt $argpos ] && [ $(((cword - argpos) % 2)) -eq 0 ]; then
__ostree_compreply_collection_refs "${words[$cword - 1]}"
fi
esac
return 0
}
_ostree_diff() {
local boolean_options="
$main_boolean_options
@ -495,6 +551,56 @@ _ostree_export() {
return 0
}
_ostree_find_remotes() {
local boolean_options="
$main_boolean_options
--disable-fsync
--pull
"
local options_with_args="
--finders
--repo
"
local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
case "$prev" in
--finders)
local choices="config lan mount"
local config_first="config,lan config,mount config,lan,mount config,mount,lan"
local lan_first="lan,config lan,mount lan,config,mount lan,mount,config"
local mount_first="mount,config mount,lan mount,lan,config mount,config,lan"
COMPREPLY+=( $( compgen -W "$choices $config_first $lan_first $mount_first" -- "$cur" ) )
return 0
;;
--repo)
__ostree_compreply_dirs_only
return 0
;;
$options_with_args_glob )
return 0
;;
esac
case "$cur" in
-*)
local all_options="$boolean_options $options_with_args"
__ostree_compreply_all_options
;;
*)
local argpos=$( __ostree_pos_first_nonflag $( __ostree_to_alternatives "$options_with_args" ) )
if [ $cword -ge $argpos ] && [ $(((cword - argpos) % 2)) -eq 0 ]; then
__ostree_compreply_collection_ids
elif [ $cword -ge $argpos ] && [ $(((cword - argpos) % 2)) -eq 1 ]; then
__ostree_compreply_collection_refs "${words[$cword - 1]}"
fi
esac
return 0
}
_ostree_fsck() {
local boolean_options="
$main_boolean_options
@ -576,6 +682,7 @@ _ostree_init() {
"
local options_with_args="
--collection-id
--mode
--repo
"
@ -839,6 +946,7 @@ _ostree_refs() {
local boolean_options="
$main_boolean_options
--alias -A
--collections -c
--delete
--list
"
@ -878,6 +986,7 @@ _ostree_remote_add() {
"
local options_with_args="
--collection-id
--contenturl
--gpg-import
--repo
@ -1615,8 +1724,10 @@ _ostree() {
checksum
commit
config
create-usb
diff
export
find-remotes
fsck
gpg-sign
init

View File

@ -572,6 +572,9 @@ AM_COND_IF([BUILDOPT_IS_DEVEL_BUILD],
release_build_type=release)
OSTREE_FEATURES="$OSTREE_FEATURES $release_build_type"
# P2P API is public in OSTree >= 2018.6
OSTREE_FEATURES="$OSTREE_FEATURES p2p"
AC_CONFIG_FILES([
Makefile
apidoc/Makefile

View File

@ -58,13 +58,11 @@ Boston, MA 02111-1307, USA.
<refsect1>
<title>Description</title>
<!-- FIXME: Reword this when no longer in experimental -->
<para>
OSTree has the ability do pulls not just from configured remote
servers but also from peer computers on the LAN and from mounted
filesystems such as USB drives. Currently this requires compiling
OSTree with experimental API enabled, and it requires the use of
collection IDs and GPG verification.
filesystems such as USB drives. This functionality requires the use
of collection IDs and GPG verification.
</para>
<para>
The <command>find-remotes</command> command searches for remotes

View File

@ -84,12 +84,10 @@ Boston, MA 02111-1307, USA.
fields to the summary.
</para>
<!-- FIXME: Uncomment this when collection ID support becomes non-experimental.
<para>If the repository has a collection ID configured, the
<filename>ostree-metadata</filename> branch for that collection ID
will also be updated with a new commit containing the given metadata,
which will be signed if the summary file is signed.</para>
-->
</listitem>
</varlistentry>

View File

@ -283,14 +283,13 @@ Boston, MA 02111-1307, USA.
</para></listitem>
</varlistentry>
<!-- FIXME: Uncomment this when it's no longer experimental
<varlistentry>
<term><citerefentry><refentrytitle>ostree-create-usb</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
<listitem><para>
&nbsp;Put the given refs on an external drive for P2P distribution.
</para></listitem>
</varlistentry>-->
</varlistentry>
<varlistentry>
<term><citerefentry><refentrytitle>ostree-diff</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
@ -301,14 +300,13 @@ Boston, MA 02111-1307, USA.
</para></listitem>
</varlistentry>
<!-- FIXME: Uncomment this when it's no longer experimental
<varlistentry>
<term><citerefentry><refentrytitle>ostree-find-remotes</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
<listitem><para>
&nbsp;Find remotes to serve the given refs.
</para></listitem>
</varlistentry>-->
</varlistentry>
<varlistentry>
<term><citerefentry><refentrytitle>ostree-fsck</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

View File

@ -19,8 +19,57 @@
/* Add new symbols here. Release commits should copy this section into -released.sym. */
LIBOSTREE_2018.6 {
global:
ostree_collection_ref_dup;
ostree_collection_ref_dupv;
ostree_collection_ref_equal;
ostree_collection_ref_free;
ostree_collection_ref_freev;
ostree_collection_ref_get_type;
ostree_collection_ref_hash;
ostree_collection_ref_new;
ostree_remote_get_name;
ostree_remote_get_type;
ostree_remote_get_url;
ostree_remote_ref;
ostree_remote_unref;
ostree_repo_find_remotes_async;
ostree_repo_find_remotes_finish;
ostree_repo_finder_avahi_get_type;
ostree_repo_finder_avahi_new;
ostree_repo_finder_avahi_start;
ostree_repo_finder_avahi_stop;
ostree_repo_finder_config_get_type;
ostree_repo_finder_config_new;
ostree_repo_finder_get_type;
ostree_repo_finder_mount_get_type;
ostree_repo_finder_mount_new;
ostree_repo_finder_override_add_uri;
ostree_repo_finder_override_get_type;
ostree_repo_finder_override_new;
ostree_repo_finder_resolve_all_async;
ostree_repo_finder_resolve_all_finish;
ostree_repo_finder_resolve_async;
ostree_repo_finder_resolve_finish;
ostree_repo_finder_result_compare;
ostree_repo_finder_result_dup;
ostree_repo_finder_result_free;
ostree_repo_finder_result_freev;
ostree_repo_finder_result_get_type;
ostree_repo_finder_result_new;
ostree_repo_get_collection_id;
ostree_repo_list_collection_refs;
ostree_repo_pull_from_remotes_async;
ostree_repo_pull_from_remotes_finish;
ostree_repo_remote_list_collection_refs;
ostree_repo_resolve_collection_ref;
ostree_repo_resolve_keyring_for_collection;
ostree_repo_set_collection_id;
ostree_repo_set_collection_ref_immediate;
ostree_repo_transaction_set_collection_ref;
ostree_repo_traverse_reachable_refs;
ostree_sysroot_cleanup_prune_repo;
ostree_validate_collection_id;
} LIBOSTREE_2018.5;
/* Stub section for the stable release *after* this development one; don't

View File

@ -1,97 +0,0 @@
/*
* Copyright © 2017 Endless Mobile, Inc.
*
* This library 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 License, 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.
*
* Authors:
* - Philip Withnall <withnall@endlessm.com>
*/
/* Symbols in this file are added to the build if OSTree is configured with
* --enable-experimental-api. They are not stable or officially supported, and
* might disappear or change in future releases. */
LIBOSTREE_2017.6_EXPERIMENTAL {
global:
ostree_remote_ref;
ostree_remote_unref;
} LIBOSTREE_2017.6;
LIBOSTREE_2017.7_EXPERIMENTAL {
global:
ostree_remote_get_name;
} LIBOSTREE_2017.6_EXPERIMENTAL;
LIBOSTREE_2017.8_EXPERIMENTAL {
global:
ostree_collection_ref_dup;
ostree_collection_ref_dupv;
ostree_collection_ref_equal;
ostree_collection_ref_free;
ostree_collection_ref_freev;
ostree_collection_ref_get_type;
ostree_collection_ref_hash;
ostree_collection_ref_new;
ostree_repo_find_remotes_async;
ostree_repo_find_remotes_finish;
ostree_repo_finder_avahi_get_type;
ostree_repo_finder_avahi_new;
ostree_repo_finder_avahi_start;
ostree_repo_finder_avahi_stop;
ostree_repo_finder_config_get_type;
ostree_repo_finder_config_new;
ostree_repo_finder_get_type;
ostree_repo_finder_mount_get_type;
ostree_repo_finder_mount_new;
ostree_repo_finder_resolve_async;
ostree_repo_finder_resolve_all_async;
ostree_repo_finder_resolve_all_finish;
ostree_repo_finder_resolve_finish;
ostree_repo_finder_result_compare;
ostree_repo_finder_result_dup;
ostree_repo_finder_result_free;
ostree_repo_finder_result_freev;
ostree_repo_finder_result_get_type;
ostree_repo_finder_result_new;
ostree_repo_get_collection_id;
ostree_repo_list_collection_refs;
ostree_repo_pull_from_remotes_async;
ostree_repo_pull_from_remotes_finish;
ostree_repo_remote_list_collection_refs;
ostree_repo_resolve_keyring_for_collection;
ostree_repo_set_collection_id;
ostree_repo_set_collection_ref_immediate;
ostree_repo_transaction_set_collection_ref;
ostree_validate_collection_id;
} LIBOSTREE_2017.7_EXPERIMENTAL;
LIBOSTREE_2017.12_EXPERIMENTAL {
global:
ostree_repo_resolve_collection_ref;
} LIBOSTREE_2017.8_EXPERIMENTAL;
LIBOSTREE_2017.13_EXPERIMENTAL {
global:
ostree_repo_finder_override_add_uri;
ostree_repo_finder_override_get_type;
ostree_repo_finder_override_new;
} LIBOSTREE_2017.12_EXPERIMENTAL;
LIBOSTREE_2017.14_EXPERIMENTAL {
global:
ostree_remote_get_type;
ostree_remote_get_url;
} LIBOSTREE_2017.13_EXPERIMENTAL;

View File

@ -61,7 +61,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeSysrootUpgrader, g_object_unref)
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (OstreeRepoCommitTraverseIter, ostree_repo_commit_traverse_iter_clear)
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeCollectionRef, ostree_collection_ref_free)
G_DEFINE_AUTO_CLEANUP_FREE_FUNC (OstreeCollectionRefv, ostree_collection_ref_freev, NULL)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRemote, ostree_remote_unref)
@ -72,7 +71,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderMount, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderOverride, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderResult, ostree_repo_finder_result_free)
G_DEFINE_AUTO_CLEANUP_FREE_FUNC (OstreeRepoFinderResultv, ostree_repo_finder_result_freev, NULL)
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
#endif

View File

@ -207,10 +207,6 @@ _ostree_raw_file_to_archive_stream (GInputStream *input,
GCancellable *cancellable,
GError **error);
#ifndef OSTREE_ENABLE_EXPERIMENTAL_API
gboolean ostree_validate_collection_id (const char *collection_id, GError **error);
#endif /* !OSTREE_ENABLE_EXPERIMENTAL_API */
gboolean
_ostree_compare_timestamps (const char *current_rev,
guint64 current_ts,
@ -218,28 +214,4 @@ _ostree_compare_timestamps (const char *current_rev,
guint64 new_ts,
GError **error);
#if (defined(OSTREE_COMPILATION) || GLIB_CHECK_VERSION(2, 44, 0)) && !defined(OSTREE_ENABLE_EXPERIMENTAL_API)
#include <libglnx.h>
#include "ostree-ref.h"
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeCollectionRef, ostree_collection_ref_free)
G_DEFINE_AUTO_CLEANUP_FREE_FUNC (OstreeCollectionRefv, ostree_collection_ref_freev, NULL)
#include "ostree-repo-finder.h"
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinder, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderResult, ostree_repo_finder_result_free)
G_DEFINE_AUTO_CLEANUP_FREE_FUNC (OstreeRepoFinderResultv, ostree_repo_finder_result_freev, NULL)
#include "ostree-repo-finder-avahi.h"
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderAvahi, g_object_unref)
#include "ostree-repo-finder-config.h"
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderConfig, g_object_unref)
#include "ostree-repo-finder-mount.h"
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderMount, g_object_unref)
#include "ostree-repo-finder-override.h"
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderOverride, g_object_unref)
#endif
G_END_DECLS

View File

@ -302,6 +302,7 @@ ostree_validate_remote_name (const char *remote_name,
*
* Returns: %TRUE if @collection_id is a valid collection ID, %FALSE if it is invalid
* or %NULL
* Since: 2018.6
*/
gboolean
ostree_validate_collection_id (const char *collection_id, GError **error)

View File

@ -271,11 +271,9 @@ typedef enum {
* This is most useful in concert with `OSTREE_COMMIT_META_KEY_REF_BINDING`,
* as it more strongly binds the commit to the repository and branch.
*
* Since: 2017.9
* Since: 2018.6
*/
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
#define OSTREE_COMMIT_META_KEY_COLLECTION_BINDING "ostree.collection-binding"
#endif
_OSTREE_PUBLIC
const GVariantType *ostree_metadata_variant_type (OstreeObjectType objtype);
@ -324,10 +322,8 @@ int ostree_cmp_checksum_bytes (const guchar *a, const guchar *b);
_OSTREE_PUBLIC
gboolean ostree_validate_rev (const char *rev, GError **error);
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
_OSTREE_PUBLIC
gboolean ostree_validate_collection_id (const char *collection_id, GError **error);
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
_OSTREE_PUBLIC
gboolean ostree_validate_remote_name (const char *remote_name, GError **error);

View File

@ -47,7 +47,7 @@ G_DEFINE_BOXED_TYPE (OstreeCollectionRef, ostree_collection_ref,
* operations.
*
* Returns: (transfer full): a new #OstreeCollectionRef
* Since: 2017.8
* Since: 2018.6
*/
OstreeCollectionRef *
ostree_collection_ref_new (const gchar *collection_id,
@ -73,7 +73,7 @@ ostree_collection_ref_new (const gchar *collection_id,
* Create a copy of the given @ref.
*
* Returns: (transfer full): a newly allocated copy of @ref
* Since: 2017.8
* Since: 2018.6
*/
OstreeCollectionRef *
ostree_collection_ref_dup (const OstreeCollectionRef *ref)
@ -89,7 +89,7 @@ ostree_collection_ref_dup (const OstreeCollectionRef *ref)
*
* Free the given @ref.
*
* Since: 2017.8
* Since: 2018.6
*/
void
ostree_collection_ref_free (OstreeCollectionRef *ref)
@ -109,7 +109,7 @@ ostree_collection_ref_free (OstreeCollectionRef *ref)
* @ref must be non-%NULL.
*
* Returns: hash value for @ref
* Since: 2017.8
* Since: 2018.6
*/
guint
ostree_collection_ref_hash (gconstpointer ref)
@ -131,7 +131,7 @@ ostree_collection_ref_hash (gconstpointer ref)
* ref name, and %FALSE otherwise. Both @ref1 and @ref2 must be non-%NULL.
*
* Returns: %TRUE if @ref1 and @ref2 are equal, %FALSE otherwise
* Since: 2017.8
* Since: 2018.6
*/
gboolean
ostree_collection_ref_equal (gconstpointer ref1,
@ -152,7 +152,7 @@ ostree_collection_ref_equal (gconstpointer ref1,
* %NULL.
*
* Returns: (transfer full) (array zero-terminated=1): a newly allocated copy of @refs
* Since: 2017.8
* Since: 2018.6
*/
OstreeCollectionRef **
ostree_collection_ref_dupv (const OstreeCollectionRef * const *refs)
@ -178,7 +178,7 @@ ostree_collection_ref_dupv (const OstreeCollectionRef * const *refs)
* Free the given array of @refs, including freeing all its elements. @refs
* must be %NULL-terminated; it may be empty, but must not be %NULL.
*
* Since: 2017.8
* Since: 2018.6
*/
void
ostree_collection_ref_freev (OstreeCollectionRef **refs)

View File

@ -42,7 +42,7 @@ G_BEGIN_DECLS
* (@collection_id, @ref_name). For backwards compatibility, @collection_id may be %NULL,
* indicating a ref name which is not globally unique.
*
* Since: 2017.8
* Since: 2018.6
*/
typedef struct
{
@ -82,7 +82,7 @@ void ostree_collection_ref_freev (OstreeCollectionRef **refs);
* g_auto(OstreeCollectionRefv) refs = NULL;
* ]|
*
* Since: 2017.8
* Since: 2018.6
*/
typedef OstreeCollectionRef** OstreeCollectionRefv;

View File

@ -60,8 +60,4 @@ G_GNUC_INTERNAL
OstreeRemote *ostree_remote_new_from_keyfile (GKeyFile *keyfile,
const gchar *group);
#if (defined(OSTREE_COMPILATION) || GLIB_CHECK_VERSION(2, 44, 0)) && !defined(OSTREE_ENABLE_EXPERIMENTAL_API)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRemote, ostree_remote_unref)
#endif
G_END_DECLS

View File

@ -50,7 +50,7 @@
* refs are currently on a remote, or the commits they currently point to. Use
* #OstreeRepo in combination with an #OstreeRemote to query that information.
*
* Since: 2017.6
* Since: 2018.6
*/
OstreeRemote *
@ -119,7 +119,7 @@ ostree_remote_new_from_keyfile (GKeyFile *keyfile,
* Increase the reference count on the given @remote.
*
* Returns: (transfer full): a copy of @remote, for convenience
* Since: 2017.6
* Since: 2018.6
*/
OstreeRemote *
ostree_remote_ref (OstreeRemote *remote)
@ -138,7 +138,7 @@ ostree_remote_ref (OstreeRemote *remote)
* Decrease the reference count on the given @remote and free it if the
* reference count reaches 0.
*
* Since: 2017.6
* Since: 2018.6
*/
void
ostree_remote_unref (OstreeRemote *remote)
@ -158,11 +158,9 @@ ostree_remote_unref (OstreeRemote *remote)
}
}
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
G_DEFINE_BOXED_TYPE(OstreeRemote, ostree_remote,
ostree_remote_ref,
ostree_remote_unref);
#endif
/**
* ostree_remote_get_name:
@ -173,7 +171,7 @@ G_DEFINE_BOXED_TYPE(OstreeRemote, ostree_remote,
* arbitrary, string.
*
* Returns: remotes name
* Since: 2017.7
* Since: 2018.6
*/
const gchar *
ostree_remote_get_name (OstreeRemote *remote)
@ -191,7 +189,7 @@ ostree_remote_get_name (OstreeRemote *remote)
* Get the URL from the remote.
*
* Returns: (transfer full): the remote's URL
* Since: 2017.14
* Since: 2018.6
*/
gchar *
ostree_remote_get_url (OstreeRemote *remote)

View File

@ -42,12 +42,8 @@ G_BEGIN_DECLS
* remotes can only be passed around as (reference counted) opaque handles. In
* future, more API may be added to create and interrogate them.
*
* Since: 2017.6
* Since: 2018.6
*/
#ifndef OSTREE_ENABLE_EXPERIMENTAL_API
/* This is in ostree-types.h otherwise */
typedef struct OstreeRemote OstreeRemote;
#endif
_OSTREE_PUBLIC
GType ostree_remote_get_type (void) G_GNUC_CONST;

View File

@ -1961,7 +1961,7 @@ ostree_repo_transaction_set_ref (OstreeRepo *self,
*
* Multithreading: Since v2017.15 this function is MT safe.
*
* Since: 2017.8
* Since: 2018.6
*/
void
ostree_repo_transaction_set_collection_ref (OstreeRepo *self,
@ -2045,7 +2045,7 @@ ostree_repo_set_alias_ref_immediate (OstreeRepo *self,
* case where we're creating or overwriting an existing ref.
*
* Returns: %TRUE on success, %FALSE otherwise
* Since: 2017.8
* Since: 2018.6
*/
gboolean
ostree_repo_set_collection_ref_immediate (OstreeRepo *self,

View File

@ -98,7 +98,7 @@
* and the resolver is used to retrieve information about services advertised by
* each peer, including the services TXT records.
*
* Since: 2017.8
* Since: 2018.6
*/
#ifdef HAVE_AVAHI
@ -1363,7 +1363,7 @@ ostree_repo_finder_avahi_init (OstreeRepoFinderAvahi *self)
* If @context is %NULL, the current thread-default #GMainContext is used.
*
* Returns: (transfer full): a new #OstreeRepoFinderAvahi
* Since: 2017.8
* Since: 2018.6
*/
OstreeRepoFinderAvahi *
ostree_repo_finder_avahi_new (GMainContext *context)
@ -1412,7 +1412,7 @@ ostree_repo_finder_avahi_new (GMainContext *context)
* #OstreeRepoFinderAvahi instance, or to call it after
* ostree_repo_finder_avahi_stop().
*
* Since: 2017.8
* Since: 2018.6
*/
void
ostree_repo_finder_avahi_start (OstreeRepoFinderAvahi *self,
@ -1494,7 +1494,7 @@ static gboolean stop_cb (gpointer user_data);
* #OstreeRepoFinderAvahi instance, or to call it before
* ostree_repo_finder_avahi_start().
*
* Since: 2017.8
* Since: 2018.6
*/
void
ostree_repo_finder_avahi_stop (OstreeRepoFinderAvahi *self)

View File

@ -55,7 +55,7 @@
* intersection is non-empty, that remote is returned as a result. Remotes which
* do not have their `collection-id` key configured are ignored.
*
* Since: 2017.8
* Since: 2018.6
*/
static void ostree_repo_finder_config_iface_init (OstreeRepoFinderInterface *iface);
@ -233,7 +233,7 @@ ostree_repo_finder_config_iface_init (OstreeRepoFinderInterface *iface)
* Create a new #OstreeRepoFinderConfig.
*
* Returns: (transfer full): a new #OstreeRepoFinderConfig
* Since: 2017.8
* Since: 2018.6
*/
OstreeRepoFinderConfig *
ostree_repo_finder_config_new (void)

View File

@ -67,7 +67,7 @@
* The volume monitor used to find mounted volumes can be overridden by setting
* #OstreeRepoFinderMount:monitor. By default, g_volume_monitor_get() is used.
*
* Since: 2017.8
* Since: 2018.6
*/
typedef GList/*<owned GObject>*/ ObjectList;
@ -648,7 +648,7 @@ ostree_repo_finder_mount_class_init (OstreeRepoFinderMountClass *klass)
*
* Volume monitor to use to look up mounted volumes when queried.
*
* Since: 2017.8
* Since: 2018.6
*/
g_object_class_install_property (object_class, PROP_MONITOR,
g_param_spec_object ("monitor",
@ -679,7 +679,7 @@ ostree_repo_finder_mount_iface_init (OstreeRepoFinderInterface *iface)
* be used.
*
* Returns: (transfer full): a new #OstreeRepoFinderMount
* Since: 2017.8
* Since: 2018.6
*/
OstreeRepoFinderMount *
ostree_repo_finder_mount_new (GVolumeMonitor *monitor)

View File

@ -60,7 +60,7 @@
* which uses #OstreeRepoFinder. For production use, #OstreeRepoFinderConfig is
* recommended instead.
*
* Since: 2017.13
* Since: 2018.6
*/
static void ostree_repo_finder_override_iface_init (OstreeRepoFinderInterface *iface);
@ -295,7 +295,7 @@ ostree_repo_finder_override_iface_init (OstreeRepoFinderInterface *iface)
* Create a new #OstreeRepoFinderOverride.
*
* Returns: (transfer full): a new #OstreeRepoFinderOverride
* Since: 2017.13
* Since: 2018.6
*/
OstreeRepoFinderOverride *
ostree_repo_finder_override_new (void)
@ -310,7 +310,7 @@ ostree_repo_finder_override_new (void)
* Add the given @uri to the set of URIs which the repo finder will search for
* matching refs when ostree_repo_finder_resolve_async() is called on it.
*
* Since: 2017.13
* Since: 2018.6
*/
void
ostree_repo_finder_override_add_uri (OstreeRepoFinderOverride *self,

View File

@ -138,7 +138,7 @@ static void resolve_cb (GObject *obj,
* Pass the results to ostree_repo_pull_from_remotes_async() to pull the given
* @refs from those remotes.
*
* Since: 2017.8
* Since: 2018.6
*/
void
ostree_repo_finder_resolve_async (OstreeRepoFinder *self,
@ -196,7 +196,7 @@ resolve_cb (GObject *obj,
*
* Returns: (transfer full) (element-type OstreeRepoFinderResult): array of zero
* or more results
* Since: 2017.8
* Since: 2018.6
*/
GPtrArray *
ostree_repo_finder_resolve_finish (OstreeRepoFinder *self,
@ -254,7 +254,7 @@ static void resolve_all_finished_one (GTask *task);
* A version of ostree_repo_finder_resolve_async() which queries one or more
* @finders in parallel and combines the results.
*
* Since: 2017.8
* Since: 2018.6
*/
void
ostree_repo_finder_resolve_all_async (OstreeRepoFinder * const *finders,
@ -411,7 +411,7 @@ resolve_all_finished_one (GTask *task)
*
* Returns: (transfer full) (element-type OstreeRepoFinderResult): array of zero
* or more results
* Since: 2017.8
* Since: 2018.6
*/
GPtrArray *
ostree_repo_finder_resolve_all_finish (GAsyncResult *result,
@ -446,7 +446,7 @@ G_DEFINE_BOXED_TYPE (OstreeRepoFinderResult, ostree_repo_finder_result,
* are as described in the #OstreeRepoFinderResult documentation.
*
* Returns: (transfer full): a new #OstreeRepoFinderResult
* Since: 2017.8
* Since: 2018.6
*/
OstreeRepoFinderResult *
ostree_repo_finder_result_new (OstreeRemote *remote,
@ -480,7 +480,7 @@ ostree_repo_finder_result_new (OstreeRemote *remote,
* Copy an #OstreeRepoFinderResult.
*
* Returns: (transfer full): a newly allocated copy of @result
* Since: 2017.8
* Since: 2018.6
*/
OstreeRepoFinderResult *
ostree_repo_finder_result_dup (OstreeRepoFinderResult *result)
@ -502,7 +502,7 @@ ostree_repo_finder_result_dup (OstreeRepoFinderResult *result)
*
* Returns: <0 if @a is ordered before @b, 0 if they are ordered equally,
* >0 if @b is ordered before @a
* Since: 2017.8
* Since: 2018.6
*/
gint
ostree_repo_finder_result_compare (const OstreeRepoFinderResult *a,
@ -549,7 +549,7 @@ ostree_repo_finder_result_compare (const OstreeRepoFinderResult *a,
*
* Free the given @result.
*
* Since: 2017.8
* Since: 2018.6
*/
void
ostree_repo_finder_result_free (OstreeRepoFinderResult *result)
@ -571,7 +571,7 @@ ostree_repo_finder_result_free (OstreeRepoFinderResult *result)
*
* Free the given @results array, freeing each element and the container.
*
* Since: 2017.8
* Since: 2018.6
*/
void
ostree_repo_finder_result_freev (OstreeRepoFinderResult **results)

View File

@ -133,7 +133,7 @@ GPtrArray *ostree_repo_finder_resolve_all_finish (GAsyncResult *result,
* ostree_repo_find_remotes_async (2) there was an error in trying to get the
* commit metadata (3) the checksum for this ref is %NULL in @ref_to_checksum.
*
* Since: 2017.8
* Since: 2018.6
*/
typedef struct
{
@ -176,7 +176,7 @@ void ostree_repo_finder_result_free (OstreeRepoFinderResult *result);
* g_auto(OstreeRepoFinderResultv) results = NULL;
* ]|
*
* Since: 2017.8
* Since: 2018.6
*/
typedef OstreeRepoFinderResult** OstreeRepoFinderResultv;

View File

@ -460,33 +460,4 @@ OstreeRepoAutoLock * _ostree_repo_auto_lock_push (OstreeRepo *self,
void _ostree_repo_auto_lock_cleanup (OstreeRepoAutoLock *lock);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoAutoLock, _ostree_repo_auto_lock_cleanup)
#ifndef OSTREE_ENABLE_EXPERIMENTAL_API
/* These APIs are duplicated in the public headers when doing an
* experimental-API build.
*/
const gchar * ostree_repo_get_collection_id (OstreeRepo *self);
gboolean ostree_repo_set_collection_id (OstreeRepo *self,
const gchar *collection_id,
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);
void ostree_repo_transaction_set_collection_ref (OstreeRepo *self,
const OstreeCollectionRef *ref,
const char *checksum);
gboolean ostree_repo_set_collection_ref_immediate (OstreeRepo *self,
const OstreeCollectionRef *ref,
const char *checksum,
GCancellable *cancellable,
GError **error);
#endif /* !OSTREE_ENABLE_EXPERIMENTAL_API */
G_END_DECLS

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 */

View File

@ -470,7 +470,6 @@ ostree_repo_resolve_rev_ext (OstreeRepo *self,
return _ostree_repo_resolve_rev_internal (self, refspec, allow_noent, FALSE, out_rev, error);
}
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
/**
* ostree_repo_resolve_collection_ref:
* @self: an #OstreeRepo
@ -494,7 +493,7 @@ ostree_repo_resolve_rev_ext (OstreeRepo *self,
* There are currently no @flags which affect the behaviour of this function.
*
* Returns: %TRUE on success, %FALSE on failure
* Since: 2017.12
* Since: 2018.6
*/
gboolean
ostree_repo_resolve_collection_ref (OstreeRepo *self,
@ -531,7 +530,6 @@ ostree_repo_resolve_collection_ref (OstreeRepo *self,
*out_rev = g_strdup (ret_contents);
return TRUE;
}
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
static gboolean
enumerate_refs_recurse (OstreeRepo *repo,
@ -876,7 +874,6 @@ ostree_repo_remote_list_refs (OstreeRepo *self,
return TRUE;
}
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
static gboolean
remote_list_collection_refs_process_refs (OstreeRepo *self,
const gchar *remote_name,
@ -934,7 +931,7 @@ remote_list_collection_refs_process_refs (OstreeRepo *self,
* Any refs for other collections stored in the repository will also be returned.
* No filtering is performed.
*
* Since: 2017.10
* Since: 2018.6
*/
gboolean
ostree_repo_remote_list_collection_refs (OstreeRepo *self,
@ -995,7 +992,6 @@ ostree_repo_remote_list_collection_refs (OstreeRepo *self,
ot_transfer_out_value (out_all_refs, &ret_all_refs);
return TRUE;
}
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
static char *
relative_symlink_to (const char *relpath,
@ -1206,7 +1202,7 @@ _ostree_repo_update_collection_refs (OstreeRepo *self,
* %OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES in @flags.
*
* Returns: %TRUE on success, %FALSE otherwise
* Since: 2017.8
* Since: 2018.6
*/
gboolean
ostree_repo_list_collection_refs (OstreeRepo *self,

View File

@ -5702,7 +5702,7 @@ _ostree_repo_memory_cache_ref_destroy (OstreeRepoMemoryCacheRef *state)
* Get the collection ID of this repository. See [collection IDs][collection-ids].
*
* Returns: (nullable): collection ID for the repository
* Since: 2017.8
* Since: 2018.6
*/
const gchar *
ostree_repo_get_collection_id (OstreeRepo *self)
@ -5723,7 +5723,7 @@ ostree_repo_get_collection_id (OstreeRepo *self)
* configuration on disk using ostree_repo_write_config().
*
* Returns: %TRUE on success, %FALSE otherwise
* Since: 2017.8
* Since: 2018.6
*/
gboolean
ostree_repo_set_collection_id (OstreeRepo *self,

View File

@ -28,10 +28,8 @@
#include "ostree-core.h"
#include "ostree-types.h"
#include "ostree-async-progress.h"
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
#include "ostree-ref.h"
#include "ostree-repo-finder.h"
#endif
#include "ostree-sepolicy.h"
#include "ostree-gpg-verify-result.h"
@ -107,8 +105,6 @@ OstreeRepo * ostree_repo_create_at (int dfd,
GCancellable *cancellable,
GError **error);
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
_OSTREE_PUBLIC
const gchar * ostree_repo_get_collection_id (OstreeRepo *self);
_OSTREE_PUBLIC
@ -116,8 +112,6 @@ gboolean ostree_repo_set_collection_id (OstreeRepo *self,
const gchar *collection_id,
GError **error);
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
_OSTREE_PUBLIC
GFile * ostree_repo_get_path (OstreeRepo *self);
@ -339,15 +333,11 @@ void ostree_repo_transaction_set_ref (OstreeRepo *self,
const char *ref,
const char *checksum);
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
_OSTREE_PUBLIC
void ostree_repo_transaction_set_collection_ref (OstreeRepo *self,
const OstreeCollectionRef *ref,
const char *checksum);
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
_OSTREE_PUBLIC
gboolean ostree_repo_set_ref_immediate (OstreeRepo *self,
const char *remote,
@ -364,8 +354,6 @@ gboolean ostree_repo_set_alias_ref_immediate (OstreeRepo *self,
GCancellable *cancellable,
GError **error);
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
_OSTREE_PUBLIC
gboolean ostree_repo_set_collection_ref_immediate (OstreeRepo *self,
const OstreeCollectionRef *ref,
@ -373,8 +361,6 @@ gboolean ostree_repo_set_collection_ref_immediate (OstreeRepo
GCancellable *cancellable,
GError **error);
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
_OSTREE_PUBLIC
gboolean ostree_repo_has_object (OstreeRepo *self,
OstreeObjectType objtype,
@ -479,7 +465,6 @@ gboolean ostree_repo_resolve_rev_ext (OstreeRepo *self,
char **out_rev,
GError **error);
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
_OSTREE_PUBLIC
gboolean ostree_repo_resolve_collection_ref (OstreeRepo *self,
const OstreeCollectionRef *ref,
@ -488,7 +473,6 @@ gboolean ostree_repo_resolve_collection_ref (OstreeRepo
char **out_rev,
GCancellable *cancellable,
GError **error);
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
_OSTREE_PUBLIC
gboolean ostree_repo_list_refs (OstreeRepo *self,
@ -524,14 +508,12 @@ gboolean ostree_repo_remote_list_refs (OstreeRepo *self,
GCancellable *cancellable,
GError **error);
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
_OSTREE_PUBLIC
gboolean ostree_repo_remote_list_collection_refs (OstreeRepo *self,
const char *remote_name,
GHashTable **out_all_refs,
GCancellable *cancellable,
GError **error);
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
_OSTREE_PUBLIC
gboolean ostree_repo_load_variant (OstreeRepo *self,
@ -1265,8 +1247,6 @@ gboolean ostree_repo_pull_with_options (OstreeRepo *self,
GCancellable *cancellable,
GError **error);
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
_OSTREE_PUBLIC
void ostree_repo_find_remotes_async (OstreeRepo *self,
const OstreeCollectionRef * const *refs,
@ -1308,8 +1288,6 @@ gboolean ostree_repo_list_collection_refs (OstreeRepo *self,
GCancellable *cancellable,
GError **error);
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
_OSTREE_PUBLIC
void ostree_repo_pull_default_console_progress_changed (OstreeAsyncProgress *progress,
gpointer user_data);
@ -1394,8 +1372,6 @@ gboolean ostree_repo_regenerate_summary (OstreeRepo *self,
GCancellable *cancellable,
GError **error);
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
/**
* OSTREE_REPO_METADATA_REF:
*
@ -1415,12 +1391,10 @@ gboolean ostree_repo_regenerate_summary (OstreeRepo *self,
* keys must be namespaced by product or developer. For example,
* `exampleos.end-of-life`. The `ostree.` prefix is reserved.
*
* Since: 2017.8
* Since: 2018.6
*/
#define OSTREE_REPO_METADATA_REF "ostree-metadata"
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
G_END_DECLS

View File

@ -38,9 +38,6 @@ typedef struct OstreeSysroot OstreeSysroot;
typedef struct OstreeSysrootUpgrader OstreeSysrootUpgrader;
typedef struct OstreeMutableTree OstreeMutableTree;
typedef struct OstreeRepoFile OstreeRepoFile;
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
typedef struct OstreeRemote OstreeRemote;
#endif
G_END_DECLS

View File

@ -25,9 +25,7 @@
#include <ostree-core.h>
#include <ostree-repo.h>
#include <ostree-mutable-tree.h>
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
#include <ostree-remote.h>
#endif
#include <ostree-repo-file.h>
#include <ostree-sysroot.h>
#include <ostree-sysroot-upgrader.h>
@ -35,15 +33,11 @@
#include <ostree-bootconfig-parser.h>
#include <ostree-diff.h>
#include <ostree-gpg-verify-result.h>
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
#include <ostree-ref.h>
#include <ostree-repo-finder.h>
#include <ostree-repo-finder-avahi.h>
#include <ostree-repo-finder-config.h>
#include <ostree-repo-finder-mount.h>
#include <ostree-repo-finder-override.h>
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
#include <ostree-autocleanups.h>
#include <ostree-version.h>

View File

@ -63,14 +63,12 @@ static OstreeCommand commands[] = {
{ "export", OSTREE_BUILTIN_FLAG_NONE,
ostree_builtin_export,
"Stream COMMIT to stdout in tar format" },
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
{ "find-remotes", OSTREE_BUILTIN_FLAG_NONE,
ostree_builtin_find_remotes,
"Find remotes to serve the given refs" },
{ "create-usb", OSTREE_BUILTIN_FLAG_NONE,
ostree_builtin_create_usb,
"Copy the refs to a USB stick" },
#endif
{ "fsck", OSTREE_BUILTIN_FLAG_NONE,
ostree_builtin_fsck,
"Check the repository for consistency" },

View File

@ -331,7 +331,6 @@ parse_keyvalue_strings (GVariantBuilder *builder,
return TRUE;
}
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
static void
add_collection_binding (OstreeRepo *repo,
GVariantBuilder *metadata_builder)
@ -344,7 +343,6 @@ add_collection_binding (OstreeRepo *repo,
g_variant_builder_add (metadata_builder, "{s@v}", OSTREE_COMMIT_META_KEY_COLLECTION_BINDING,
g_variant_new_variant (g_variant_new_string (collection_id)));
}
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
static int
compare_strings (gconstpointer a, gconstpointer b)
@ -383,13 +381,11 @@ fill_bindings (OstreeRepo *repo,
add_ref_binding (metadata_builder);
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
/* Allow the collection ID to be overridden using
* --add-metadata-string=ostree.collection-binding=blah */
if (metadata == NULL ||
!g_variant_lookup (metadata, OSTREE_COMMIT_META_KEY_COLLECTION_BINDING, "*", NULL))
add_collection_binding (repo, metadata_builder);
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
*out_metadata = g_variant_ref_sink (g_variant_builder_end (metadata_builder));
}

View File

@ -264,7 +264,6 @@ ostree_builtin_fsck (int argc, char **argv, OstreeCommandInvocation *invocation,
return FALSE;
}
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (!opt_quiet)
g_print ("Validating refs in collections...\n");
@ -282,7 +281,6 @@ ostree_builtin_fsck (int argc, char **argv, OstreeCommandInvocation *invocation,
&found_corruption, cancellable, error))
return FALSE;
}
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
if (!opt_quiet)
g_print ("Enumerating objects...\n");
@ -327,13 +325,11 @@ ostree_builtin_fsck (int argc, char **argv, OstreeCommandInvocation *invocation,
g_autoptr(GVariant) metadata = g_variant_get_child_value (commit, 0);
const char *collection_id = NULL;
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (!g_variant_lookup (metadata,
OSTREE_COMMIT_META_KEY_COLLECTION_BINDING,
"&s",
&collection_id))
collection_id = NULL;
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
g_autofree const char **refs = NULL;
if (g_variant_lookup (metadata,
@ -345,7 +341,6 @@ ostree_builtin_fsck (int argc, char **argv, OstreeCommandInvocation *invocation,
{
g_autofree char *checksum_for_ref = NULL;
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (collection_id != NULL)
{
const OstreeCollectionRef collection_ref = { (char *) collection_id, (char *) *iter };
@ -358,7 +353,6 @@ ostree_builtin_fsck (int argc, char **argv, OstreeCommandInvocation *invocation,
return FALSE;
}
else
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
{
if (!ostree_repo_resolve_rev (repo, *iter, TRUE,
&checksum_for_ref, error))

View File

@ -28,9 +28,7 @@
#include "ostree.h"
static char *opt_mode = "bare";
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
static char *opt_collection_id = NULL;
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
/* ATTENTION:
* Please remember to update the bash-completion script (bash/ostree) and
@ -39,10 +37,8 @@ static char *opt_collection_id = NULL;
static GOptionEntry options[] = {
{ "mode", 0, 0, G_OPTION_ARG_STRING, &opt_mode, "Initialize repository in given mode (bare, bare-user, bare-user-only, archive)", NULL },
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
{ "collection-id", 0, 0, G_OPTION_ARG_STRING, &opt_collection_id,
"Globally unique ID for this repository as an collection of refs for redistribution to other repositories", "COLLECTION-ID" },
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
{ NULL }
};
@ -61,10 +57,8 @@ ostree_builtin_init (int argc, char **argv,OstreeCommandInvocation *invocation,
if (!ostree_repo_mode_from_string (opt_mode, &mode, error))
goto out;
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (!ostree_repo_set_collection_id (repo, opt_collection_id, error))
goto out;
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
if (!ostree_repo_create (repo, mode, NULL, error))
goto out;

View File

@ -59,9 +59,7 @@ static gboolean
delete_commit (OstreeRepo *repo, const char *commit_to_delete, GCancellable *cancellable, GError **error)
{
g_autoptr(GHashTable) refs = NULL; /* (element-type utf8 utf8) */
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
g_autoptr(GHashTable) collection_refs = NULL; /* (element-type OstreeCollectionRef utf8) */
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
/* Check refs which are not in a collection. */
if (!ostree_repo_list_refs (repo, NULL, &refs, cancellable, error))
@ -73,7 +71,6 @@ delete_commit (OstreeRepo *repo, const char *commit_to_delete, GCancellable *can
return glnx_throw (error, "Commit '%s' is referenced by '%s'", commit_to_delete, ref);
}
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
/* And check refs which *are* in a collection. */
if (!ostree_repo_list_collection_refs (repo, NULL, &collection_refs,
OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES,
@ -87,7 +84,6 @@ delete_commit (OstreeRepo *repo, const char *commit_to_delete, GCancellable *can
return glnx_throw (error, "Commit '%s' is referenced by (%s, %s)",
commit_to_delete, ref->collection_id, ref->ref_name);
}
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
if (!ot_enable_tombstone_commits (repo, error))
return FALSE;

View File

@ -31,9 +31,7 @@ static gboolean opt_delete;
static gboolean opt_list;
static gboolean opt_alias;
static char *opt_create;
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
static gboolean opt_collections;
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
/* ATTENTION:
* Please remember to update the bash-completion script (bash/ostree) and
@ -45,13 +43,10 @@ static GOptionEntry options[] = {
{ "list", 0, 0, G_OPTION_ARG_NONE, &opt_list, "Do not remove the prefix from the refs", NULL },
{ "alias", 'A', 0, G_OPTION_ARG_NONE, &opt_alias, "If used with --create, create an alias, otherwise just list aliases", NULL },
{ "create", 0, 0, G_OPTION_ARG_STRING, &opt_create, "Create a new ref for an existing commit", "NEWREF" },
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
{ "collections", 'c', 0, G_OPTION_ARG_NONE, &opt_collections, "Enable listing collection IDs for refs", NULL },
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
{ NULL }
};
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
static gboolean
do_ref_with_collections (OstreeRepo *repo,
const char *refspec_prefix,
@ -136,7 +131,6 @@ do_ref_with_collections (OstreeRepo *repo,
out:
return ret;
}
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
static gboolean do_ref (OstreeRepo *repo, const char *refspec_prefix, GCancellable *cancellable, GError **error)
{
@ -147,10 +141,8 @@ static gboolean do_ref (OstreeRepo *repo, const char *refspec_prefix, GCancellab
gboolean ret = FALSE;
gboolean is_list;
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (opt_collections)
return do_ref_with_collections (repo, refspec_prefix, cancellable, error);
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
/* If we're doing aliasing, we need the full list of aliases mostly to allow
* replacing existing aliases.

View File

@ -108,16 +108,11 @@ ostree_builtin_summary (int argc, char **argv, OstreeCommandInvocation *invocati
return FALSE;
}
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
const char *collection_id = ostree_repo_get_collection_id (repo);
#else /* if !OSTREE_ENABLE_EXPERIMENTAL_API */
const char *collection_id = NULL;
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
/* Write out a new metadata commit for the repository. */
if (collection_id != NULL)
{
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
OstreeCollectionRef collection_ref = { (gchar *) collection_id, (gchar *) OSTREE_REPO_METADATA_REF };
g_autofree char *old_ostree_metadata_checksum = NULL;
g_autofree gchar *new_ostree_metadata_checksum = NULL;
@ -192,10 +187,6 @@ ostree_builtin_summary (int argc, char **argv, OstreeCommandInvocation *invocati
if (!ostree_repo_commit_transaction (repo, NULL, cancellable, error))
return FALSE;
#else /* if !OSTREE_ENABLE_EXPERIMENTAL_API */
g_assert_not_reached ();
return FALSE;
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
}
/* Regenerate and sign the conventional summary file. */

View File

@ -39,10 +39,8 @@ BUILTINPROTO(checksum);
BUILTINPROTO(commit);
BUILTINPROTO(diff);
BUILTINPROTO(export);
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
BUILTINPROTO(find_remotes);
BUILTINPROTO(create_usb);
#endif
BUILTINPROTO(gpg_sign);
BUILTINPROTO(init);
BUILTINPROTO(log);

View File

@ -32,9 +32,7 @@ static gboolean opt_no_gpg_verify;
static gboolean opt_if_not_exists;
static char *opt_gpg_import;
static char *opt_contenturl;
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
static char *opt_collection_id;
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
static char *opt_sysroot;
static char *opt_repo;
@ -49,10 +47,8 @@ static GOptionEntry option_entries[] = {
{ "if-not-exists", 0, 0, G_OPTION_ARG_NONE, &opt_if_not_exists, "Do nothing if the provided remote exists", NULL },
{ "gpg-import", 0, 0, G_OPTION_ARG_FILENAME, &opt_gpg_import, "Import GPG key from FILE", "FILE" },
{ "contenturl", 0, 0, G_OPTION_ARG_STRING, &opt_contenturl, "Use URL when fetching content", "URL" },
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
{ "collection-id", 0, 0, G_OPTION_ARG_STRING, &opt_collection_id,
"Globally unique ID for this repository as an collection of refs for redistribution to other repositories", "COLLECTION-ID" },
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
{ "repo", 0, 0, G_OPTION_ARG_FILENAME, &opt_repo, "Path to OSTree repository (defaults to /sysroot/ostree/repo)", "PATH" },
{ "sysroot", 0, 0, G_OPTION_ARG_FILENAME, &opt_sysroot, "Use sysroot at PATH (overrides --repo)", "PATH" },
{ NULL }
@ -133,11 +129,9 @@ ot_remote_builtin_add (int argc, char **argv, OstreeCommandInvocation *invocatio
"gpg-verify",
g_variant_new_variant (g_variant_new_boolean (FALSE)));
#ifdef OSTREE_ENABLE_EXPERIMENTAL_API
if (opt_collection_id != NULL)
g_variant_builder_add (optbuilder, "{s@v}", "collection-id",
g_variant_new_variant (g_variant_new_take_string (g_steal_pointer (&opt_collection_id))));
#endif /* OSTREE_ENABLE_EXPERIMENTAL_API */
options = g_variant_ref_sink (g_variant_builder_end (optbuilder));