New upstream version 2017.3

This commit is contained in:
Simon McVittie 2017-03-10 23:16:34 +00:00
commit 057de00126
134 changed files with 7528 additions and 2385 deletions

View File

@ -19,7 +19,20 @@
include Makefile-libostree-defines.am
noinst_LTLIBRARIES += libostree-kernel-args.la libbupsplit.la
noinst_LTLIBRARIES += libostree-kernel-args.la
if ENABLE_RUST
bupsplitpath = @abs_top_builddir@/target/@RUST_TARGET_SUBDIR@/libbupsplit_rs.a
BUPSPLIT_RUST_SOURCES = rust/src/bupsplit.rs
EXTRA_DIST += $(BUPSPLIT_RUST_SOURCES)
$(bupsplitpath): Makefile $(BUPSPLIT_RUST_SOURCES)
cd $(top_srcdir)/rust && CARGO_TARGET_DIR=@abs_top_builddir@/target cargo build --verbose $(CARGO_RELEASE_ARGS)
else
bupsplitpath = libbupsplit.la
noinst_LTLIBRARIES += libbupsplit.la
libbupsplit_la_SOURCES = src/libostree/bupsplit.h src/libostree/bupsplit.c
endif # ENABLE_RUST
libostree_kernel_args_la_SOURCES = \
src/libostree/ostree-kernel-args.h \
@ -47,21 +60,16 @@ src/libostree/ostree-enumtypes.c: src/libostree/ostree-enumtypes.c.template $(EN
--fhead "#include \"ostree-enumtypes.h\"" \
$(ENUM_TYPES) > $@.tmp && mv $@.tmp $@
ENUM_GENERATED = \
nodist_libostree_1_la_SOURCES = \
src/libostree/ostree-enumtypes.h \
src/libostree/ostree-enumtypes.c \
$(NULL)
BUILT_SOURCES += $(ENUM_GENERATED)
BUILT_SOURCES += $(nodist_libostree_1_la_SOURCES)
CLEANFILES += $(BUILT_SOURCES)
libbupsplit_la_SOURCES = \
src/libostree/bupsplit.h \
src/libostree/bupsplit.c \
$(NULL)
libostree_1_la_SOURCES = \
$(ENUM_GENERATED) \
src/libostree/ostree-async-progress.c \
src/libostree/ostree-cmdprivate.h \
src/libostree/ostree-cmdprivate.c \
@ -142,7 +150,8 @@ libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/bsdiff -I$(srcdir)/libglnx -I$(
$(OT_INTERNAL_GIO_UNIX_CFLAGS) $(OT_INTERNAL_GPGME_CFLAGS) $(OT_DEP_LZMA_CFLAGS) $(OT_DEP_ZLIB_CFLAGS) \
-fvisibility=hidden '-D_OSTREE_PUBLIC=__attribute__((visibility("default"))) extern'
libostree_1_la_LDFLAGS = -version-number 1:0:0 -Bsymbolic-functions -Wl,--version-script=$(top_srcdir)/src/libostree/libostree.sym
libostree_1_la_LIBADD = libotutil.la libbupsplit.la libglnx.la libbsdiff.la libostree-kernel-args.la $(OT_INTERNAL_GIO_UNIX_LIBS) $(OT_INTERNAL_GPGME_LIBS) $(OT_DEP_LZMA_LIBS) $(OT_DEP_ZLIB_LIBS)
libostree_1_la_LIBADD = libotutil.la libglnx.la libbsdiff.la libostree-kernel-args.la $(OT_INTERNAL_GIO_UNIX_LIBS) $(OT_INTERNAL_GPGME_LIBS) $(OT_DEP_LZMA_LIBS) $(OT_DEP_ZLIB_LIBS)
libostree_1_la_LIBADD += $(bupsplitpath)
EXTRA_libostree_1_la_DEPENDENCIES = $(top_srcdir)/src/libostree/libostree.sym
EXTRA_DIST += src/libostree/libostree.sym
@ -157,18 +166,31 @@ libostree_1_la_CFLAGS += $(LIBSYSTEMD_CFLAGS)
libostree_1_la_LIBADD += $(LIBSYSTEMD_LIBS)
endif
if USE_LIBSOUP
if USE_CURL_OR_SOUP
libostree_1_la_SOURCES += \
src/libostree/ostree-fetcher.h \
src/libostree/ostree-fetcher.c \
src/libostree/ostree-fetcher-util.h \
src/libostree/ostree-fetcher-util.c \
src/libostree/ostree-fetcher-uri.c \
src/libostree/ostree-metalink.h \
src/libostree/ostree-metalink.c \
$(NULL)
endif
if USE_CURL
libostree_1_la_SOURCES += src/libostree/ostree-fetcher-curl.c \
src/libostree/ostree-soup-uri.h src/libostree/ostree-soup-uri.c \
src/libostree/ostree-soup-form.c \
$(NULL)
libostree_1_la_CFLAGS += $(OT_DEP_CURL_CFLAGS)
libostree_1_la_LIBADD += $(OT_DEP_CURL_LIBS)
else
if USE_LIBSOUP
libostree_1_la_SOURCES += src/libostree/ostree-fetcher-soup.c
libostree_1_la_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
libostree_1_la_LIBADD += $(OT_INTERNAL_SOUP_LIBS)
endif
endif
if USE_LIBMOUNT
libostree_1_la_CFLAGS += $(OT_DEP_LIBMOUNT_CFLAGS)
@ -198,7 +220,7 @@ endif
pkgconfig_DATA += src/libostree/ostree-1.pc
gpgreadme_DATA = src/libostree/README-gpg
gpgreadmedir = $(pkgdatadir)/trusted.gpg.d
gpgreadmedir = $(datadir)/ostree/trusted.gpg.d
EXTRA_DIST += src/libostree/README-gpg src/libostree/bupsplit.h \
src/libostree/ostree-enumtypes.h.template \
src/libostree/ostree-enumtypes.c.template \

View File

@ -88,11 +88,13 @@ ostree_SOURCES += \
src/ostree/ot-remote-builtin-summary.c \
$(NULL)
if USE_LIBSOUP
ostree_SOURCES += \
src/ostree/ot-remote-builtin-add-cookie.c \
if USE_CURL_OR_SOUP
ostree_SOURCES += src/ostree/ot-remote-builtin-add-cookie.c \
src/ostree/ot-remote-builtin-delete-cookie.c \
src/ostree/ot-remote-builtin-list-cookies.c \
src/ostree/ot-remote-cookie-util.h \
src/ostree/ot-remote-cookie-util.c \
$(NULL)
endif
@ -112,15 +114,23 @@ ostree_CFLAGS = $(ostree_bin_shared_cflags)
ostree_LDADD = $(ostree_bin_shared_ldadd) libbsdiff.la libostree-kernel-args.la $(LIBSYSTEMD_LIBS)
if USE_LIBSOUP
ostree_SOURCES += src/ostree/ot-builtin-pull.c src/ostree/ot-builtin-trivial-httpd.c
ostree_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
ostree_LDADD += $(OT_INTERNAL_SOUP_LIBS)
if USE_CURL_OR_SOUP
ostree_SOURCES += src/ostree/ot-builtin-pull.c
endif
if USE_LIBSOUP
# Eventually once we stop things from using this, we should support disabling this
ostree_SOURCES += src/ostree/ot-builtin-trivial-httpd.c
pkglibexec_PROGRAMS += ostree-trivial-httpd
ostree_trivial_httpd_SOURCES = src/ostree/ostree-trivial-httpd.c
ostree_trivial_httpd_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_SOUP_CFLAGS)
ostree_trivial_httpd_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_SOUP_LIBS)
if !USE_CURL
# This is necessary for the cookie jar bits
ostree_CFLAGS += $(OT_INTERNAL_SOUP_CFLAGS)
ostree_LDADD += $(OT_INTERNAL_SOUP_LIBS)
endif
endif
if USE_LIBARCHIVE

View File

@ -83,6 +83,7 @@ dist_test_scripts = \
tests/test-admin-instutil-set-kargs.sh \
tests/test-admin-upgrade-not-backwards.sh \
tests/test-admin-pull-deploy-commit.sh \
tests/test-admin-pull-deploy-split.sh \
tests/test-admin-locking.sh \
tests/test-admin-deploy-clean.sh \
tests/test-repo-checkout-subpath.sh \
@ -200,11 +201,11 @@ TESTS_LDADD = $(common_tests_ldadd) libostreetest.la
tests_test_rollsum_cli_SOURCES = src/libostree/ostree-rollsum.c tests/test-rollsum-cli.c
tests_test_rollsum_cli_CFLAGS = $(TESTS_CFLAGS) $(OT_DEP_ZLIB_CFLAGS)
tests_test_rollsum_cli_LDADD = libbupsplit.la $(TESTS_LDADD) $(OT_DEP_ZLIB_LIBS)
tests_test_rollsum_cli_LDADD = $(bupsplitpath) $(TESTS_LDADD) $(OT_DEP_ZLIB_LIBS)
tests_test_rollsum_SOURCES = src/libostree/ostree-rollsum.c tests/test-rollsum.c
tests_test_rollsum_CFLAGS = $(TESTS_CFLAGS) $(OT_DEP_ZLIB_CFLAGS)
tests_test_rollsum_LDADD = libbupsplit.la $(TESTS_LDADD) $(OT_DEP_ZLIB_LIBS)
tests_test_rollsum_LDADD = $(bupsplitpath) $(TESTS_LDADD) $(OT_DEP_ZLIB_LIBS)
tests_test_mutable_tree_CFLAGS = $(TESTS_CFLAGS)
tests_test_mutable_tree_LDADD = $(TESTS_LDADD)

View File

@ -19,6 +19,8 @@ include Makefile-decls.am
shortened_sysconfdir = $$(echo "$(sysconfdir)" | sed -e 's|^$(prefix)||' -e 's|^/||')
OSTREE_GITREV=$(shell if command -v git >/dev/null 2>&1 && test -d $(srcdir)/.git; then git describe --abbrev=42 --tags --always HEAD; fi)
ACLOCAL_AMFLAGS = -I buildutil -I libglnx ${ACLOCAL_FLAGS}
AM_CPPFLAGS += -DDATADIR='"$(datadir)"' -DLIBEXECDIR='"$(libexecdir)"' \
-DLOCALEDIR=\"$(datadir)/locale\" -DSYSCONFDIR=\"$(sysconfdir)\" \
@ -26,6 +28,7 @@ AM_CPPFLAGS += -DDATADIR='"$(datadir)"' -DLIBEXECDIR='"$(libexecdir)"' \
-DOSTREE_FEATURES='"$(OSTREE_FEATURES)"' \
-DOSTREE_COMPILATION \
-DG_LOG_DOMAIN=\"OSTree\" \
-DOSTREE_GITREV='"$(OSTREE_GITREV)"' \
-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 \
-DSOUP_VERSION_MIN_REQUIRED=SOUP_VERSION_2_40 -DSOUP_VERSION_MAX_ALLOWED=SOUP_VERSION_2_48
AM_CFLAGS += -std=gnu99 $(WARN_CFLAGS)
@ -60,6 +63,30 @@ GIRS =
TYPELIBS = $(GIRS:.gir=.typelib)
endif
# These bits based on gnome:librsvg/Makefile.am
if ENABLE_RUST
if RUST_DEBUG
CARGO_RELEASE_ARGS=
else
CARGO_RELEASE_ARGS=--release
endif
check-local:
cd $(srcdir)/rust && CARGO_TARGET_DIR=$(abs_top_builddir)/target cargo test
clean-local:
cd $(srcdir)/rust && CARGO_TARGET_DIR=$(abs_top_builddir)/target cargo clean
dist-hook:
(cd $(distdir)/rust && \
cp $(abs_top_srcdir)/rust/Cargo.lock . && \
cargo vendor -q && \
mkdir .cargo && \
cp cargo-vendor-config .cargo/config)
EXTRA_DIST += $(srcdir)/rust/Cargo.toml $(srcdir)/rust/cargo-vendor-config
endif # end ENABLE_RUST
libglnx_srcpath := $(srcdir)/libglnx
libglnx_cflags := $(OT_DEP_GIO_UNIX_CFLAGS) "-I$(libglnx_srcpath)"
libglnx_libs := $(OT_DEP_GIO_UNIX_LIBS)

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,25 @@
OSTree
libOSTree
======
New! See the docs online at [Read The Docs (OSTree)](https://ostree.readthedocs.org/en/latest/ )
-----
OSTree is a tool that combines a "git-like" model for committing and
downloading bootable filesystem trees, along with a layer for
deploying them and managing the bootloader configuration.
This project is now known as "libOSTree", renamed from "OSTree"; the focus is on
the shared library. However, in most of the rest of the documentation, we will
use the term "OSTree", since it's slightly shorter, and changing all
documentation at once is impractical. We expect to transition to the new name
over time.
OSTree is like git in that it checksums individual files and has a
content-addressed-object store. It's unlike git in that it "checks
out" the files via hardlinks, and they should thus be immutable.
Therefore, another way to think of OSTree is that it's just a more
polished version of
libOSTree is a library and suite of command line tools that combines a
"git-like" model for committing and downloading bootable filesystem trees, along
with a layer for deploying them and managing the bootloader configuration.
The core OSTree model is like git in that it checksums individual files and has
a content-addressed-object store. It's unlike git in that it "checks out" the
files via hardlinks, and they should thus be immutable. Therefore, another way
to think of OSTree is that it's just a more polished version
of
[Linux VServer hardlinks](http://linux-vserver.org/index.php?title=util-vserver:Vhashify&oldid=2285).
**Features:**
@ -32,26 +38,36 @@ use OSTree as a "deduplicating hardlink store".
Projects using OSTree
---------------------
[rpm-ostree](https://github.com/projectatomic/rpm-ostree) is a tool
that uses OSTree as a shared library, and supports committing RPMs
into an OSTree repository, and deploying them on the client. This is
appropriate for "fixed purpose" systems. There is in progress work
for more sophisticated hybrid models, deeply integrating the RPM
packaging with OSTree.
[meta-updater](https://github.com/advancedtelematic/meta-updater) is
a layer available for [OpenEmbedded](http://www.openembedded.org/wiki/Main_Page)
systems.
[Project Atomic](http://www.projectatomic.io/) uses rpm-ostree to
provide a minimal host for Docker formatted Linux containers.
Replicating a base immutable OS, then using Docker for applications
meshes together two different tools with different tradeoffs.
[QtOTA](http://doc.qt.io/QtOTA/) is Qt's over-the-air update framework
which uses libostree.
[flatpak](https://github.com/alexlarsson/xdg-app) uses OSTree
for desktop application containers.
[rpm-ostree](https://github.com/projectatomic/rpm-ostree) is a next-generation
hybrid package/image system for [Fedora](https://getfedora.org/) and [CentOS](https://www.centos.org/),
used by the [Atomic Host](http://www.projectatomic.io/) project.
By default it uses libostree to atomically replicate a base OS (all dependency
resolution is done on the server), but it supports "package layering", where
additional RPMs can be layered on top of the base. This brings a "best of both worlds""
model for image and package systems.
[flatpak](https://github.com/flatpak/flatpak) uses libostree for desktop
application containers. Unlike most of the other systems here, flatpak does not
use the "libostree host system" aspects (e.g. bootloader management), just the
"git-like hardlink dedup". For example, flatpak supports a per-user OSTree
repository.
[Endless OS](https://endlessos.com/) uses libostree for their host system as
well as flatpak. See
their [eos-updater](https://github.com/endlessm/eos-updater)
and [deb-ostree-builder](https://github.com/dbnicholson/deb-ostree-builder)
projects.
[GNOME Continuous](https://wiki.gnome.org/Projects/GnomeContinuous) is
a custom build system designed for OSTree, using
[OpenEmbedded](http://www.openembedded.org/wiki/Main_Page) in concert
with a custom build system to do continuous delivery from hundreds of
git repositories.
where OSTree was born - as a high performance continuous delivery/testing
system for GNOME.
Building
--------

View File

@ -253,6 +253,8 @@ OBJEXT = @OBJEXT@
OSTREE_FEATURES = @OSTREE_FEATURES@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
OT_DEP_CURL_CFLAGS = @OT_DEP_CURL_CFLAGS@
OT_DEP_CURL_LIBS = @OT_DEP_CURL_LIBS@
OT_DEP_E2P_CFLAGS = @OT_DEP_E2P_CFLAGS@
OT_DEP_E2P_LIBS = @OT_DEP_E2P_LIBS@
OT_DEP_GIO_UNIX_CFLAGS = @OT_DEP_GIO_UNIX_CFLAGS@
@ -283,6 +285,7 @@ PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
RUST_TARGET_SUBDIR = @RUST_TARGET_SUBDIR@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
@ -312,6 +315,7 @@ build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
cargo = @cargo@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
@ -339,6 +343,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
rustc = @rustc@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@

View File

@ -14,7 +14,7 @@
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">OSTree API references</p></th></tr></table></div>
<div><p class="releaseinfo">for OSTree 2016.15</p></div>
<div><p class="releaseinfo">for OSTree 2017.3</p></div>
</div>
<hr>
</div>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -41,7 +41,7 @@
<tbody>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
<span class="returnvalue">guint</span>
</td>
<td class="function_name">
<a class="link" href="ostree-GPG-signature-verification-results.html#ostree-gpg-verify-result-count-all" title="ostree_gpg_verify_result_count_all ()">ostree_gpg_verify_result_count_all</a> <span class="c_punctuation">()</span>
@ -49,7 +49,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
<span class="returnvalue">guint</span>
</td>
<td class="function_name">
<a class="link" href="ostree-GPG-signature-verification-results.html#ostree-gpg-verify-result-count-valid" title="ostree_gpg_verify_result_count_valid ()">ostree_gpg_verify_result_count_valid</a> <span class="c_punctuation">()</span>
@ -57,7 +57,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-GPG-signature-verification-results.html#ostree-gpg-verify-result-lookup" title="ostree_gpg_verify_result_lookup ()">ostree_gpg_verify_result_lookup</a> <span class="c_punctuation">()</span>
@ -65,7 +65,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
<span class="returnvalue">GVariant</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-GPG-signature-verification-results.html#ostree-gpg-verify-result-get" title="ostree_gpg_verify_result_get ()">ostree_gpg_verify_result_get</a> <span class="c_punctuation">()</span>
@ -73,7 +73,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
<span class="returnvalue">GVariant</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-GPG-signature-verification-results.html#ostree-gpg-verify-result-get-all" title="ostree_gpg_verify_result_get_all ()">ostree_gpg_verify_result_get_all</a> <span class="c_punctuation">()</span>
@ -97,7 +97,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-GPG-signature-verification-results.html#ostree-gpg-verify-result-require-valid-signature" title="ostree_gpg_verify_result_require_valid_signature ()">ostree_gpg_verify_result_require_valid_signature</a> <span class="c_punctuation">()</span>
@ -146,7 +146,7 @@ or get all signature details with <a class="link" href="ostree-GPG-signature-ver
<a name="ostree-GPG-signature-verification-results.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="ostree-gpg-verify-result-count-all"></a><h3>ostree_gpg_verify_result_count_all ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
<pre class="programlisting"><span class="returnvalue">guint</span>
ostree_gpg_verify_result_count_all (<em class="parameter"><code><a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgVerifyResult" title="OstreeGpgVerifyResult"><span class="type">OstreeGpgVerifyResult</span></a> *result</code></em>);</pre>
<p>Counts all the signatures in <em class="parameter"><code>result</code></em>
.</p>
@ -173,7 +173,7 @@ ostree_gpg_verify_result_count_all (<em class="parameter"><code><a class="link"
<hr>
<div class="refsect2">
<a name="ostree-gpg-verify-result-count-valid"></a><h3>ostree_gpg_verify_result_count_valid ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
<pre class="programlisting"><span class="returnvalue">guint</span>
ostree_gpg_verify_result_count_valid (<em class="parameter"><code><a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgVerifyResult" title="OstreeGpgVerifyResult"><span class="type">OstreeGpgVerifyResult</span></a> *result</code></em>);</pre>
<p>Counts only the valid signatures in <em class="parameter"><code>result</code></em>
.</p>
@ -200,17 +200,17 @@ ostree_gpg_verify_result_count_valid (<em class="parameter"><code><a class="link
<hr>
<div class="refsect2">
<a name="ostree-gpg-verify-result-lookup"></a><h3>ostree_gpg_verify_result_lookup ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_gpg_verify_result_lookup (<em class="parameter"><code><a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgVerifyResult" title="OstreeGpgVerifyResult"><span class="type">OstreeGpgVerifyResult</span></a> *result</code></em>,
<em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key_id</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *out_signature_index</code></em>);</pre>
<em class="parameter"><code>const <span class="type">gchar</span> *key_id</code></em>,
<em class="parameter"><code><span class="type">guint</span> *out_signature_index</code></em>);</pre>
<p>Searches <em class="parameter"><code>result</code></em>
for a signature signed by <em class="parameter"><code>key_id</code></em>
. If a match is found,
the function returns <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> and sets <em class="parameter"><code>out_signature_index</code></em>
the function returns <code class="literal">TRUE</code> and sets <em class="parameter"><code>out_signature_index</code></em>
so that further
signature details can be obtained through <a class="link" href="ostree-GPG-signature-verification-results.html#ostree-gpg-verify-result-get" title="ostree_gpg_verify_result_get ()"><code class="function">ostree_gpg_verify_result_get()</code></a>.
If no match is found, the function returns <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> and leaves
If no match is found, the function returns <code class="literal">FALSE</code> and leaves
<em class="parameter"><code>out_signature_index</code></em>
unchanged.</p>
<div class="refsect3">
@ -236,7 +236,7 @@ If no match is found, the function returns <a href="https://developer.gnome.org/
<td class="parameter_name"><p>out_signature_index</p></td>
<td class="parameter_description"><p> return location for the index of the signature
signed by <em class="parameter"><code>key_id</code></em>
, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/out"><span class="acronym">out</span></a>]</span></td>
</tr>
</tbody>
@ -244,22 +244,22 @@ signed by <em class="parameter"><code>key_id</code></em>
</div>
<div class="refsect3">
<a name="ostree-gpg-verify-result-lookup.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on failure</p>
<p> <code class="literal">TRUE</code> on success, <code class="literal">FALSE</code> on failure</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="ostree-gpg-verify-result-get"></a><h3>ostree_gpg_verify_result_get ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
<pre class="programlisting"><span class="returnvalue">GVariant</span> *
ostree_gpg_verify_result_get (<em class="parameter"><code><a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgVerifyResult" title="OstreeGpgVerifyResult"><span class="type">OstreeGpgVerifyResult</span></a> *result</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> signature_index</code></em>,
<em class="parameter"><code><span class="type">guint</span> signature_index</code></em>,
<em class="parameter"><code><a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgSignatureAttr" title="enum OstreeGpgSignatureAttr"><span class="type">OstreeGpgSignatureAttr</span></a> *attrs</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> n_attrs</code></em>);</pre>
<p>Builds a <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> tuple of requested attributes for the GPG signature at
<em class="parameter"><code><span class="type">guint</span> n_attrs</code></em>);</pre>
<p>Builds a <span class="type">GVariant</span> tuple of requested attributes for the GPG signature at
<em class="parameter"><code>signature_index</code></em>
in <em class="parameter"><code>result</code></em>
. See the <a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgSignatureAttr" title="enum OstreeGpgSignatureAttr"><span class="type">OstreeGpgSignatureAttr</span></a> description
for the <a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#GVariantType"><span class="type">GVariantType</span></a> of each available attribute.</p>
for the <span class="type">GVariantType</span> of each available attribute.</p>
<p>It is a programmer error to request an invalid <a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgSignatureAttr" title="enum OstreeGpgSignatureAttr"><span class="type">OstreeGpgSignatureAttr</span></a> or
an invalid <em class="parameter"><code>signature_index</code></em>
. Use <a class="link" href="ostree-GPG-signature-verification-results.html#ostree-gpg-verify-result-count-all" title="ostree_gpg_verify_result_count_all ()"><code class="function">ostree_gpg_verify_result_count_all()</code></a> to
@ -300,29 +300,29 @@ array</p></td>
</div>
<div class="refsect3">
<a name="ostree-gpg-verify-result-get.returns"></a><h4>Returns</h4>
<p> a new, floating, <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> tuple</p>
<p> a new, floating, <span class="type">GVariant</span> tuple</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="ostree-gpg-verify-result-get-all"></a><h3>ostree_gpg_verify_result_get_all ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
<pre class="programlisting"><span class="returnvalue">GVariant</span> *
ostree_gpg_verify_result_get_all (<em class="parameter"><code><a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgVerifyResult" title="OstreeGpgVerifyResult"><span class="type">OstreeGpgVerifyResult</span></a> *result</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> signature_index</code></em>);</pre>
<p>Builds a <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> tuple of all available attributes for the GPG signature
<em class="parameter"><code><span class="type">guint</span> signature_index</code></em>);</pre>
<p>Builds a <span class="type">GVariant</span> tuple of all available attributes for the GPG signature
at <em class="parameter"><code>signature_index</code></em>
in <em class="parameter"><code>result</code></em>
.</p>
<p>The child values in the returned <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> tuple are ordered to match the
<p>The child values in the returned <span class="type">GVariant</span> tuple are ordered to match the
<a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgSignatureAttr" title="enum OstreeGpgSignatureAttr"><span class="type">OstreeGpgSignatureAttr</span></a> enumeration, which means the enum values can be
used as index values in functions like <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#g-variant-get-child"><code class="function">g_variant_get_child()</code></a>. See the
<a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgSignatureAttr" title="enum OstreeGpgSignatureAttr"><span class="type">OstreeGpgSignatureAttr</span></a> description for the <a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#GVariantType"><span class="type">GVariantType</span></a> of each
used as index values in functions like <code class="function">g_variant_get_child()</code>. See the
<a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgSignatureAttr" title="enum OstreeGpgSignatureAttr"><span class="type">OstreeGpgSignatureAttr</span></a> description for the <span class="type">GVariantType</span> of each
available attribute.</p>
<div class="note"><p>
The <a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgSignatureAttr" title="enum OstreeGpgSignatureAttr"><span class="type">OstreeGpgSignatureAttr</span></a> enumeration may be extended in the future
with new attributes, which would affect the <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> tuple returned by
with new attributes, which would affect the <span class="type">GVariant</span> tuple returned by
this function. While the position and type of current child values in
the <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> tuple will not change, to avoid backward-compatibility
the <span class="type">GVariant</span> tuple will not change, to avoid backward-compatibility
issues <span class="emphasis"><em>please do not depend on the tuple's overall size or
type signature</em></span>.
</p></div>
@ -355,7 +355,7 @@ available attribute.</p>
</div>
<div class="refsect3">
<a name="ostree-gpg-verify-result-get-all.returns"></a><h4>Returns</h4>
<p> a new, floating, <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> tuple</p>
<p> a new, floating, <span class="type">GVariant</span> tuple</p>
</div>
</div>
<hr>
@ -363,9 +363,9 @@ available attribute.</p>
<a name="ostree-gpg-verify-result-describe"></a><h3>ostree_gpg_verify_result_describe ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
ostree_gpg_verify_result_describe (<em class="parameter"><code><a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgVerifyResult" title="OstreeGpgVerifyResult"><span class="type">OstreeGpgVerifyResult</span></a> *result</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> signature_index</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Strings.html#GString"><span class="type">GString</span></a> *output_buffer</code></em>,
<em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *line_prefix</code></em>,
<em class="parameter"><code><span class="type">guint</span> signature_index</code></em>,
<em class="parameter"><code><span class="type">GString</span> *output_buffer</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *line_prefix</code></em>,
<em class="parameter"><code><a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgSignatureFormatFlags" title="enum OstreeGpgSignatureFormatFlags"><span class="type">OstreeGpgSignatureFormatFlags</span></a> flags</code></em>);</pre>
<p>Appends a brief, human-readable description of the GPG signature at
<em class="parameter"><code>signature_index</code></em>
@ -404,7 +404,7 @@ format. Currently must be 0.</p>
</tr>
<tr>
<td class="parameter_name"><p>output_buffer</p></td>
<td class="parameter_description"><p>a <a href="https://developer.gnome.org/glib/unstable/glib-Strings.html#GString"><span class="type">GString</span></a> to hold the description</p></td>
<td class="parameter_description"><p>a <span class="type">GString</span> to hold the description</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
@ -426,11 +426,11 @@ format. Currently must be 0.</p>
<a name="ostree-gpg-verify-result-describe-variant"></a><h3>ostree_gpg_verify_result_describe_variant ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
ostree_gpg_verify_result_describe_variant
(<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *variant</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Strings.html#GString"><span class="type">GString</span></a> *output_buffer</code></em>,
<em class="parameter"><code>const <a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *line_prefix</code></em>,
(<em class="parameter"><code><span class="type">GVariant</span> *variant</code></em>,
<em class="parameter"><code><span class="type">GString</span> *output_buffer</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *line_prefix</code></em>,
<em class="parameter"><code><a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgSignatureFormatFlags" title="enum OstreeGpgSignatureFormatFlags"><span class="type">OstreeGpgSignatureFormatFlags</span></a> flags</code></em>);</pre>
<p>Similar to <a class="link" href="ostree-GPG-signature-verification-results.html#ostree-gpg-verify-result-describe" title="ostree_gpg_verify_result_describe ()"><code class="function">ostree_gpg_verify_result_describe()</code></a> but takes a <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> of
<p>Similar to <a class="link" href="ostree-GPG-signature-verification-results.html#ostree-gpg-verify-result-describe" title="ostree_gpg_verify_result_describe ()"><code class="function">ostree_gpg_verify_result_describe()</code></a> but takes a <span class="type">GVariant</span> of
all attributes for a GPG signature instead of an <a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgVerifyResult" title="OstreeGpgVerifyResult"><span class="type">OstreeGpgVerifyResult</span></a>
and signature index.</p>
<p>The <em class="parameter"><code>variant</code></em>
@ -447,12 +447,12 @@ and signature index.</p>
<tbody>
<tr>
<td class="parameter_name"><p>variant</p></td>
<td class="parameter_description"><p>a <a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> from <a class="link" href="ostree-GPG-signature-verification-results.html#ostree-gpg-verify-result-get-all" title="ostree_gpg_verify_result_get_all ()"><code class="function">ostree_gpg_verify_result_get_all()</code></a></p></td>
<td class="parameter_description"><p>a <span class="type">GVariant</span> from <a class="link" href="ostree-GPG-signature-verification-results.html#ostree-gpg-verify-result-get-all" title="ostree_gpg_verify_result_get_all ()"><code class="function">ostree_gpg_verify_result_get_all()</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>output_buffer</p></td>
<td class="parameter_description"><p>a <a href="https://developer.gnome.org/glib/unstable/glib-Strings.html#GString"><span class="type">GString</span></a> to hold the description</p></td>
<td class="parameter_description"><p>a <span class="type">GString</span> to hold the description</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
@ -472,14 +472,14 @@ and signature index.</p>
<hr>
<div class="refsect2">
<a name="ostree-gpg-verify-result-require-valid-signature"></a><h3>ostree_gpg_verify_result_require_valid_signature ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_gpg_verify_result_require_valid_signature
(<em class="parameter"><code><a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgVerifyResult" title="OstreeGpgVerifyResult"><span class="type">OstreeGpgVerifyResult</span></a> *result</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Checks if the result contains at least one signature from the
trusted keyring. You can call this function immediately after
<a class="link" href="ostree-Content-addressed-object-store.html#ostree-repo-verify-summary" title="ostree_repo_verify_summary ()"><code class="function">ostree_repo_verify_summary()</code></a> or <a class="link" href="ostree-Content-addressed-object-store.html#ostree-repo-verify-commit-ext" title="ostree_repo_verify_commit_ext ()"><code class="function">ostree_repo_verify_commit_ext()</code></a> -
it will handle the <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> <em class="parameter"><code>result</code></em>
it will handle the <code class="literal">NULL</code> <em class="parameter"><code>result</code></em>
and filled <em class="parameter"><code>error</code></em>
too.</p>
<div class="refsect3">
@ -498,7 +498,7 @@ it will handle the <a href="https://developer.gnome.org/glib/unstable/glib-Stand
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>A <a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a></p></td>
<td class="parameter_description"><p>A <span class="type">GError</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
@ -506,9 +506,9 @@ it will handle the <a href="https://developer.gnome.org/glib/unstable/glib-Stand
</div>
<div class="refsect3">
<a name="ostree-gpg-verify-result-require-valid-signature.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>result</code></em>
was not <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and had at least one
signature from trusted keyring, otherwise <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a></p>
<p> <code class="literal">TRUE</code> if <em class="parameter"><code>result</code></em>
was not <code class="literal">NULL</code> and had at least one
signature from trusted keyring, otherwise <code class="literal">FALSE</code></p>
</div>
</div>
</div>
@ -524,7 +524,7 @@ signature from trusted keyring, otherwise <a href="https://developer.gnome.org/g
<div class="refsect2">
<a name="OstreeGpgSignatureAttr"></a><h3>enum OstreeGpgSignatureAttr</h3>
<p>Signature attributes available from an <a class="link" href="ostree-GPG-signature-verification-results.html#OstreeGpgVerifyResult" title="OstreeGpgVerifyResult"><span class="type">OstreeGpgVerifyResult</span></a>.
The attribute's <a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#GVariantType"><span class="type">GVariantType</span></a> is shown in brackets.</p>
The attribute's <span class="type">GVariantType</span> is shown in brackets.</p>
<div class="refsect3">
<a name="OstreeGpgSignatureAttr.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
@ -537,56 +537,56 @@ The attribute's <a href="https://developer.gnome.org/glib/unstable/glib-GVariant
<tr>
<td class="enum_member_name"><p><a name="OSTREE-GPG-SIGNATURE-ATTR-VALID:CAPS"></a>OSTREE_GPG_SIGNATURE_ATTR_VALID</p></td>
<td class="enum_member_description">
<p> [<a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-BOOLEAN:CAPS"><span class="type">G_VARIANT_TYPE_BOOLEAN</span></a>] Is the signature valid?</p>
<p> [<span class="type">G_VARIANT_TYPE_BOOLEAN</span>] Is the signature valid?</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="OSTREE-GPG-SIGNATURE-ATTR-SIG-EXPIRED:CAPS"></a>OSTREE_GPG_SIGNATURE_ATTR_SIG_EXPIRED</p></td>
<td class="enum_member_description">
<p> [<a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-BOOLEAN:CAPS"><span class="type">G_VARIANT_TYPE_BOOLEAN</span></a>] Has the signature expired?</p>
<p> [<span class="type">G_VARIANT_TYPE_BOOLEAN</span>] Has the signature expired?</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="OSTREE-GPG-SIGNATURE-ATTR-KEY-EXPIRED:CAPS"></a>OSTREE_GPG_SIGNATURE_ATTR_KEY_EXPIRED</p></td>
<td class="enum_member_description">
<p> [<a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-BOOLEAN:CAPS"><span class="type">G_VARIANT_TYPE_BOOLEAN</span></a>] Has the signing key expired?</p>
<p> [<span class="type">G_VARIANT_TYPE_BOOLEAN</span>] Has the signing key expired?</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="OSTREE-GPG-SIGNATURE-ATTR-KEY-REVOKED:CAPS"></a>OSTREE_GPG_SIGNATURE_ATTR_KEY_REVOKED</p></td>
<td class="enum_member_description">
<p> [<a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-BOOLEAN:CAPS"><span class="type">G_VARIANT_TYPE_BOOLEAN</span></a>] Has the signing key been revoked?</p>
<p> [<span class="type">G_VARIANT_TYPE_BOOLEAN</span>] Has the signing key been revoked?</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="OSTREE-GPG-SIGNATURE-ATTR-KEY-MISSING:CAPS"></a>OSTREE_GPG_SIGNATURE_ATTR_KEY_MISSING</p></td>
<td class="enum_member_description">
<p> [<a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-BOOLEAN:CAPS"><span class="type">G_VARIANT_TYPE_BOOLEAN</span></a>] Is the signing key missing?</p>
<p> [<span class="type">G_VARIANT_TYPE_BOOLEAN</span>] Is the signing key missing?</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="OSTREE-GPG-SIGNATURE-ATTR-FINGERPRINT:CAPS"></a>OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT</p></td>
<td class="enum_member_description">
<p> [<a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-STRING:CAPS"><span class="type">G_VARIANT_TYPE_STRING</span></a>] Fingerprint of the signing key</p>
<p> [<span class="type">G_VARIANT_TYPE_STRING</span>] Fingerprint of the signing key</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="OSTREE-GPG-SIGNATURE-ATTR-TIMESTAMP:CAPS"></a>OSTREE_GPG_SIGNATURE_ATTR_TIMESTAMP</p></td>
<td class="enum_member_description">
<p> [<a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-INT64:CAPS"><span class="type">G_VARIANT_TYPE_INT64</span></a>] Signature creation Unix timestamp</p>
<p> [<span class="type">G_VARIANT_TYPE_INT64</span>] Signature creation Unix timestamp</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="OSTREE-GPG-SIGNATURE-ATTR-EXP-TIMESTAMP:CAPS"></a>OSTREE_GPG_SIGNATURE_ATTR_EXP_TIMESTAMP</p></td>
<td class="enum_member_description">
<p> [<a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-INT64:CAPS"><span class="type">G_VARIANT_TYPE_INT64</span></a>] Signature expiration Unix timestamp (0 if no
<p> [<span class="type">G_VARIANT_TYPE_INT64</span>] Signature expiration Unix timestamp (0 if no
expiration)</p>
</td>
<td class="enum_member_annotations"> </td>
@ -594,7 +594,7 @@ The attribute's <a href="https://developer.gnome.org/glib/unstable/glib-GVariant
<tr>
<td class="enum_member_name"><p><a name="OSTREE-GPG-SIGNATURE-ATTR-PUBKEY-ALGO-NAME:CAPS"></a>OSTREE_GPG_SIGNATURE_ATTR_PUBKEY_ALGO_NAME</p></td>
<td class="enum_member_description">
<p> [<a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-STRING:CAPS"><span class="type">G_VARIANT_TYPE_STRING</span></a>] Name of the public key algorithm used to create
<p> [<span class="type">G_VARIANT_TYPE_STRING</span>] Name of the public key algorithm used to create
the signature</p>
</td>
<td class="enum_member_annotations"> </td>
@ -602,7 +602,7 @@ The attribute's <a href="https://developer.gnome.org/glib/unstable/glib-GVariant
<tr>
<td class="enum_member_name"><p><a name="OSTREE-GPG-SIGNATURE-ATTR-HASH-ALGO-NAME:CAPS"></a>OSTREE_GPG_SIGNATURE_ATTR_HASH_ALGO_NAME</p></td>
<td class="enum_member_description">
<p> [<a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-STRING:CAPS"><span class="type">G_VARIANT_TYPE_STRING</span></a>] Name of the hash algorithm used to create the
<p> [<span class="type">G_VARIANT_TYPE_STRING</span>] Name of the hash algorithm used to create the
signature</p>
</td>
<td class="enum_member_annotations"> </td>
@ -610,14 +610,14 @@ The attribute's <a href="https://developer.gnome.org/glib/unstable/glib-GVariant
<tr>
<td class="enum_member_name"><p><a name="OSTREE-GPG-SIGNATURE-ATTR-USER-NAME:CAPS"></a>OSTREE_GPG_SIGNATURE_ATTR_USER_NAME</p></td>
<td class="enum_member_description">
<p> [<a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-STRING:CAPS"><span class="type">G_VARIANT_TYPE_STRING</span></a>] The name of the signing key's primary user</p>
<p> [<span class="type">G_VARIANT_TYPE_STRING</span>] The name of the signing key's primary user</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="OSTREE-GPG-SIGNATURE-ATTR-USER-EMAIL:CAPS"></a>OSTREE_GPG_SIGNATURE_ATTR_USER_EMAIL</p></td>
<td class="enum_member_description">
<p> [<a href="https://developer.gnome.org/glib/unstable/glib-GVariantType.html#G-VARIANT-TYPE-STRING:CAPS"><span class="type">G_VARIANT_TYPE_STRING</span></a>] The email address of the signing key's primary
<p> [<span class="type">G_VARIANT_TYPE_STRING</span>] The email address of the signing key's primary
user</p>
</td>
<td class="enum_member_annotations"> </td>

View File

@ -79,7 +79,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-replace-file" title="ostree_mutable_tree_replace_file ()">ostree_mutable_tree_replace_file</a> <span class="c_punctuation">()</span>
@ -87,7 +87,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-ensure-dir" title="ostree_mutable_tree_ensure_dir ()">ostree_mutable_tree_ensure_dir</a> <span class="c_punctuation">()</span>
@ -95,7 +95,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-lookup" title="ostree_mutable_tree_lookup ()">ostree_mutable_tree_lookup</a> <span class="c_punctuation">()</span>
@ -103,7 +103,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-ensure-parent-dirs" title="ostree_mutable_tree_ensure_parent_dirs ()">ostree_mutable_tree_ensure_parent_dirs</a> <span class="c_punctuation">()</span>
@ -111,7 +111,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-walk" title="ostree_mutable_tree_walk ()">ostree_mutable_tree_walk</a> <span class="c_punctuation">()</span>
@ -119,7 +119,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Hash-Tables.html#GHashTable"><span class="returnvalue">GHashTable</span></a> *
<span class="returnvalue">GHashTable</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-get-subdirs" title="ostree_mutable_tree_get_subdirs ()">ostree_mutable_tree_get_subdirs</a> <span class="c_punctuation">()</span>
@ -127,7 +127,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Hash-Tables.html#GHashTable"><span class="returnvalue">GHashTable</span></a> *
<span class="returnvalue">GHashTable</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#ostree-mutable-tree-get-files" title="ostree_mutable_tree_get_files ()">ostree_mutable_tree_get_files</a> <span class="c_punctuation">()</span>
@ -202,41 +202,41 @@ ostree_mutable_tree_get_contents_checksum
<hr>
<div class="refsect2">
<a name="ostree-mutable-tree-replace-file"></a><h3>ostree_mutable_tree_replace_file ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_mutable_tree_replace_file (<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *checksum</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="ostree-mutable-tree-ensure-dir"></a><h3>ostree_mutable_tree_ensure_dir ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_mutable_tree_ensure_dir (<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> **out_subdir</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="ostree-mutable-tree-lookup"></a><h3>ostree_mutable_tree_lookup ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_mutable_tree_lookup (<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
<em class="parameter"><code><span class="type">char</span> **out_file_checksum</code></em>,
<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> **out_subdir</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="ostree-mutable-tree-ensure-parent-dirs"></a><h3>ostree_mutable_tree_ensure_parent_dirs ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_mutable_tree_ensure_parent_dirs
(<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> *split_path</code></em>,
<em class="parameter"><code><span class="type">GPtrArray</span> *split_path</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *metadata_checksum</code></em>,
<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> **out_parent</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Create all parent trees necessary for the given <em class="parameter"><code>split_path</code></em>
to
exist.</p>
@ -271,7 +271,7 @@ exist.</p>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a <a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a></p></td>
<td class="parameter_description"><p>a <span class="type">GError</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
@ -281,12 +281,12 @@ exist.</p>
<hr>
<div class="refsect2">
<a name="ostree-mutable-tree-walk"></a><h3>ostree_mutable_tree_walk ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_mutable_tree_walk (<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> *split_path</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> start</code></em>,
<em class="parameter"><code><span class="type">GPtrArray</span> *split_path</code></em>,
<em class="parameter"><code><span class="type">guint</span> start</code></em>,
<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> **out_subdir</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Traverse <em class="parameter"><code>start</code></em>
number of elements starting from <em class="parameter"><code>split_path</code></em>
; the
@ -334,7 +334,7 @@ child will be returned in <em class="parameter"><code>out_subdir</code></em>
<hr>
<div class="refsect2">
<a name="ostree-mutable-tree-get-subdirs"></a><h3>ostree_mutable_tree_get_subdirs ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Hash-Tables.html#GHashTable"><span class="returnvalue">GHashTable</span></a> *
<pre class="programlisting"><span class="returnvalue">GHashTable</span> *
ostree_mutable_tree_get_subdirs (<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> *self</code></em>);</pre>
<div class="refsect3">
<a name="ostree-mutable-tree-get-subdirs.returns"></a><h4>Returns</h4>
@ -345,7 +345,7 @@ ostree_mutable_tree_get_subdirs (<em class="parameter"><code><a class="link" hre
<hr>
<div class="refsect2">
<a name="ostree-mutable-tree-get-files"></a><h3>ostree_mutable_tree_get_files ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Hash-Tables.html#GHashTable"><span class="returnvalue">GHashTable</span></a> *
<pre class="programlisting"><span class="returnvalue">GHashTable</span> *
ostree_mutable_tree_get_files (<em class="parameter"><code><a class="link" href="ostree-In-memory-modifiable-filesystem-tree.html#OstreeMutableTree" title="OstreeMutableTree"><span class="type">OstreeMutableTree</span></a> *self</code></em>);</pre>
<div class="refsect3">
<a name="ostree-mutable-tree-get-files.returns"></a><h4>Returns</h4>

View File

@ -65,7 +65,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
<span class="returnvalue">guint</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Progress-notification-system-for-asynchronous-operations.html#ostree-async-progress-get-uint" title="ostree_async_progress_get_uint ()">ostree_async_progress_get_uint</a> <span class="c_punctuation">()</span>
@ -73,7 +73,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
<span class="returnvalue">guint64</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Progress-notification-system-for-asynchronous-operations.html#ostree-async-progress-get-uint64" title="ostree_async_progress_get_uint64 ()">ostree_async_progress_get_uint64</a> <span class="c_punctuation">()</span>
@ -156,7 +156,7 @@ ostree_async_progress_new (<em class="parameter"><code><span class="type">void</
<a name="ostree-async-progress-new-and-connect"></a><h3>ostree_async_progress_new_and_connect ()</h3>
<pre class="programlisting"><a class="link" href="ostree-Progress-notification-system-for-asynchronous-operations.html#OstreeAsyncProgress" title="OstreeAsyncProgress"><span class="returnvalue">OstreeAsyncProgress</span></a> *
ostree_async_progress_new_and_connect (<em class="parameter"><code><span class="type">void</span> (*changed) (OstreeAsyncProgress *self, gpointer user_data)</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
@ -167,14 +167,14 @@ ostree_async_progress_get_status (<em class="parameter"><code><a class="link" hr
<hr>
<div class="refsect2">
<a name="ostree-async-progress-get-uint"></a><h3>ostree_async_progress_get_uint ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
<pre class="programlisting"><span class="returnvalue">guint</span>
ostree_async_progress_get_uint (<em class="parameter"><code><a class="link" href="ostree-Progress-notification-system-for-asynchronous-operations.html#OstreeAsyncProgress" title="OstreeAsyncProgress"><span class="type">OstreeAsyncProgress</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *key</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="ostree-async-progress-get-uint64"></a><h3>ostree_async_progress_get_uint64 ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a>
<pre class="programlisting"><span class="returnvalue">guint64</span>
ostree_async_progress_get_uint64 (<em class="parameter"><code><a class="link" href="ostree-Progress-notification-system-for-asynchronous-operations.html#OstreeAsyncProgress" title="OstreeAsyncProgress"><span class="type">OstreeAsyncProgress</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *key</code></em>);</pre>
</div>
@ -191,7 +191,7 @@ ostree_async_progress_set_status (<em class="parameter"><code><a class="link" hr
<pre class="programlisting"><span class="returnvalue">void</span>
ostree_async_progress_set_uint (<em class="parameter"><code><a class="link" href="ostree-Progress-notification-system-for-asynchronous-operations.html#OstreeAsyncProgress" title="OstreeAsyncProgress"><span class="type">OstreeAsyncProgress</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *key</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> value</code></em>);</pre>
<em class="parameter"><code><span class="type">guint</span> value</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
@ -199,7 +199,7 @@ ostree_async_progress_set_uint (<em class="parameter"><code><a class="link" href
<pre class="programlisting"><span class="returnvalue">void</span>
ostree_async_progress_set_uint64 (<em class="parameter"><code><a class="link" href="ostree-Progress-notification-system-for-asynchronous-operations.html#OstreeAsyncProgress" title="OstreeAsyncProgress"><span class="type">OstreeAsyncProgress</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *key</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> value</code></em>);</pre>
<em class="parameter"><code><span class="type">guint64</span> value</code></em>);</pre>
</div>
<hr>
<div class="refsect2">

View File

@ -57,7 +57,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="returnvalue">GFile</span></a> *
<span class="returnvalue">GFile</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-get-path" title="ostree_sysroot_get_path ()">ostree_sysroot_get_path</a> <span class="c_punctuation">()</span>
@ -65,7 +65,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-load" title="ostree_sysroot_load ()">ostree_sysroot_load</a> <span class="c_punctuation">()</span>
@ -73,7 +73,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-load-if-changed" title="ostree_sysroot_load_if_changed ()">ostree_sysroot_load_if_changed</a> <span class="c_punctuation">()</span>
@ -81,7 +81,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-lock" title="ostree_sysroot_lock ()">ostree_sysroot_lock</a> <span class="c_punctuation">()</span>
@ -89,7 +89,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-try-lock" title="ostree_sysroot_try_lock ()">ostree_sysroot_try_lock</a> <span class="c_punctuation">()</span>
@ -105,7 +105,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-lock-finish" title="ostree_sysroot_lock_finish ()">ostree_sysroot_lock_finish</a> <span class="c_punctuation">()</span>
@ -137,7 +137,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-ensure-initialized" title="ostree_sysroot_ensure_initialized ()">ostree_sysroot_ensure_initialized</a> <span class="c_punctuation">()</span>
@ -161,7 +161,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="returnvalue">GPtrArray</span></a> *
<span class="returnvalue">GPtrArray</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-get-deployments" title="ostree_sysroot_get_deployments ()">ostree_sysroot_get_deployments</a> <span class="c_punctuation">()</span>
@ -177,7 +177,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="returnvalue">GFile</span></a> *
<span class="returnvalue">GFile</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-get-deployment-directory" title="ostree_sysroot_get_deployment_directory ()">ostree_sysroot_get_deployment_directory</a> <span class="c_punctuation">()</span>
@ -193,7 +193,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="returnvalue">GFile</span></a> *
<span class="returnvalue">GFile</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-get-deployment-origin-path" title="ostree_sysroot_get_deployment_origin_path ()">ostree_sysroot_get_deployment_origin_path</a> <span class="c_punctuation">()</span>
@ -201,7 +201,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-cleanup" title="ostree_sysroot_cleanup ()">ostree_sysroot_cleanup</a> <span class="c_punctuation">()</span>
@ -209,7 +209,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-prepare-cleanup" title="ostree_sysroot_prepare_cleanup ()">ostree_sysroot_prepare_cleanup</a> <span class="c_punctuation">()</span>
@ -217,7 +217,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-get-repo" title="ostree_sysroot_get_repo ()">ostree_sysroot_get_repo</a> <span class="c_punctuation">()</span>
@ -225,7 +225,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-init-osname" title="ostree_sysroot_init_osname ()">ostree_sysroot_init_osname</a> <span class="c_punctuation">()</span>
@ -233,7 +233,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-deployment-set-kargs" title="ostree_sysroot_deployment_set_kargs ()">ostree_sysroot_deployment_set_kargs</a> <span class="c_punctuation">()</span>
@ -241,7 +241,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-deployment-set-mutable" title="ostree_sysroot_deployment_set_mutable ()">ostree_sysroot_deployment_set_mutable</a> <span class="c_punctuation">()</span>
@ -249,7 +249,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-deployment-unlock" title="ostree_sysroot_deployment_unlock ()">ostree_sysroot_deployment_unlock</a> <span class="c_punctuation">()</span>
@ -257,7 +257,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-write-deployments" title="ostree_sysroot_write_deployments ()">ostree_sysroot_write_deployments</a> <span class="c_punctuation">()</span>
@ -265,7 +265,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-write-origin-file" title="ostree_sysroot_write_origin_file ()">ostree_sysroot_write_origin_file</a> <span class="c_punctuation">()</span>
@ -273,7 +273,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-deploy-tree" title="ostree_sysroot_deploy_tree ()">ostree_sysroot_deploy_tree</a> <span class="c_punctuation">()</span>
@ -289,7 +289,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Key-value-file-parser.html#GKeyFile"><span class="returnvalue">GKeyFile</span></a> *
<span class="returnvalue">GKeyFile</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-origin-new-from-refspec" title="ostree_sysroot_origin_new_from_refspec ()">ostree_sysroot_origin_new_from_refspec</a> <span class="c_punctuation">()</span>
@ -297,7 +297,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-simple-write-deployment" title="ostree_sysroot_simple_write_deployment ()">ostree_sysroot_simple_write_deployment</a> <span class="c_punctuation">()</span>
@ -340,7 +340,7 @@ perform locking externally.</p>
<div class="refsect2">
<a name="ostree-sysroot-new"></a><h3>ostree_sysroot_new ()</h3>
<pre class="programlisting"><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="returnvalue">OstreeSysroot</span></a> *
ostree_sysroot_new (<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="type">GFile</span></a> *path</code></em>);</pre>
ostree_sysroot_new (<em class="parameter"><code><span class="type">GFile</span> *path</code></em>);</pre>
<div class="refsect3">
<a name="ostree-sysroot-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
@ -351,7 +351,7 @@ ostree_sysroot_new (<em class="parameter"><code><a href="https://developer.gnome
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p> Path to a system root directory, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_description"><p> Path to a system root directory, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span></td>
</tr></tbody>
</table></div>
@ -377,7 +377,7 @@ ostree_sysroot_new_default (<em class="parameter"><code><span class="type">void<
<hr>
<div class="refsect2">
<a name="ostree-sysroot-get-path"></a><h3>ostree_sysroot_get_path ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="returnvalue">GFile</span></a> *
<pre class="programlisting"><span class="returnvalue">GFile</span> *
ostree_sysroot_get_path (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>);</pre>
<div class="refsect3">
<a name="ostree-sysroot-get-path.returns"></a><h4>Returns</h4>
@ -388,10 +388,10 @@ ostree_sysroot_get_path (<em class="parameter"><code><a class="link" href="ostre
<hr>
<div class="refsect2">
<a name="ostree-sysroot-load"></a><h3>ostree_sysroot_load ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_load (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Load deployment list, bootversion, and subbootversion from the
rootfs <em class="parameter"><code>self</code></em>
.</p>
@ -426,18 +426,18 @@ rootfs <em class="parameter"><code>self</code></em>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-load-if-changed"></a><h3>ostree_sysroot_load_if_changed ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_load_if_changed (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> *out_changed</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">gboolean</span> *out_changed</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-lock"></a><h3>ostree_sysroot_lock ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_lock (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Acquire an exclusive multi-process write lock for <em class="parameter"><code>self</code></em>
. This call
blocks until the lock has been acquired. The lock is not
@ -471,15 +471,15 @@ be released if <em class="parameter"><code>self</code></em>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-try-lock"></a><h3>ostree_sysroot_try_lock ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_try_lock (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> *out_acquired</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">gboolean</span> *out_acquired</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Try to acquire an exclusive multi-process write lock for <em class="parameter"><code>self</code></em>
. If
another process holds the lock, this function will return
immediately, setting <em class="parameter"><code>out_acquired</code></em>
to <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, and returning <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>
to <code class="literal">FALSE</code>, and returning <code class="literal">TRUE</code>
(and no error).</p>
<p>Release the lock with <a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-unlock" title="ostree_sysroot_unlock ()"><code class="function">ostree_sysroot_unlock()</code></a>. The lock will also
be released if <em class="parameter"><code>self</code></em>
@ -517,9 +517,9 @@ be released if <em class="parameter"><code>self</code></em>
<a name="ostree-sysroot-lock-async"></a><h3>ostree_sysroot_lock_async ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
ostree_sysroot_lock_async (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GAsyncReadyCallback</span> callback</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
<p>An asynchronous version of <a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-lock" title="ostree_sysroot_lock ()"><code class="function">ostree_sysroot_lock()</code></a>.</p>
<div class="refsect3">
<a name="ostree-sysroot-lock-async.parameters"></a><h4>Parameters</h4>
@ -557,10 +557,10 @@ ostree_sysroot_lock_async (<em class="parameter"><code><a class="link" href="ost
<hr>
<div class="refsect2">
<a name="ostree-sysroot-lock-finish"></a><h3>ostree_sysroot_lock_finish ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_lock_finish (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GAsyncResult.html#GAsyncResult-struct"><span class="type">GAsyncResult</span></a> *result</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GAsyncResult</span> *result</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Call when <a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-lock-async" title="ostree_sysroot_lock_async ()"><code class="function">ostree_sysroot_lock_async()</code></a> is ready.</p>
<div class="refsect3">
<a name="ostree-sysroot-lock-finish.parameters"></a><h4>Parameters</h4>
@ -672,10 +672,10 @@ calling this function.</p>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-ensure-initialized"></a><h3>ostree_sysroot_ensure_initialized ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_ensure_initialized (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Ensure that <em class="parameter"><code>self</code></em>
is set up as a valid rootfs, by creating
/ostree/repo, among other things.</p>
@ -722,7 +722,7 @@ ostree_sysroot_get_subbootversion (<em class="parameter"><code><a class="link" h
<hr>
<div class="refsect2">
<a name="ostree-sysroot-get-deployments"></a><h3>ostree_sysroot_get_deployments ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="returnvalue">GPtrArray</span></a> *
<pre class="programlisting"><span class="returnvalue">GPtrArray</span> *
ostree_sysroot_get_deployments (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>);</pre>
<div class="refsect3">
<a name="ostree-sysroot-get-deployments.parameters"></a><h4>Parameters</h4>
@ -767,14 +767,14 @@ ostree_sysroot_get_booted_deployment (<em class="parameter"><code><a class="link
</div>
<div class="refsect3">
<a name="ostree-sysroot-get-booted-deployment.returns"></a><h4>Returns</h4>
<p> The currently booted deployment, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none. </p>
<p> The currently booted deployment, or <code class="literal">NULL</code> if none. </p>
<p><span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-get-deployment-directory"></a><h3>ostree_sysroot_get_deployment_directory ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="returnvalue">GFile</span></a> *
<pre class="programlisting"><span class="returnvalue">GFile</span> *
ostree_sysroot_get_deployment_directory
(<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a class="link" href="ostree-ostree-deployment.html#OstreeDeployment" title="OstreeDeployment"><span class="type">OstreeDeployment</span></a> *deployment</code></em>);</pre>
@ -846,9 +846,9 @@ or concatenate it with the full <a class="link" href="ostree-Root-partition-moun
<hr>
<div class="refsect2">
<a name="ostree-sysroot-get-deployment-origin-path"></a><h3>ostree_sysroot_get_deployment_origin_path ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="returnvalue">GFile</span></a> *
<pre class="programlisting"><span class="returnvalue">GFile</span> *
ostree_sysroot_get_deployment_origin_path
(<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="type">GFile</span></a> *deployment_path</code></em>);</pre>
(<em class="parameter"><code><span class="type">GFile</span> *deployment_path</code></em>);</pre>
<div class="refsect3">
<a name="ostree-sysroot-get-deployment-origin-path.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
@ -873,10 +873,10 @@ ostree_sysroot_get_deployment_origin_path
<hr>
<div class="refsect2">
<a name="ostree-sysroot-cleanup"></a><h3>ostree_sysroot_cleanup ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_cleanup (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Delete any state that resulted from a partially completed
transaction, such as incomplete deployments.</p>
<div class="refsect3">
@ -910,10 +910,10 @@ transaction, such as incomplete deployments.</p>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-prepare-cleanup"></a><h3>ostree_sysroot_prepare_cleanup ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_prepare_cleanup (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Like <a class="link" href="ostree-Root-partition-mount-point.html#ostree-sysroot-cleanup" title="ostree_sysroot_cleanup ()"><code class="function">ostree_sysroot_cleanup()</code></a> in that it cleans up incomplete deployments
and old boot versions, but does NOT prune the repository.</p>
<div class="refsect3">
@ -947,11 +947,11 @@ and old boot versions, but does NOT prune the repository.</p>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-get-repo"></a><h3>ostree_sysroot_get_repo ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_get_repo (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a class="link" href="ostree-Content-addressed-object-store.html#OstreeRepo" title="OstreeRepo"><span class="type">OstreeRepo</span></a> **out_repo</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Retrieve the OSTree repository in sysroot <em class="parameter"><code>self</code></em>
.</p>
<div class="refsect3">
@ -991,11 +991,11 @@ ostree_sysroot_get_repo (<em class="parameter"><code><a class="link" href="ostre
<hr>
<div class="refsect2">
<a name="ostree-sysroot-init-osname"></a><h3>ostree_sysroot_init_osname ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_init_osname (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *osname</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Initialize the directory structure for an "osname", which is a
group of operating system deployments, with a shared <code class="literal">/var</code>. One
is required for generating a deployment.</p>
@ -1035,12 +1035,12 @@ is required for generating a deployment.</p>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-deployment-set-kargs"></a><h3>ostree_sysroot_deployment_set_kargs ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_deployment_set_kargs (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a class="link" href="ostree-ostree-deployment.html#OstreeDeployment" title="OstreeDeployment"><span class="type">OstreeDeployment</span></a> *deployment</code></em>,
<em class="parameter"><code><span class="type">char</span> **new_kargs</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Entirely replace the kernel arguments of <em class="parameter"><code>deployment</code></em>
with the
values in <em class="parameter"><code>new_kargs</code></em>
@ -1086,12 +1086,12 @@ values in <em class="parameter"><code>new_kargs</code></em>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-deployment-set-mutable"></a><h3>ostree_sysroot_deployment_set_mutable ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_deployment_set_mutable (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a class="link" href="ostree-ostree-deployment.html#OstreeDeployment" title="OstreeDeployment"><span class="type">OstreeDeployment</span></a> *deployment</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> is_mutable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">gboolean</span> is_mutable</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>By default, deployment directories are not mutable. This function
will allow making them temporarily mutable, for example to allow
layering additional non-OSTree content.</p>
@ -1131,12 +1131,12 @@ layering additional non-OSTree content.</p>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-deployment-unlock"></a><h3>ostree_sysroot_deployment_unlock ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_deployment_unlock (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a class="link" href="ostree-ostree-deployment.html#OstreeDeployment" title="OstreeDeployment"><span class="type">OstreeDeployment</span></a> *deployment</code></em>,
<em class="parameter"><code><span class="type">OstreeDeploymentUnlockedState</span> unlocked_state</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Configure the target deployment <em class="parameter"><code>deployment</code></em>
such that it
is writable. There are multiple modes, essentially differing
@ -1184,11 +1184,11 @@ across reboots.</p>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-write-deployments"></a><h3>ostree_sysroot_write_deployments ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_write_deployments (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> *new_deployments</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GPtrArray</span> *new_deployments</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Assuming <em class="parameter"><code>new_deployments</code></em>
have already been deployed in place on
disk, atomically update bootloader configuration.</p>
@ -1228,17 +1228,17 @@ disk, atomically update bootloader configuration.</p>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-write-origin-file"></a><h3>ostree_sysroot_write_origin_file ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_write_origin_file (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *sysroot</code></em>,
<em class="parameter"><code><a class="link" href="ostree-ostree-deployment.html#OstreeDeployment" title="OstreeDeployment"><span class="type">OstreeDeployment</span></a> *deployment</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Key-value-file-parser.html#GKeyFile"><span class="type">GKeyFile</span></a> *new_origin</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GKeyFile</span> *new_origin</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Immediately replace the origin file of the referenced <em class="parameter"><code>deployment</code></em>
with the contents of <em class="parameter"><code>new_origin</code></em>
. If <em class="parameter"><code>new_origin</code></em>
is <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
is <code class="literal">NULL</code>,
this function will write the current origin of <em class="parameter"><code>deployment</code></em>
.</p>
<div class="refsect3">
@ -1282,16 +1282,16 @@ this function will write the current origin of <em class="parameter"><code>deplo
<hr>
<div class="refsect2">
<a name="ostree-sysroot-deploy-tree"></a><h3>ostree_sysroot_deploy_tree ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_deploy_tree (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *osname</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *revision</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Key-value-file-parser.html#GKeyFile"><span class="type">GKeyFile</span></a> *origin</code></em>,
<em class="parameter"><code><span class="type">GKeyFile</span> *origin</code></em>,
<em class="parameter"><code><a class="link" href="ostree-ostree-deployment.html#OstreeDeployment" title="OstreeDeployment"><span class="type">OstreeDeployment</span></a> *provided_merge_deployment</code></em>,
<em class="parameter"><code><span class="type">char</span> **override_kernel_argv</code></em>,
<em class="parameter"><code><a class="link" href="ostree-ostree-deployment.html#OstreeDeployment" title="OstreeDeployment"><span class="type">OstreeDeployment</span></a> **out_new_deployment</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Check out deployment tree with revision <em class="parameter"><code>revision</code></em>
, performing a 3
way merge with <em class="parameter"><code>provided_merge_deployment</code></em>
@ -1332,7 +1332,7 @@ way merge with <em class="parameter"><code>provided_merge_deployment</code></em>
</tr>
<tr>
<td class="parameter_name"><p>override_kernel_argv</p></td>
<td class="parameter_description"><p> Use these as kernel arguments; if <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, inherit options from provided_merge_deployment. </p></td>
<td class="parameter_description"><p> Use these as kernel arguments; if <code class="literal">NULL</code>, inherit options from provided_merge_deployment. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>][<a href="http://foldoc.org/array"><span class="acronym">array</span></a> zero-terminated=1][<a href="http://foldoc.org/element-type"><span class="acronym">element-type</span></a> utf8]</span></td>
</tr>
<tr>
@ -1393,7 +1393,7 @@ the first one in the current deployment list which matches osname.</p>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-origin-new-from-refspec"></a><h3>ostree_sysroot_origin_new_from_refspec ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Key-value-file-parser.html#GKeyFile"><span class="returnvalue">GKeyFile</span></a> *
<pre class="programlisting"><span class="returnvalue">GKeyFile</span> *
ostree_sysroot_origin_new_from_refspec
(<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *refspec</code></em>);</pre>
@ -1422,15 +1422,15 @@ as an origin. </p>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-simple-write-deployment"></a><h3>ostree_sysroot_simple_write_deployment ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_simple_write_deployment
(<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *sysroot</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *osname</code></em>,
<em class="parameter"><code><a class="link" href="ostree-ostree-deployment.html#OstreeDeployment" title="OstreeDeployment"><span class="type">OstreeDeployment</span></a> *new_deployment</code></em>,
<em class="parameter"><code><a class="link" href="ostree-ostree-deployment.html#OstreeDeployment" title="OstreeDeployment"><span class="type">OstreeDeployment</span></a> *merge_deployment</code></em>,
<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysrootSimpleWriteDeploymentFlags" title="enum OstreeSysrootSimpleWriteDeploymentFlags"><span class="type">OstreeSysrootSimpleWriteDeploymentFlags</span></a> flags</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Prepend <em class="parameter"><code>new_deployment</code></em>
to the list of deployments, commit, and
cleanup. By default, all other deployments for the given <em class="parameter"><code>osname</code></em>

View File

@ -49,7 +49,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="returnvalue">GFile</span></a> *
<span class="returnvalue">GFile</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-SELinux-policy-management.html#ostree-sepolicy-get-path" title="ostree_sepolicy_get_path ()">ostree_sepolicy_get_path</a> <span class="c_punctuation">()</span>
@ -64,7 +64,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-SELinux-policy-management.html#ostree-sepolicy-get-label" title="ostree_sepolicy_get_label ()">ostree_sepolicy_get_label</a> <span class="c_punctuation">()</span>
@ -79,7 +79,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-SELinux-policy-management.html#ostree-sepolicy-restorecon" title="ostree_sepolicy_restorecon ()">ostree_sepolicy_restorecon</a> <span class="c_punctuation">()</span>
@ -87,7 +87,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-SELinux-policy-management.html#ostree-sepolicy-setfscreatecon" title="ostree_sepolicy_setfscreatecon ()">ostree_sepolicy_setfscreatecon</a> <span class="c_punctuation">()</span>
@ -133,9 +133,9 @@ root and perform labeling.</p>
<div class="refsect2">
<a name="ostree-sepolicy-new"></a><h3>ostree_sepolicy_new ()</h3>
<pre class="programlisting"><a class="link" href="ostree-SELinux-policy-management.html#OstreeSePolicy" title="OstreeSePolicy"><span class="returnvalue">OstreeSePolicy</span></a> *
ostree_sepolicy_new (<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="type">GFile</span></a> *path</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
ostree_sepolicy_new (<em class="parameter"><code><span class="type">GFile</span> *path</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<div class="refsect3">
<a name="ostree-sepolicy-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
@ -161,7 +161,7 @@ ostree_sepolicy_new (<em class="parameter"><code><a href="https://developer.gnom
<hr>
<div class="refsect2">
<a name="ostree-sepolicy-get-path"></a><h3>ostree_sepolicy_get_path ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="returnvalue">GFile</span></a> *
<pre class="programlisting"><span class="returnvalue">GFile</span> *
ostree_sepolicy_get_path (<em class="parameter"><code><a class="link" href="ostree-SELinux-policy-management.html#OstreeSePolicy" title="OstreeSePolicy"><span class="type">OstreeSePolicy</span></a> *self</code></em>);</pre>
<div class="refsect3">
<a name="ostree-sepolicy-get-path.returns"></a><h4>Returns</h4>
@ -183,18 +183,18 @@ ostree_sepolicy_get_name (<em class="parameter"><code><a class="link" href="ostr
<hr>
<div class="refsect2">
<a name="ostree-sepolicy-get-label"></a><h3>ostree_sepolicy_get_label ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sepolicy_get_label (<em class="parameter"><code><a class="link" href="ostree-SELinux-policy-management.html#OstreeSePolicy" title="OstreeSePolicy"><span class="type">OstreeSePolicy</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *relpath</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> unix_mode</code></em>,
<em class="parameter"><code><span class="type">guint32</span> unix_mode</code></em>,
<em class="parameter"><code><span class="type">char</span> **out_label</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Store in <em class="parameter"><code>out_label</code></em>
the security context for the given <em class="parameter"><code>relpath</code></em>
and
mode <em class="parameter"><code>unix_mode</code></em>
. If the policy does not specify a label, <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
. If the policy does not specify a label, <code class="literal">NULL</code>
will be returned.</p>
<div class="refsect3">
<a name="ostree-sepolicy-get-label.parameters"></a><h4>Parameters</h4>
@ -253,15 +253,15 @@ ostree_sepolicy_get_csum (<em class="parameter"><code><a class="link" href="ostr
<hr>
<div class="refsect2">
<a name="ostree-sepolicy-restorecon"></a><h3>ostree_sepolicy_restorecon ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sepolicy_restorecon (<em class="parameter"><code><a class="link" href="ostree-SELinux-policy-management.html#OstreeSePolicy" title="OstreeSePolicy"><span class="type">OstreeSePolicy</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GFileInfo.html#GFileInfo-struct"><span class="type">GFileInfo</span></a> *info</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="type">GFile</span></a> *target</code></em>,
<em class="parameter"><code><span class="type">GFileInfo</span> *info</code></em>,
<em class="parameter"><code><span class="type">GFile</span> *target</code></em>,
<em class="parameter"><code><a class="link" href="ostree-SELinux-policy-management.html#OstreeSePolicyRestoreconFlags" title="enum OstreeSePolicyRestoreconFlags"><span class="type">OstreeSePolicyRestoreconFlags</span></a> flags</code></em>,
<em class="parameter"><code><span class="type">char</span> **out_new_label</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Reset the security context of <em class="parameter"><code>target</code></em>
based on the SELinux policy.</p>
<div class="refsect3">
@ -300,7 +300,7 @@ ostree_sepolicy_restorecon (<em class="parameter"><code><a class="link" href="os
</tr>
<tr>
<td class="parameter_name"><p>out_new_label</p></td>
<td class="parameter_description"><p> New label, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if unchanged. </p></td>
<td class="parameter_description"><p> New label, or <code class="literal">NULL</code> if unchanged. </p></td>
<td class="parameter_annotations"><span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>][<a href="http://foldoc.org/out"><span class="acronym">out</span></a>]</span></td>
</tr>
<tr>
@ -320,11 +320,11 @@ ostree_sepolicy_restorecon (<em class="parameter"><code><a class="link" href="os
<hr>
<div class="refsect2">
<a name="ostree-sepolicy-setfscreatecon"></a><h3>ostree_sepolicy_setfscreatecon ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sepolicy_setfscreatecon (<em class="parameter"><code><a class="link" href="ostree-SELinux-policy-management.html#OstreeSePolicy" title="OstreeSePolicy"><span class="type">OstreeSePolicy</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> mode</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">guint32</span> mode</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<div class="refsect3">
<a name="ostree-sepolicy-setfscreatecon.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">

View File

@ -65,7 +65,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Key-value-file-parser.html#GKeyFile"><span class="returnvalue">GKeyFile</span></a> *
<span class="returnvalue">GKeyFile</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-Simple-upgrade-class.html#ostree-sysroot-upgrader-get-origin" title="ostree_sysroot_upgrader_get_origin ()">ostree_sysroot_upgrader_get_origin</a> <span class="c_punctuation">()</span>
@ -73,7 +73,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Key-value-file-parser.html#GKeyFile"><span class="returnvalue">GKeyFile</span></a> *
<span class="returnvalue">GKeyFile</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-Simple-upgrade-class.html#ostree-sysroot-upgrader-dup-origin" title="ostree_sysroot_upgrader_dup_origin ()">ostree_sysroot_upgrader_dup_origin</a> <span class="c_punctuation">()</span>
@ -81,7 +81,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Simple-upgrade-class.html#ostree-sysroot-upgrader-set-origin" title="ostree_sysroot_upgrader_set_origin ()">ostree_sysroot_upgrader_set_origin</a> <span class="c_punctuation">()</span>
@ -97,7 +97,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Simple-upgrade-class.html#ostree-sysroot-upgrader-check-timestamps" title="ostree_sysroot_upgrader_check_timestamps ()">ostree_sysroot_upgrader_check_timestamps</a> <span class="c_punctuation">()</span>
@ -105,7 +105,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Simple-upgrade-class.html#ostree-sysroot-upgrader-pull" title="ostree_sysroot_upgrader_pull ()">ostree_sysroot_upgrader_pull</a> <span class="c_punctuation">()</span>
@ -113,7 +113,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Simple-upgrade-class.html#ostree-sysroot-upgrader-pull-one-dir" title="ostree_sysroot_upgrader_pull_one_dir ()">ostree_sysroot_upgrader_pull_one_dir</a> <span class="c_punctuation">()</span>
@ -121,7 +121,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-Simple-upgrade-class.html#ostree-sysroot-upgrader-deploy" title="ostree_sysroot_upgrader_deploy ()">ostree_sysroot_upgrader_deploy</a> <span class="c_punctuation">()</span>
@ -164,8 +164,8 @@ operations.</p>
<a name="ostree-sysroot-upgrader-new"></a><h3>ostree_sysroot_upgrader_new ()</h3>
<pre class="programlisting"><a class="link" href="ostree-Simple-upgrade-class.html#OstreeSysrootUpgrader" title="OstreeSysrootUpgrader"><span class="returnvalue">OstreeSysrootUpgrader</span></a> *
ostree_sysroot_upgrader_new (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *sysroot</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<div class="refsect3">
<a name="ostree-sysroot-upgrader-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
@ -193,8 +193,8 @@ ostree_sysroot_upgrader_new (<em class="parameter"><code><a class="link" href="o
<pre class="programlisting"><a class="link" href="ostree-Simple-upgrade-class.html#OstreeSysrootUpgrader" title="OstreeSysrootUpgrader"><span class="returnvalue">OstreeSysrootUpgrader</span></a> *
ostree_sysroot_upgrader_new_for_os (<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *sysroot</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *osname</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<div class="refsect3">
<a name="ostree-sysroot-upgrader-new-for-os.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
@ -231,8 +231,8 @@ ostree_sysroot_upgrader_new_for_os_with_flags
(<em class="parameter"><code><a class="link" href="ostree-Root-partition-mount-point.html#OstreeSysroot" title="OstreeSysroot"><span class="type">OstreeSysroot</span></a> *sysroot</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *osname</code></em>,
<em class="parameter"><code><a class="link" href="ostree-Simple-upgrade-class.html#OstreeSysrootUpgraderFlags" title="enum OstreeSysrootUpgraderFlags"><span class="type">OstreeSysrootUpgraderFlags</span></a> flags</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<div class="refsect3">
<a name="ostree-sysroot-upgrader-new-for-os-with-flags.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
@ -269,7 +269,7 @@ ostree_sysroot_upgrader_new_for_os_with_flags
<hr>
<div class="refsect2">
<a name="ostree-sysroot-upgrader-get-origin"></a><h3>ostree_sysroot_upgrader_get_origin ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Key-value-file-parser.html#GKeyFile"><span class="returnvalue">GKeyFile</span></a> *
<pre class="programlisting"><span class="returnvalue">GKeyFile</span> *
ostree_sysroot_upgrader_get_origin (<em class="parameter"><code><a class="link" href="ostree-Simple-upgrade-class.html#OstreeSysrootUpgrader" title="OstreeSysrootUpgrader"><span class="type">OstreeSysrootUpgrader</span></a> *self</code></em>);</pre>
<div class="refsect3">
<a name="ostree-sysroot-upgrader-get-origin.parameters"></a><h4>Parameters</h4>
@ -288,14 +288,14 @@ ostree_sysroot_upgrader_get_origin (<em class="parameter"><code><a class="link"
</div>
<div class="refsect3">
<a name="ostree-sysroot-upgrader-get-origin.returns"></a><h4>Returns</h4>
<p> The origin file, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if unknown. </p>
<p> The origin file, or <code class="literal">NULL</code> if unknown. </p>
<p><span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-upgrader-dup-origin"></a><h3>ostree_sysroot_upgrader_dup_origin ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Key-value-file-parser.html#GKeyFile"><span class="returnvalue">GKeyFile</span></a> *
<pre class="programlisting"><span class="returnvalue">GKeyFile</span> *
ostree_sysroot_upgrader_dup_origin (<em class="parameter"><code><a class="link" href="ostree-Simple-upgrade-class.html#OstreeSysrootUpgrader" title="OstreeSysrootUpgrader"><span class="type">OstreeSysrootUpgrader</span></a> *self</code></em>);</pre>
<div class="refsect3">
<a name="ostree-sysroot-upgrader-dup-origin.parameters"></a><h4>Parameters</h4>
@ -314,18 +314,18 @@ ostree_sysroot_upgrader_dup_origin (<em class="parameter"><code><a class="link"
</div>
<div class="refsect3">
<a name="ostree-sysroot-upgrader-dup-origin.returns"></a><h4>Returns</h4>
<p> A copy of the origin file, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if unknown. </p>
<p> A copy of the origin file, or <code class="literal">NULL</code> if unknown. </p>
<p><span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-upgrader-set-origin"></a><h3>ostree_sysroot_upgrader_set_origin ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_upgrader_set_origin (<em class="parameter"><code><a class="link" href="ostree-Simple-upgrade-class.html#OstreeSysrootUpgrader" title="OstreeSysrootUpgrader"><span class="type">OstreeSysrootUpgrader</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Key-value-file-parser.html#GKeyFile"><span class="type">GKeyFile</span></a> *origin</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GKeyFile</span> *origin</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Replace the origin with <em class="parameter"><code>origin</code></em>
.</p>
<div class="refsect3">
@ -384,18 +384,18 @@ ostree_sysroot_upgrader_get_origin_description
</div>
<div class="refsect3">
<a name="ostree-sysroot-upgrader-get-origin-description.returns"></a><h4>Returns</h4>
<p> A one-line descriptive summary of the origin, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if unknown</p>
<p> A one-line descriptive summary of the origin, or <code class="literal">NULL</code> if unknown</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-upgrader-check-timestamps"></a><h3>ostree_sysroot_upgrader_check_timestamps ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_upgrader_check_timestamps
(<em class="parameter"><code><a class="link" href="ostree-Content-addressed-object-store.html#OstreeRepo" title="OstreeRepo"><span class="type">OstreeRepo</span></a> *repo</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *from_rev</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *to_rev</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Check that the timestamp on <em class="parameter"><code>to_rev</code></em>
is equal to or newer than
<em class="parameter"><code>from_rev</code></em>
@ -437,21 +437,21 @@ attackers which provide a client with an older commit.</p>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-upgrader-pull"></a><h3>ostree_sysroot_upgrader_pull ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_upgrader_pull (<em class="parameter"><code><a class="link" href="ostree-Simple-upgrade-class.html#OstreeSysrootUpgrader" title="OstreeSysrootUpgrader"><span class="type">OstreeSysrootUpgrader</span></a> *self</code></em>,
<em class="parameter"><code><a class="link" href="ostree-Content-addressed-object-store.html#OstreeRepoPullFlags" title="enum OstreeRepoPullFlags"><span class="type">OstreeRepoPullFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="ostree-Simple-upgrade-class.html#OstreeSysrootUpgraderPullFlags" title="enum OstreeSysrootUpgraderPullFlags"><span class="type">OstreeSysrootUpgraderPullFlags</span></a> upgrader_flags</code></em>,
<em class="parameter"><code><a class="link" href="ostree-Progress-notification-system-for-asynchronous-operations.html#OstreeAsyncProgress" title="OstreeAsyncProgress"><span class="type">OstreeAsyncProgress</span></a> *progress</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> *out_changed</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">gboolean</span> *out_changed</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Perform a pull from the origin. First check if the ref has
changed, if so download the linked objects, and store the updated
ref locally. Then <em class="parameter"><code>out_changed</code></em>
will be <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p>
will be <code class="literal">TRUE</code>.</p>
<p>If the origin remote is unchanged, <em class="parameter"><code>out_changed</code></em>
will be set to
<a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</p>
<code class="literal">FALSE</code>.</p>
<div class="refsect3">
<a name="ostree-sysroot-upgrader-pull.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
@ -503,15 +503,15 @@ ref locally. Then <em class="parameter"><code>out_changed</code></em>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-upgrader-pull-one-dir"></a><h3>ostree_sysroot_upgrader_pull_one_dir ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_upgrader_pull_one_dir (<em class="parameter"><code><a class="link" href="ostree-Simple-upgrade-class.html#OstreeSysrootUpgrader" title="OstreeSysrootUpgrader"><span class="type">OstreeSysrootUpgrader</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *dir_to_pull</code></em>,
<em class="parameter"><code><a class="link" href="ostree-Content-addressed-object-store.html#OstreeRepoPullFlags" title="enum OstreeRepoPullFlags"><span class="type">OstreeRepoPullFlags</span></a> flags</code></em>,
<em class="parameter"><code><a class="link" href="ostree-Simple-upgrade-class.html#OstreeSysrootUpgraderPullFlags" title="enum OstreeSysrootUpgraderPullFlags"><span class="type">OstreeSysrootUpgraderPullFlags</span></a> upgrader_flags</code></em>,
<em class="parameter"><code><a class="link" href="ostree-Progress-notification-system-for-asynchronous-operations.html#OstreeAsyncProgress" title="OstreeAsyncProgress"><span class="type">OstreeAsyncProgress</span></a> *progress</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> *out_changed</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">gboolean</span> *out_changed</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Like <a class="link" href="ostree-Simple-upgrade-class.html#ostree-sysroot-upgrader-pull" title="ostree_sysroot_upgrader_pull ()"><code class="function">ostree_sysroot_upgrader_pull()</code></a>, but allows retrieving just a
subpath of the tree. This can be used to download metadata files
from inside the tree such as package databases.</p>
@ -519,10 +519,10 @@ from inside the tree such as package databases.</p>
<hr>
<div class="refsect2">
<a name="ostree-sysroot-upgrader-deploy"></a><h3>ostree_sysroot_upgrader_deploy ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_sysroot_upgrader_deploy (<em class="parameter"><code><a class="link" href="ostree-Simple-upgrade-class.html#OstreeSysrootUpgrader" title="OstreeSysrootUpgrader"><span class="type">OstreeSysrootUpgrader</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Write the new deployment to disk, perform a configuration merge
with /etc, and update the bootloader configuration.</p>
<div class="refsect3">
@ -614,6 +614,11 @@ with /etc, and update the bootloader configuration.</p>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="OSTREE-SYSROOT-UPGRADER-PULL-FLAGS-SYNTHETIC:CAPS"></a>OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_SYNTHETIC</p></td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table></div>
</div>

View File

@ -57,7 +57,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-ostree-bootconfig-parser.html#ostree-bootconfig-parser-parse" title="ostree_bootconfig_parser_parse ()">ostree_bootconfig_parser_parse</a> <span class="c_punctuation">()</span>
@ -65,7 +65,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-ostree-bootconfig-parser.html#ostree-bootconfig-parser-parse-at" title="ostree_bootconfig_parser_parse_at ()">ostree_bootconfig_parser_parse_at</a> <span class="c_punctuation">()</span>
@ -73,7 +73,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-ostree-bootconfig-parser.html#ostree-bootconfig-parser-write" title="ostree_bootconfig_parser_write ()">ostree_bootconfig_parser_write</a> <span class="c_punctuation">()</span>
@ -81,7 +81,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-ostree-bootconfig-parser.html#ostree-bootconfig-parser-write-at" title="ostree_bootconfig_parser_write_at ()">ostree_bootconfig_parser_write_at</a> <span class="c_punctuation">()</span>
@ -158,21 +158,21 @@ ostree_bootconfig_parser_clone (<em class="parameter"><code><a class="link" href
<hr>
<div class="refsect2">
<a name="ostree-bootconfig-parser-parse"></a><h3>ostree_bootconfig_parser_parse ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_bootconfig_parser_parse (<em class="parameter"><code><a class="link" href="ostree-ostree-bootconfig-parser.html#OstreeBootconfigParser" title="OstreeBootconfigParser"><span class="type">OstreeBootconfigParser</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="type">GFile</span></a> *path</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GFile</span> *path</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="ostree-bootconfig-parser-parse-at"></a><h3>ostree_bootconfig_parser_parse_at ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_bootconfig_parser_parse_at (<em class="parameter"><code><a class="link" href="ostree-ostree-bootconfig-parser.html#OstreeBootconfigParser" title="OstreeBootconfigParser"><span class="type">OstreeBootconfigParser</span></a> *self</code></em>,
<em class="parameter"><code><span class="type">int</span> dfd</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Initialize a bootconfig from the given file.</p>
<div class="refsect3">
<a name="ostree-bootconfig-parser-parse-at.parameters"></a><h4>Parameters</h4>
@ -215,21 +215,21 @@ ostree_bootconfig_parser_parse_at (<em class="parameter"><code><a class="link" h
<hr>
<div class="refsect2">
<a name="ostree-bootconfig-parser-write"></a><h3>ostree_bootconfig_parser_write ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_bootconfig_parser_write (<em class="parameter"><code><a class="link" href="ostree-ostree-bootconfig-parser.html#OstreeBootconfigParser" title="OstreeBootconfigParser"><span class="type">OstreeBootconfigParser</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="type">GFile</span></a> *output</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GFile</span> *output</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="ostree-bootconfig-parser-write-at"></a><h3>ostree_bootconfig_parser_write_at ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_bootconfig_parser_write_at (<em class="parameter"><code><a class="link" href="ostree-ostree-bootconfig-parser.html#OstreeBootconfigParser" title="OstreeBootconfigParser"><span class="type">OstreeBootconfigParser</span></a> *self</code></em>,
<em class="parameter"><code><span class="type">int</span> dfd</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
</div>
<hr>
<div class="refsect2">

View File

@ -69,7 +69,7 @@
<div class="refsect2">
<a name="ostree-chain-input-stream-new"></a><h3>ostree_chain_input_stream_new ()</h3>
<pre class="programlisting"><a class="link" href="ostree-ostree-chain-input-stream.html#OstreeChainInputStream" title="struct OstreeChainInputStream"><span class="returnvalue">OstreeChainInputStream</span></a> *
ostree_chain_input_stream_new (<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> *streams</code></em>);</pre>
ostree_chain_input_stream_new (<em class="parameter"><code><span class="type">GPtrArray</span> *streams</code></em>);</pre>
</div>
</div>
<div class="refsect1">

View File

@ -69,8 +69,8 @@
<div class="refsect2">
<a name="ostree-checksum-input-stream-new"></a><h3>ostree_checksum_input_stream_new ()</h3>
<pre class="programlisting"><a class="link" href="ostree-ostree-checksum-input-stream.html#OstreeChecksumInputStream" title="struct OstreeChecksumInputStream"><span class="returnvalue">OstreeChecksumInputStream</span></a> *
ostree_checksum_input_stream_new (<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GInputStream.html#GInputStream-struct"><span class="type">GInputStream</span></a> *stream</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Data-Checksums.html#GChecksum"><span class="type">GChecksum</span></a> *checksum</code></em>);</pre>
ostree_checksum_input_stream_new (<em class="parameter"><code><span class="type">GInputStream</span> *stream</code></em>,
<em class="parameter"><code><span class="type">GChecksum</span> *checksum</code></em>);</pre>
</div>
</div>
<div class="refsect1">

View File

@ -41,7 +41,7 @@
<tbody>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
<span class="returnvalue">guint</span>
</td>
<td class="function_name">
<a class="link" href="ostree-ostree-deployment.html#ostree-deployment-hash" title="ostree_deployment_hash ()">ostree_deployment_hash</a> <span class="c_punctuation">()</span>
@ -49,7 +49,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-ostree-deployment.html#ostree-deployment-equal" title="ostree_deployment_equal ()">ostree_deployment_equal</a> <span class="c_punctuation">()</span>
@ -118,7 +118,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Key-value-file-parser.html#GKeyFile"><span class="returnvalue">GKeyFile</span></a> *
<span class="returnvalue">GKeyFile</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-ostree-deployment.html#ostree-deployment-get-origin" title="ostree_deployment_get_origin ()">ostree_deployment_get_origin</a> <span class="c_punctuation">()</span>
@ -210,15 +210,15 @@
<a name="ostree-ostree-deployment.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="ostree-deployment-hash"></a><h3>ostree_deployment_hash ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
ostree_deployment_hash (<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> v</code></em>);</pre>
<pre class="programlisting"><span class="returnvalue">guint</span>
ostree_deployment_hash (<em class="parameter"><code><span class="type">gconstpointer</span> v</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="ostree-deployment-equal"></a><h3>ostree_deployment_equal ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
ostree_deployment_equal (<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> ap</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> bp</code></em>);</pre>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_deployment_equal (<em class="parameter"><code><span class="type">gconstpointer</span> ap</code></em>,
<em class="parameter"><code><span class="type">gconstpointer</span> bp</code></em>);</pre>
<div class="refsect3">
<a name="ostree-deployment-equal.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
@ -243,7 +243,7 @@ ostree_deployment_equal (<em class="parameter"><code><a href="https://developer.
</div>
<div class="refsect3">
<a name="ostree-deployment-equal.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if deployments have the same osname, csum, and deployserial</p>
<p> <code class="literal">TRUE</code> if deployments have the same osname, csum, and deployserial</p>
</div>
</div>
<hr>
@ -322,7 +322,7 @@ ostree_deployment_get_bootconfig (<em class="parameter"><code><a class="link" hr
<hr>
<div class="refsect2">
<a name="ostree-deployment-get-origin"></a><h3>ostree_deployment_get_origin ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Key-value-file-parser.html#GKeyFile"><span class="returnvalue">GKeyFile</span></a> *
<pre class="programlisting"><span class="returnvalue">GKeyFile</span> *
ostree_deployment_get_origin (<em class="parameter"><code><a class="link" href="ostree-ostree-deployment.html#OstreeDeployment" title="OstreeDeployment"><span class="type">OstreeDeployment</span></a> *self</code></em>);</pre>
<div class="refsect3">
<a name="ostree-deployment-get-origin.parameters"></a><h4>Parameters</h4>
@ -406,7 +406,7 @@ ostree_deployment_set_bootconfig (<em class="parameter"><code><a class="link" hr
<a name="ostree-deployment-set-origin"></a><h3>ostree_deployment_set_origin ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
ostree_deployment_set_origin (<em class="parameter"><code><a class="link" href="ostree-ostree-deployment.html#OstreeDeployment" title="OstreeDeployment"><span class="type">OstreeDeployment</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Key-value-file-parser.html#GKeyFile"><span class="type">GKeyFile</span></a> *origin</code></em>);</pre>
<em class="parameter"><code><span class="type">GKeyFile</span> *origin</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
@ -506,7 +506,7 @@ ostree_deployment_unlocked_state_to_string
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a href="https://developer.gnome.org/glib/unstable/glib-Key-value-file-parser.html#GKeyFile"><span class="type">GKeyFile</span></a> *<em class="structfield"><code><a name="OstreeDeployment.origin"></a>origin</code></em>;</p></td>
<td class="struct_member_name"><p><span class="type">GKeyFile</span> *<em class="structfield"><code><a name="OstreeDeployment.origin"></a>origin</code></em>;</p></td>
<td class="struct_member_description"><p>How to construct an upgraded version of this tree</p></td>
<td class="struct_member_annotations"> </td>
</tr>

View File

@ -57,7 +57,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-ostree-diff.html#ostree-diff-dirs" title="ostree_diff_dirs ()">ostree_diff_dirs</a> <span class="c_punctuation">()</span>
@ -112,15 +112,15 @@ ostree_diff_item_unref (<em class="parameter"><code><a class="link" href="ostree
<hr>
<div class="refsect2">
<a name="ostree-diff-dirs"></a><h3>ostree_diff_dirs ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_diff_dirs (<em class="parameter"><code><a class="link" href="ostree-ostree-diff.html#OstreeDiffFlags" title="enum OstreeDiffFlags"><span class="type">OstreeDiffFlags</span></a> flags</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="type">GFile</span></a> *a</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="type">GFile</span></a> *b</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> *modified</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> *removed</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> *added</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GFile</span> *a</code></em>,
<em class="parameter"><code><span class="type">GFile</span> *b</code></em>,
<em class="parameter"><code><span class="type">GPtrArray</span> *modified</code></em>,
<em class="parameter"><code><span class="type">GPtrArray</span> *removed</code></em>,
<em class="parameter"><code><span class="type">GPtrArray</span> *added</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Compute the difference between directory <em class="parameter"><code>a</code></em>
and <em class="parameter"><code>b</code></em>
as 3 separate
@ -144,7 +144,7 @@ sets of <a class="link" href="ostree-ostree-diff.html#OstreeDiffItem" title="str
</tr>
<tr>
<td class="parameter_name"><p>a</p></td>
<td class="parameter_description"><p>First directory path, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
<td class="parameter_description"><p>First directory path, or <code class="literal">NULL</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
@ -185,11 +185,11 @@ sets of <a class="link" href="ostree-ostree-diff.html#OstreeDiffItem" title="str
<div class="refsect2">
<a name="ostree-diff-print"></a><h3>ostree_diff_print ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
ostree_diff_print (<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="type">GFile</span></a> *a</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFile-struct"><span class="type">GFile</span></a> *b</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> *modified</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> *removed</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Pointer-Arrays.html#GPtrArray"><span class="type">GPtrArray</span></a> *added</code></em>);</pre>
ostree_diff_print (<em class="parameter"><code><span class="type">GFile</span> *a</code></em>,
<em class="parameter"><code><span class="type">GFile</span> *b</code></em>,
<em class="parameter"><code><span class="type">GPtrArray</span> *modified</code></em>,
<em class="parameter"><code><span class="type">GPtrArray</span> *removed</code></em>,
<em class="parameter"><code><span class="type">GPtrArray</span> *added</code></em>);</pre>
<p>Print the contents of a diff to stdout.</p>
<div class="refsect3">
<a name="ostree-diff-print.parameters"></a><h4>Parameters</h4>

View File

@ -40,7 +40,7 @@
<tbody>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-ostree-repo-file.html#ostree-repo-file-ensure-resolved" title="ostree_repo_file_ensure_resolved ()">ostree_repo_file_ensure_resolved</a> <span class="c_punctuation">()</span>
@ -48,7 +48,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-ostree-repo-file.html#ostree-repo-file-get-xattrs" title="ostree_repo_file_get_xattrs ()">ostree_repo_file_get_xattrs</a> <span class="c_punctuation">()</span>
@ -94,7 +94,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
<span class="returnvalue">GVariant</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-ostree-repo-file.html#ostree-repo-file-tree-get-contents" title="ostree_repo_file_tree_get_contents ()">ostree_repo_file_tree_get_contents</a> <span class="c_punctuation">()</span>
@ -102,7 +102,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
<span class="returnvalue">GVariant</span> *
</td>
<td class="function_name">
<a class="link" href="ostree-ostree-repo-file.html#ostree-repo-file-tree-get-metadata" title="ostree_repo_file_tree_get_metadata ()">ostree_repo_file_tree_get_metadata</a> <span class="c_punctuation">()</span>
@ -125,7 +125,7 @@
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="ostree-ostree-repo-file.html#ostree-repo-file-tree-query-child" title="ostree_repo_file_tree_query_child ()">ostree_repo_file_tree_query_child</a> <span class="c_punctuation">()</span>
@ -154,18 +154,18 @@
<a name="ostree-ostree-repo-file.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="ostree-repo-file-ensure-resolved"></a><h3>ostree_repo_file_ensure_resolved ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_repo_file_ensure_resolved (<em class="parameter"><code><a class="link" href="ostree-ostree-repo-file.html#OstreeRepoFile" title="OstreeRepoFile"><span class="type">OstreeRepoFile</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="ostree-repo-file-get-xattrs"></a><h3>ostree_repo_file_get_xattrs ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_repo_file_get_xattrs (<em class="parameter"><code><a class="link" href="ostree-ostree-repo-file.html#OstreeRepoFile" title="OstreeRepoFile"><span class="type">OstreeRepoFile</span></a> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> **out_xattrs</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GVariant</span> **out_xattrs</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
@ -195,7 +195,7 @@ ostree_repo_file_get_root (<em class="parameter"><code><a class="link" href="ost
<pre class="programlisting"><span class="returnvalue">void</span>
ostree_repo_file_tree_set_metadata (<em class="parameter"><code><a class="link" href="ostree-ostree-repo-file.html#OstreeRepoFile" title="OstreeRepoFile"><span class="type">OstreeRepoFile</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *checksum</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *metadata</code></em>);</pre>
<em class="parameter"><code><span class="type">GVariant</span> *metadata</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
@ -214,13 +214,13 @@ ostree_repo_file_tree_get_metadata_checksum
<hr>
<div class="refsect2">
<a name="ostree-repo-file-tree-get-contents"></a><h3>ostree_repo_file_tree_get_contents ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
<pre class="programlisting"><span class="returnvalue">GVariant</span> *
ostree_repo_file_tree_get_contents (<em class="parameter"><code><a class="link" href="ostree-ostree-repo-file.html#OstreeRepoFile" title="OstreeRepoFile"><span class="type">OstreeRepoFile</span></a> *self</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="ostree-repo-file-tree-get-metadata"></a><h3>ostree_repo_file_tree_get_metadata ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="returnvalue">GVariant</span></a> *
<pre class="programlisting"><span class="returnvalue">GVariant</span> *
ostree_repo_file_tree_get_metadata (<em class="parameter"><code><a class="link" href="ostree-ostree-repo-file.html#OstreeRepoFile" title="OstreeRepoFile"><span class="type">OstreeRepoFile</span></a> *self</code></em>);</pre>
</div>
<hr>
@ -235,20 +235,20 @@ ostree_repo_file_get_checksum (<em class="parameter"><code><a class="link" href=
<pre class="programlisting"><span class="returnvalue">int</span>
ostree_repo_file_tree_find_child (<em class="parameter"><code><a class="link" href="ostree-ostree-repo-file.html#OstreeRepoFile" title="OstreeRepoFile"><span class="type">OstreeRepoFile</span></a> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> *is_dir</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> **out_container</code></em>);</pre>
<em class="parameter"><code><span class="type">gboolean</span> *is_dir</code></em>,
<em class="parameter"><code><span class="type">GVariant</span> **out_container</code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="ostree-repo-file-tree-query-child"></a><h3>ostree_repo_file_tree_query_child ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
ostree_repo_file_tree_query_child (<em class="parameter"><code><a class="link" href="ostree-ostree-repo-file.html#OstreeRepoFile" title="OstreeRepoFile"><span class="type">OstreeRepoFile</span></a> *self</code></em>,
<em class="parameter"><code><span class="type">int</span> n</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *attributes</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GFile.html#GFileQueryInfoFlags"><span class="type">GFileQueryInfoFlags</span></a> flags</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GFileInfo.html#GFileInfo-struct"><span class="type">GFileInfo</span></a> **out_info</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/gio/unstable/GCancellable.html#GCancellable-struct"><span class="type">GCancellable</span></a> *cancellable</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<em class="parameter"><code><span class="type">GFileQueryInfoFlags</span> flags</code></em>,
<em class="parameter"><code><span class="type">GFileInfo</span> **out_info</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
</div>
</div>
<div class="refsect1">

View File

@ -49,6 +49,7 @@
<keyword type="function" name="ostree_content_file_parse ()" link="ostree-Core-repository-independent-functions.html#ostree-content-file-parse"/>
<keyword type="function" name="ostree_content_file_parse_at ()" link="ostree-Core-repository-independent-functions.html#ostree-content-file-parse-at"/>
<keyword type="function" name="ostree_raw_file_to_archive_z2_stream ()" link="ostree-Core-repository-independent-functions.html#ostree-raw-file-to-archive-z2-stream"/>
<keyword type="function" name="ostree_raw_file_to_archive_z2_stream_with_options ()" link="ostree-Core-repository-independent-functions.html#ostree-raw-file-to-archive-z2-stream-with-options" since="2017.3"/>
<keyword type="function" name="ostree_raw_file_to_content_stream ()" link="ostree-Core-repository-independent-functions.html#ostree-raw-file-to-content-stream"/>
<keyword type="function" name="ostree_checksum_file_from_input ()" link="ostree-Core-repository-independent-functions.html#ostree-checksum-file-from-input"/>
<keyword type="function" name="ostree_checksum_file ()" link="ostree-Core-repository-independent-functions.html#ostree-checksum-file"/>
@ -104,6 +105,7 @@
<keyword type="function" name="ostree_repo_remote_gpg_import ()" link="ostree-Content-addressed-object-store.html#ostree-repo-remote-gpg-import"/>
<keyword type="function" name="ostree_repo_remote_fetch_summary ()" link="ostree-Content-addressed-object-store.html#ostree-repo-remote-fetch-summary"/>
<keyword type="function" name="ostree_repo_remote_fetch_summary_with_options ()" link="ostree-Content-addressed-object-store.html#ostree-repo-remote-fetch-summary-with-options"/>
<keyword type="function" name="ostree_repo_reload_config ()" link="ostree-Content-addressed-object-store.html#ostree-repo-reload-config"/>
<keyword type="function" name="ostree_repo_get_remote_boolean_option ()" link="ostree-Content-addressed-object-store.html#ostree-repo-get-remote-boolean-option"/>
<keyword type="function" name="ostree_repo_get_remote_list_option ()" link="ostree-Content-addressed-object-store.html#ostree-repo-get-remote-list-option"/>
<keyword type="function" name="ostree_repo_get_remote_option ()" link="ostree-Content-addressed-object-store.html#ostree-repo-get-remote-option"/>
@ -381,6 +383,7 @@
<keyword type="constant" name="OSTREE_REPO_CHECKOUT_MODE_USER" link="ostree-Content-addressed-object-store.html#OSTREE-REPO-CHECKOUT-MODE-USER:CAPS"/>
<keyword type="constant" name="OSTREE_REPO_CHECKOUT_OVERWRITE_NONE" link="ostree-Content-addressed-object-store.html#OSTREE-REPO-CHECKOUT-OVERWRITE-NONE:CAPS"/>
<keyword type="constant" name="OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES" link="ostree-Content-addressed-object-store.html#OSTREE-REPO-CHECKOUT-OVERWRITE-UNION-FILES:CAPS"/>
<keyword type="constant" name="OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES" link="ostree-Content-addressed-object-store.html#OSTREE-REPO-CHECKOUT-OVERWRITE-ADD-FILES:CAPS"/>
<keyword type="constant" name="OSTREE_REPO_LIST_OBJECTS_LOOSE" link="ostree-Content-addressed-object-store.html#OSTREE-REPO-LIST-OBJECTS-LOOSE:CAPS"/>
<keyword type="constant" name="OSTREE_REPO_LIST_OBJECTS_PACKED" link="ostree-Content-addressed-object-store.html#OSTREE-REPO-LIST-OBJECTS-PACKED:CAPS"/>
<keyword type="constant" name="OSTREE_REPO_LIST_OBJECTS_ALL" link="ostree-Content-addressed-object-store.html#OSTREE-REPO-LIST-OBJECTS-ALL:CAPS"/>
@ -405,6 +408,7 @@
<keyword type="constant" name="OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED" link="ostree-Simple-upgrade-class.html#OSTREE-SYSROOT-UPGRADER-FLAGS-IGNORE-UNCONFIGURED:CAPS"/>
<keyword type="constant" name="OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_NONE" link="ostree-Simple-upgrade-class.html#OSTREE-SYSROOT-UPGRADER-PULL-FLAGS-NONE:CAPS"/>
<keyword type="constant" name="OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_ALLOW_OLDER" link="ostree-Simple-upgrade-class.html#OSTREE-SYSROOT-UPGRADER-PULL-FLAGS-ALLOW-OLDER:CAPS"/>
<keyword type="constant" name="OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_SYNTHETIC" link="ostree-Simple-upgrade-class.html#OSTREE-SYSROOT-UPGRADER-PULL-FLAGS-SYNTHETIC:CAPS"/>
<keyword type="constant" name="OSTREE_GPG_SIGNATURE_ATTR_VALID" link="ostree-GPG-signature-verification-results.html#OSTREE-GPG-SIGNATURE-ATTR-VALID:CAPS"/>
<keyword type="constant" name="OSTREE_GPG_SIGNATURE_ATTR_SIG_EXPIRED" link="ostree-GPG-signature-verification-results.html#OSTREE-GPG-SIGNATURE-ATTR-SIG-EXPIRED:CAPS"/>
<keyword type="constant" name="OSTREE_GPG_SIGNATURE_ATTR_KEY_EXPIRED" link="ostree-GPG-signature-verification-results.html#OSTREE-GPG-SIGNATURE-ATTR-KEY-EXPIRED:CAPS"/>

View File

@ -554,6 +554,10 @@
</dt>
<dd></dd>
<dt>
<a class="link" href="ostree-Core-repository-independent-functions.html#ostree-raw-file-to-archive-z2-stream-with-options" title="ostree_raw_file_to_archive_z2_stream_with_options ()">ostree_raw_file_to_archive_z2_stream_with_options</a>, function in <a class="link" href="ostree-Core-repository-independent-functions.html" title="Core repository-independent functions">Core repository-independent functions</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="ostree-Core-repository-independent-functions.html#ostree-raw-file-to-content-stream" title="ostree_raw_file_to_content_stream ()">ostree_raw_file_to_content_stream</a>, function in <a class="link" href="ostree-Core-repository-independent-functions.html" title="Core repository-independent functions">Core repository-independent functions</a>
</dt>
<dd></dd>
@ -958,6 +962,10 @@
</dt>
<dd></dd>
<dt>
<a class="link" href="ostree-Content-addressed-object-store.html#ostree-repo-reload-config" title="ostree_repo_reload_config ()">ostree_repo_reload_config</a>, function in <a class="link" href="ostree-Content-addressed-object-store.html" title="Content-addressed object store">Content-addressed object store</a>
</dt>
<dd></dd>
<dt>
<a class="link" href="ostree-Content-addressed-object-store.html#ostree-repo-remote-add" title="ostree_repo_remote_add ()">ostree_repo_remote_add</a>, function in <a class="link" href="ostree-Content-addressed-object-store.html" title="Content-addressed object store">Content-addressed object store</a>
</dt>
<dd></dd>

View File

@ -117,6 +117,7 @@ ostree_content_stream_parse
ostree_content_file_parse
ostree_content_file_parse_at
ostree_raw_file_to_archive_z2_stream
ostree_raw_file_to_archive_z2_stream_with_options
ostree_raw_file_to_content_stream
ostree_checksum_file_from_input
ostree_checksum_file
@ -276,6 +277,7 @@ ostree_repo_remote_get_gpg_verify_summary
ostree_repo_remote_gpg_import
ostree_repo_remote_fetch_summary
ostree_repo_remote_fetch_summary_with_options
ostree_repo_reload_config
ostree_repo_get_remote_boolean_option
ostree_repo_get_remote_list_option
ostree_repo_get_remote_option

View File

@ -1 +1 @@
2016.15
2017.3

View File

@ -28,6 +28,12 @@
/* Define if we have libarchive.pc */
#undef HAVE_LIBARCHIVE
/* Define if we have libcurl.pc */
#undef HAVE_LIBCURL
/* Define if we have soup or curl */
#undef HAVE_LIBCURL_OR_LIBSOUP
/* Define if we have libmount.pc */
#undef HAVE_LIBMOUNT
@ -43,6 +49,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `mnt_unref_cache' function. */
#undef HAVE_MNT_UNREF_CACHE
/* Define if we have libselinux.pc */
#undef HAVE_SELINUX
@ -116,6 +125,9 @@
#endif
/* Define if we have smack.pc */
#undef WITH_SMACK
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1

430
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for ostree 2017.1.
# Generated by GNU Autoconf 2.69 for libostree 2017.3.
#
# Report bugs to <walters@verbum.org>.
#
@ -588,10 +588,10 @@ MFLAGS=
MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ostree'
PACKAGE_TARNAME='ostree'
PACKAGE_VERSION='2017.1'
PACKAGE_STRING='ostree 2017.1'
PACKAGE_NAME='libostree'
PACKAGE_TARNAME='libostree'
PACKAGE_VERSION='2017.3'
PACKAGE_STRING='libostree 2017.3'
PACKAGE_BUGREPORT='walters@verbum.org'
PACKAGE_URL=''
@ -665,6 +665,8 @@ USE_LIBMOUNT_FALSE
USE_LIBMOUNT_TRUE
OT_DEP_LIBMOUNT_LIBS
OT_DEP_LIBMOUNT_CFLAGS
USE_SMACK_FALSE
USE_SMACK_TRUE
USE_SELINUX_FALSE
USE_SELINUX_TRUE
OT_DEP_SELINUX_LIBS
@ -673,6 +675,13 @@ USE_LIBARCHIVE_FALSE
USE_LIBARCHIVE_TRUE
OT_DEP_LIBARCHIVE_LIBS
OT_DEP_LIBARCHIVE_CFLAGS
ENABLE_RUST_FALSE
ENABLE_RUST_TRUE
RUST_DEBUG_FALSE
RUST_DEBUG_TRUE
RUST_TARGET_SUBDIR
rustc
cargo
ENABLE_MAN_FALSE
ENABLE_MAN_TRUE
XSLTPROC
@ -712,12 +721,18 @@ INTROSPECTION_GIRDIR
INTROSPECTION_GENERATE
INTROSPECTION_COMPILER
INTROSPECTION_SCANNER
USE_CURL_OR_SOUP_FALSE
USE_CURL_OR_SOUP_TRUE
HAVE_LIBSOUP_CLIENT_CERTS_FALSE
HAVE_LIBSOUP_CLIENT_CERTS_TRUE
USE_LIBSOUP_FALSE
USE_LIBSOUP_TRUE
OT_DEP_SOUP_LIBS
OT_DEP_SOUP_CFLAGS
USE_CURL_FALSE
USE_CURL_TRUE
OT_DEP_CURL_LIBS
OT_DEP_CURL_CFLAGS
OT_DEP_E2P_LIBS
OT_DEP_E2P_CFLAGS
OT_DEP_ZLIB_LIBS
@ -883,6 +898,7 @@ enable_always_build_tests
enable_otmpfile
enable_wrpseudo_compat
enable_glibtest
with_curl
with_soup
enable_libsoup_client_certs
enable_introspection
@ -892,8 +908,11 @@ enable_gtk_doc
enable_gtk_doc_html
enable_gtk_doc_pdf
enable_man
enable_rust
enable_rust_debug
with_libarchive
with_selinux
with_smack
with_libmount
enable_rofiles_fuse
with_dracut
@ -926,6 +945,8 @@ OT_DEP_ZLIB_CFLAGS
OT_DEP_ZLIB_LIBS
OT_DEP_E2P_CFLAGS
OT_DEP_E2P_LIBS
OT_DEP_CURL_CFLAGS
OT_DEP_CURL_LIBS
OT_DEP_SOUP_CFLAGS
OT_DEP_SOUP_LIBS
OT_DEP_GPGME_CFLAGS
@ -1482,7 +1503,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures ostree 2017.1 to adapt to many kinds of systems.
\`configure' configures libostree 2017.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1530,7 +1551,7 @@ Fine tuning of the installation directories:
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/ostree]
--docdir=DIR documentation root [DATAROOTDIR/doc/libostree]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
@ -1552,7 +1573,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of ostree 2017.1:";;
short | recursive ) echo "Configuration of libostree 2017.3:";;
esac
cat <<\_ACEOF
@ -1593,6 +1614,9 @@ Optional Features:
--enable-gtk-doc-html build documentation in html format [[default=yes]]
--enable-gtk-doc-pdf build documentation in pdf format [[default=no]]
--enable-man generate man pages [default=auto]
--enable-rust Compile Rust code instead of C [default=no]
--enable-rust-debug Build Rust code with debugging information
[default=no]
--enable-rofiles-fuse generate rofiles-fuse helper [default=yes]
Optional Packages:
@ -1606,11 +1630,13 @@ Optional Packages:
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot[=DIR] Search for dependent libraries within DIR (or the
compiler's sysroot if not specified).
--with-curl Use libcurl [default=no]
--with-soup Use libsoup [default=yes]
--with-gpgme-prefix=PFX prefix where GPGME is installed (optional)
--with-html-dir=PATH path to installed docs
--without-libarchive Do not use libarchive
--without-selinux Do not use SELinux
--with-smack Enable smack
--without-libmount Do not use libmount
--with-dracut Install dracut module (default: no)
--with-mkinitcpio Install mkinitcpio module (default: no)
@ -1662,6 +1688,10 @@ Some influential environment variables:
C compiler flags for OT_DEP_E2P, overriding pkg-config
OT_DEP_E2P_LIBS
linker flags for OT_DEP_E2P, overriding pkg-config
OT_DEP_CURL_CFLAGS
C compiler flags for OT_DEP_CURL, overriding pkg-config
OT_DEP_CURL_LIBS
linker flags for OT_DEP_CURL, overriding pkg-config
OT_DEP_SOUP_CFLAGS
C compiler flags for OT_DEP_SOUP, overriding pkg-config
OT_DEP_SOUP_LIBS
@ -1761,7 +1791,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
ostree configure 2017.1
libostree configure 2017.3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -2176,7 +2206,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by ostree $as_me 2017.1, which was
It was created by libostree $as_me 2017.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -3042,8 +3072,8 @@ fi
# Define the identity of the package.
PACKAGE='ostree'
VERSION='2017.1'
PACKAGE='libostree'
VERSION='2017.3'
# Some tools Automake needs.
@ -5793,7 +5823,6 @@ test -n "$YACC" || YACC="yacc"
-Werror=incompatible-pointer-types \
-Werror=misleading-indentation \
-Werror=missing-include-dirs -Werror=aggregate-return \
-Werror=declaration-after-statement \
; do
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports flag $flag in envvar CFLAGS" >&5
@ -13562,9 +13591,9 @@ else
fi
if test "$ENABLE_INSTALLED_TESTS" == "1"; then
installed_test_metadir=${datadir}/installed-tests/ostree
installed_test_metadir=${datadir}/installed-tests/libostree
installed_testdir=${libexecdir}/installed-tests/ostree
installed_testdir=${libexecdir}/installed-tests/libostree
fi
@ -14500,13 +14529,134 @@ $as_echo "yes" >&6; }
fi
CURL_DEPENDENCY=7.29.0
# Check whether --with-curl was given.
if test "${with_curl+set}" = set; then :
withval=$with_curl;
else
with_curl=no
fi
if test x$with_curl != xno ; then :
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OT_DEP_CURL" >&5
$as_echo_n "checking for OT_DEP_CURL... " >&6; }
if test -n "$OT_DEP_CURL_CFLAGS"; then
pkg_cv_OT_DEP_CURL_CFLAGS="$OT_DEP_CURL_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl >= \$CURL_DEPENDENCY\""; } >&5
($PKG_CONFIG --exists --print-errors "libcurl >= $CURL_DEPENDENCY") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_OT_DEP_CURL_CFLAGS=`$PKG_CONFIG --cflags "libcurl >= $CURL_DEPENDENCY" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$OT_DEP_CURL_LIBS"; then
pkg_cv_OT_DEP_CURL_LIBS="$OT_DEP_CURL_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl >= \$CURL_DEPENDENCY\""; } >&5
($PKG_CONFIG --exists --print-errors "libcurl >= $CURL_DEPENDENCY") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_OT_DEP_CURL_LIBS=`$PKG_CONFIG --libs "libcurl >= $CURL_DEPENDENCY" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
OT_DEP_CURL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcurl >= $CURL_DEPENDENCY" 2>&1`
else
OT_DEP_CURL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcurl >= $CURL_DEPENDENCY" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$OT_DEP_CURL_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (libcurl >= $CURL_DEPENDENCY) were not met:
$OT_DEP_CURL_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables OT_DEP_CURL_CFLAGS
and OT_DEP_CURL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables OT_DEP_CURL_CFLAGS
and OT_DEP_CURL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details" "$LINENO" 5; }
else
OT_DEP_CURL_CFLAGS=$pkg_cv_OT_DEP_CURL_CFLAGS
OT_DEP_CURL_LIBS=$pkg_cv_OT_DEP_CURL_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
with_curl=yes
$as_echo "#define HAVE_LIBCURL 1" >>confdefs.h
with_soup_default=yes
else
with_soup_default=check
fi
if test x$with_curl != xno; then
USE_CURL_TRUE=
USE_CURL_FALSE='#'
else
USE_CURL_TRUE='#'
USE_CURL_FALSE=
fi
if test x$with_curl = xyes; then OSTREE_FEATURES="$OSTREE_FEATURES libcurl"; fi
SOUP_DEPENDENCY="libsoup-2.4 >= 2.39.1"
# Check whether --with-soup was given.
if test "${with_soup+set}" = set; then :
withval=$with_soup;
else
with_soup=check
with_soup=$with_soup_default
fi
if test x$with_soup != xno; then :
@ -14664,7 +14814,7 @@ fi
else
with_soup=no
fi
if test x$with_soup != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +libsoup"; fi
if test x$with_soup != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libsoup"; fi
if test x$with_soup != xno; then
USE_LIBSOUP_TRUE=
USE_LIBSOUP_FALSE='#'
@ -14682,6 +14832,32 @@ else
fi
if test x$with_curl = xyes && test x$with_soup = xno; then :
as_fn_error $? "Curl enabled, but libsoup is not; libsoup is needed for tests" "$LINENO" 5
fi
if test x$with_curl != xno || test x$with_soup != xno; then
USE_CURL_OR_SOUP_TRUE=
USE_CURL_OR_SOUP_FALSE='#'
else
USE_CURL_OR_SOUP_TRUE='#'
USE_CURL_OR_SOUP_FALSE=
fi
if test x$with_curl != xno || test x$with_soup != xno; then :
$as_echo "#define HAVE_LIBCURL_OR_LIBSOUP 1" >>confdefs.h
fi
if test x$with_curl = xyes; then :
fetcher_backend=curl
elif test x$with_soup = xyes; then :
fetcher_backend=libsoup
else
fetcher_backend=none
fi
@ -14720,7 +14896,7 @@ fi
test $ac_status = 0; }; then
found_introspection=yes
else
as_fn_error $? "You need to have gobject-introspection >= 1.34.0 installed to build ostree" "$LINENO" 5
as_fn_error $? "You need to have gobject-introspection >= 1.34.0 installed to build libostree" "$LINENO" 5
fi
;; #(
auto) :
@ -15129,7 +15305,7 @@ if test x$have_gpgme = xno ; then :
as_fn_error $? "Need GPGME_PTHREAD version $LIBGPGME_DEPENDENCY or later" "$LINENO" 5
fi
OSTREE_FEATURES="$OSTREE_FEATURES +gpgme"
OSTREE_FEATURES="$OSTREE_FEATURES gpgme"
LIBARCHIVE_DEPENDENCY="libarchive >= 2.8.0"
# What's in RHEL7.2.
@ -15568,9 +15744,12 @@ fi
fi
enable_man=no
fi
else
enable_man=yes
fi
fi
if test "$enable_man" != no; then
ENABLE_MAN_TRUE=
@ -15581,6 +15760,143 @@ else
fi
# Check whether --enable-rust was given.
if test "${enable_rust+set}" = set; then :
enableval=$enable_rust;
else
enable_rust=no; rust_debug_release=no
fi
if test "$enable_rust" = yes; then :
# Extract the first word of "cargo", so it can be a program name with args.
set dummy cargo; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_cargo+:} false; then :
$as_echo_n "(cached) " >&6
else
case $cargo in
[\\/]* | ?:[\\/]*)
ac_cv_path_cargo="$cargo" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_cargo="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
cargo=$ac_cv_path_cargo
if test -n "$cargo"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cargo" >&5
$as_echo "$cargo" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -z "$cargo"; then :
as_fn_error $? "cargo is required for --enable-rust" "$LINENO" 5
fi
# Extract the first word of "rustc", so it can be a program name with args.
set dummy rustc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_rustc+:} false; then :
$as_echo_n "(cached) " >&6
else
case $rustc in
[\\/]* | ?:[\\/]*)
ac_cv_path_rustc="$rustc" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_rustc="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
rustc=$ac_cv_path_rustc
if test -n "$rustc"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $rustc" >&5
$as_echo "$rustc" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -z "$rustc"; then :
as_fn_error $? "rustc is required for --enable-rust" "$LINENO" 5
fi
# Check whether --enable-rust-debug was given.
if test "${enable_rust_debug+set}" = set; then :
enableval=$enable_rust_debug; rust_debug_release=$enableval
else
rust_debug_release=release
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Rust code with debugging information" >&5
$as_echo_n "checking whether to build Rust code with debugging information... " >&6; }
if test "x$rust_debug_release" = "xyes" ; then
rust_debug_release=debug
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
RUST_TARGET_SUBDIR=${rust_debug_release}
fi
if test "x$rust_debug_release" = "xdebug"; then
RUST_DEBUG_TRUE=
RUST_DEBUG_FALSE='#'
else
RUST_DEBUG_TRUE='#'
RUST_DEBUG_FALSE=
fi
if test "$enable_rust" != no; then
ENABLE_RUST_TRUE=
ENABLE_RUST_FALSE='#'
else
ENABLE_RUST_TRUE='#'
ENABLE_RUST_FALSE=
fi
# Check whether --with-libarchive was given.
if test "${with_libarchive+set}" = set; then :
@ -15732,7 +16048,7 @@ fi
else
with_libarchive=no
fi
if test x$with_libarchive != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +libarchive"; fi
if test x$with_libarchive != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libarchive"; fi
if test $with_libarchive != no; then
USE_LIBARCHIVE_TRUE=
USE_LIBARCHIVE_FALSE='#'
@ -15881,7 +16197,7 @@ fi
else
with_selinux=no
fi
if test x$with_selinux != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +selinux"; fi
if test x$with_selinux != xno; then OSTREE_FEATURES="$OSTREE_FEATURES selinux"; fi
if test $with_selinux != no; then
USE_SELINUX_TRUE=
USE_SELINUX_FALSE='#'
@ -15891,6 +16207,30 @@ else
fi
# Check whether --with-smack was given.
if test "${with_smack+set}" = set; then :
withval=$with_smack; :
else
with_smack=no
fi
if test x$with_smack = xyes; then :
$as_echo "#define WITH_SMACK 1" >>confdefs.h
fi
if test $with_smack != no; then
USE_SMACK_TRUE=
USE_SMACK_FALSE='#'
else
USE_SMACK_TRUE='#'
USE_SMACK_FALSE=
fi
LIBMOUNT_DEPENDENCY="mount >= 2.23.0"
@ -16020,6 +16360,20 @@ $as_echo "yes" >&6; }
fi
with_libmount=yes
save_LIBS=$LIBS
LIBS=$OT_DEP_LIBMOUNT_LIBS
for ac_func in mnt_unref_cache
do :
ac_fn_c_check_func "$LINENO" "mnt_unref_cache" "ac_cv_func_mnt_unref_cache"
if test "x$ac_cv_func_mnt_unref_cache" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_MNT_UNREF_CACHE 1
_ACEOF
fi
done
LIBS=$save_LIBS
else
@ -16030,7 +16384,7 @@ fi
else
with_libmount=no
fi
if test x$with_libmount != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +libmount"; fi
if test x$with_libmount != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libmount"; fi
if test $with_libmount != no; then
USE_LIBMOUNT_TRUE=
USE_LIBMOUNT_FALSE='#'
@ -16631,6 +16985,10 @@ if test -z "${ENABLE_ALWAYS_BUILD_TESTS_TRUE}" && test -z "${ENABLE_ALWAYS_BUILD
as_fn_error $? "conditional \"ENABLE_ALWAYS_BUILD_TESTS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${USE_CURL_TRUE}" && test -z "${USE_CURL_FALSE}"; then
as_fn_error $? "conditional \"USE_CURL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${USE_LIBSOUP_TRUE}" && test -z "${USE_LIBSOUP_FALSE}"; then
as_fn_error $? "conditional \"USE_LIBSOUP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -16639,6 +16997,10 @@ if test -z "${HAVE_LIBSOUP_CLIENT_CERTS_TRUE}" && test -z "${HAVE_LIBSOUP_CLIENT
as_fn_error $? "conditional \"HAVE_LIBSOUP_CLIENT_CERTS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${USE_CURL_OR_SOUP_TRUE}" && test -z "${USE_CURL_OR_SOUP_FALSE}"; then
as_fn_error $? "conditional \"USE_CURL_OR_SOUP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_INTROSPECTION_TRUE}" && test -z "${HAVE_INTROSPECTION_FALSE}"; then
as_fn_error $? "conditional \"HAVE_INTROSPECTION\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -16675,6 +17037,14 @@ if test -z "${ENABLE_MAN_TRUE}" && test -z "${ENABLE_MAN_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_MAN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${RUST_DEBUG_TRUE}" && test -z "${RUST_DEBUG_FALSE}"; then
as_fn_error $? "conditional \"RUST_DEBUG\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_RUST_TRUE}" && test -z "${ENABLE_RUST_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_RUST\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${USE_LIBARCHIVE_TRUE}" && test -z "${USE_LIBARCHIVE_FALSE}"; then
as_fn_error $? "conditional \"USE_LIBARCHIVE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -16683,6 +17053,10 @@ if test -z "${USE_SELINUX_TRUE}" && test -z "${USE_SELINUX_FALSE}"; then
as_fn_error $? "conditional \"USE_SELINUX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${USE_SMACK_TRUE}" && test -z "${USE_SMACK_FALSE}"; then
as_fn_error $? "conditional \"USE_SMACK\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${USE_LIBMOUNT_TRUE}" && test -z "${USE_LIBMOUNT_FALSE}"; then
as_fn_error $? "conditional \"USE_LIBMOUNT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -17120,7 +17494,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by ostree $as_me 2017.1, which was
This file was extended by libostree $as_me 2017.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -17186,7 +17560,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
ostree config.status 2017.1
libostree config.status 2017.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@ -18875,14 +19249,14 @@ fi
echo "
OSTree $VERSION
libOSTree $VERSION
===============
introspection: $found_introspection
Rust (internal oxidation): $rust_debug_release
rofiles-fuse: $enable_rofiles_fuse
libsoup (retrieve remote HTTP repositories): $with_soup
libsoup TLS client certs: $have_libsoup_client_certs
HTTP backend: $fetcher_backend
SELinux: $with_selinux
systemd: $have_libsystemd
libmount: $with_libmount

View File

@ -1,6 +1,6 @@
AC_PREREQ([2.63])
dnl If incrementing the version here, remember to update libostree.sym too
AC_INIT([ostree], [2017.1], [walters@verbum.org])
AC_INIT([libostree], [2017.3], [walters@verbum.org])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([buildutil])
AC_CONFIG_AUX_DIR([build-aux])
@ -33,7 +33,6 @@ CC_CHECK_FLAGS_APPEND([WARN_CFLAGS], [CFLAGS], [\
-Werror=incompatible-pointer-types \
-Werror=misleading-indentation \
-Werror=missing-include-dirs -Werror=aggregate-return \
-Werror=declaration-after-statement \
])
AC_SUBST(WARN_CFLAGS)
@ -79,13 +78,28 @@ PKG_CHECK_MODULES(OT_DEP_ZLIB, zlib)
dnl We're not actually linking to this, just using the header
PKG_CHECK_MODULES(OT_DEP_E2P, e2p)
dnl Arbitrary version that's in CentOS7.2 now
CURL_DEPENDENCY=7.29.0
AC_ARG_WITH(curl,
AS_HELP_STRING([--with-curl], [Use libcurl @<:@default=no@:>@]),
[], [with_curl=no])
AS_IF([test x$with_curl != xno ], [
PKG_CHECK_MODULES(OT_DEP_CURL, libcurl >= $CURL_DEPENDENCY)
with_curl=yes
AC_DEFINE([HAVE_LIBCURL], 1, [Define if we have libcurl.pc])
dnl Currently using libcurl requires soup for trivial-httpd for tests
with_soup_default=yes
], [with_soup_default=check])
AM_CONDITIONAL(USE_CURL, test x$with_curl != xno)
if test x$with_curl = xyes; then OSTREE_FEATURES="$OSTREE_FEATURES libcurl"; fi
dnl When bumping the libsoup-2.4 dependency, remember to bump
dnl SOUP_VERSION_MIN_REQUIRED and SOUP_VERSION_MAX_ALLOWED in
dnl Makefile.am
SOUP_DEPENDENCY="libsoup-2.4 >= 2.39.1"
AC_ARG_WITH(soup,
AS_HELP_STRING([--with-soup], [Use libsoup @<:@default=yes@:>@]),
[], [with_soup=check])
[], [with_soup=$with_soup_default])
AS_IF([test x$with_soup != xno], [
AC_ARG_ENABLE(libsoup_client_certs,
AS_HELP_STRING([--enable-libsoup-client-certs],
@ -116,10 +130,18 @@ AS_IF([test x$with_soup != xno ], [
with_soup=no
])
], [ with_soup=no ])
if test x$with_soup != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +libsoup"; fi
if test x$with_soup != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libsoup"; fi
AM_CONDITIONAL(USE_LIBSOUP, test x$with_soup != xno)
AM_CONDITIONAL(HAVE_LIBSOUP_CLIENT_CERTS, test x$have_libsoup_client_certs = xyes)
AS_IF([test x$with_curl = xyes && test x$with_soup = xno], [
AC_MSG_ERROR([Curl enabled, but libsoup is not; libsoup is needed for tests])
])
AM_CONDITIONAL(USE_CURL_OR_SOUP, test x$with_curl != xno || test x$with_soup != xno)
AS_IF([test x$with_curl != xno || test x$with_soup != xno],
[AC_DEFINE([HAVE_LIBCURL_OR_LIBSOUP], 1, [Define if we have soup or curl])])
AS_IF([test x$with_curl = xyes], [fetcher_backend=curl], [test x$with_soup = xyes], [fetcher_backend=libsoup], [fetcher_backend=none])
m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
GOBJECT_INTROSPECTION_CHECK([1.34.0])
])
@ -135,7 +157,7 @@ PKG_CHECK_MODULES(OT_DEP_GPGME, gpgme-pthread >= $LIBGPGME_DEPENDENCY, have_gpgm
AS_IF([ test x$have_gpgme = xno ], [
AC_MSG_ERROR([Need GPGME_PTHREAD version $LIBGPGME_DEPENDENCY or later])
])
OSTREE_FEATURES="$OSTREE_FEATURES +gpgme"
OSTREE_FEATURES="$OSTREE_FEATURES gpgme"
LIBARCHIVE_DEPENDENCY="libarchive >= 2.8.0"
# What's in RHEL7.2.
@ -161,11 +183,45 @@ AS_IF([test "$enable_man" != no], [
AC_MSG_ERROR([xsltproc is required for --enable-man])
])
enable_man=no
])
],[
enable_man=yes
])
])
AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
AC_ARG_ENABLE(rust,
[AS_HELP_STRING([--enable-rust],
[Compile Rust code instead of C [default=no]])],,
[enable_rust=no; rust_debug_release=no])
AS_IF([test "$enable_rust" = yes], [
AC_PATH_PROG([cargo], [cargo])
AS_IF([test -z "$cargo"], [AC_MSG_ERROR([cargo is required for --enable-rust])])
AC_PATH_PROG([rustc], [rustc])
AS_IF([test -z "$rustc"], [AC_MSG_ERROR([rustc is required for --enable-rust])])
dnl These bits based on gnome:librsvg/configure.ac
dnl By default, we build in public release mode.
AC_ARG_ENABLE(rust-debug,
AC_HELP_STRING([--enable-rust-debug],
[Build Rust code with debugging information [default=no]]),
[rust_debug_release=$enableval],
[rust_debug_release=release])
AC_MSG_CHECKING(whether to build Rust code with debugging information)
if test "x$rust_debug_release" = "xyes" ; then
rust_debug_release=debug
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
RUST_TARGET_SUBDIR=${rust_debug_release}
AC_SUBST([RUST_TARGET_SUBDIR])
])
AM_CONDITIONAL(RUST_DEBUG, [test "x$rust_debug_release" = "xdebug"])
AM_CONDITIONAL(ENABLE_RUST, [test "$enable_rust" != no])
AC_ARG_WITH(libarchive,
AS_HELP_STRING([--without-libarchive], [Do not use libarchive]),
:, with_libarchive=maybe)
@ -189,7 +245,7 @@ AS_IF([ test x$with_libarchive != xno ], [
with_libarchive=no
])
], [ with_libarchive=no ])
if test x$with_libarchive != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +libarchive"; fi
if test x$with_libarchive != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libarchive"; fi
AM_CONDITIONAL(USE_LIBARCHIVE, test $with_libarchive != no)
dnl This is what is in RHEL7 anyways
@ -214,9 +270,17 @@ AS_IF([ test x$with_selinux != xno ], [
with_selinux=no
])
], [ with_selinux=no ])
if test x$with_selinux != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +selinux"; fi
if test x$with_selinux != xno; then OSTREE_FEATURES="$OSTREE_FEATURES selinux"; fi
AM_CONDITIONAL(USE_SELINUX, test $with_selinux != no)
AC_ARG_WITH(smack,
AS_HELP_STRING([--with-smack], [Enable smack]),
:, with_smack=no)
AS_IF([ test x$with_smack = xyes], [
AC_DEFINE([WITH_SMACK], 1, [Define if we have smack.pc])
])
AM_CONDITIONAL(USE_SMACK, test $with_smack != no)
dnl This is what is in RHEL7.2 right now, picking it arbitrarily
LIBMOUNT_DEPENDENCY="mount >= 2.23.0"
@ -235,11 +299,15 @@ AS_IF([ test x$with_libmount != xno ], [
AC_DEFINE([HAVE_LIBMOUNT], 1, [Define if we have libmount.pc])
PKG_CHECK_MODULES(OT_DEP_LIBMOUNT, $LIBMOUNT_DEPENDENCY)
with_libmount=yes
save_LIBS=$LIBS
LIBS=$OT_DEP_LIBMOUNT_LIBS
AC_CHECK_FUNCS(mnt_unref_cache)
LIBS=$save_LIBS
], [
with_libmount=no
])
], [ with_libmount=no ])
if test x$with_libmount != xno; then OSTREE_FEATURES="$OSTREE_FEATURES +libmount"; fi
if test x$with_libmount != xno; then OSTREE_FEATURES="$OSTREE_FEATURES libmount"; fi
AM_CONDITIONAL(USE_LIBMOUNT, test $with_libmount != no)
# Enabled by default because I think people should use it.
@ -334,14 +402,14 @@ src/libostree/ostree-1.pc
AC_OUTPUT
echo "
OSTree $VERSION
libOSTree $VERSION
===============
introspection: $found_introspection
Rust (internal oxidation): $rust_debug_release
rofiles-fuse: $enable_rofiles_fuse
libsoup (retrieve remote HTTP repositories): $with_soup
libsoup TLS client certs: $have_libsoup_client_certs
HTTP backend: $fetcher_backend
SELinux: $with_selinux
systemd: $have_libsystemd
libmount: $with_libmount

View File

@ -1,13 +1,14 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991 Free Software Foundation, Inc.
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
@ -16,97 +17,109 @@ freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LIBRARY GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
@ -255,7 +268,7 @@ distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
@ -282,23 +295,31 @@ of these things:
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
@ -347,7 +368,7 @@ Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
@ -390,7 +411,7 @@ excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
@ -453,16 +474,16 @@ convey the exclusion of warranty; and each file should have at least the
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
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.
version 2.1 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
Library General Public License for more details.
Lesser General Public License for more details.
You should have received a copy of the GNU Library General Public
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

View File

@ -51,3 +51,10 @@ libglnx_la_SOURCES = \
libglnx_la_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags)
libglnx_la_LDFLAGS = -avoid-version -Bsymbolic-functions -export-symbols-regex "^glnx_" -no-undefined -export-dynamic
libglnx_la_LIBADD = $(libglnx_libs)
TESTS += test-libglnx-xattrs
check_PROGRAMS += test-libglnx-xattrs
test_libglnx_xattrs_SOURCES = $(libglnx_srcpath)/tests/test-libglnx-xattrs.c
test_libglnx_xattrs_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags)
test_libglnx_xattrs_LDADD = $(libglnx_libs) libglnx.la

View File

@ -51,3 +51,10 @@ libglnx_la_SOURCES = \
libglnx_la_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags)
libglnx_la_LDFLAGS = -avoid-version -Bsymbolic-functions -export-symbols-regex "^glnx_" -no-undefined -export-dynamic
libglnx_la_LIBADD = $(libglnx_libs)
TESTS += test-libglnx-xattrs
check_PROGRAMS += test-libglnx-xattrs
test_libglnx_xattrs_SOURCES = libglnx/tests/test-libglnx-xattrs.c
test_libglnx_xattrs_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags)
test_libglnx_xattrs_LDADD = $(libglnx_libs) libglnx.la

View File

@ -293,13 +293,10 @@ glnx_gen_temp_name (gchar *tmpl)
{
size_t len;
char *XXXXXX;
int count;
int i;
static const char letters[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
static const int NLETTERS = sizeof (letters) - 1;
glong value;
GTimeVal tv;
static int counter = 0;
g_return_if_fail (tmpl != NULL);
len = strlen (tmpl);
@ -307,27 +304,8 @@ glnx_gen_temp_name (gchar *tmpl)
XXXXXX = tmpl + (len - 6);
/* Get some more or less random data. */
g_get_current_time (&tv);
value = (tv.tv_usec ^ tv.tv_sec) + counter++;
for (count = 0; count < 100; value += 7777, ++count)
{
glong v = value;
/* Fill in the random bits. */
XXXXXX[0] = letters[v % NLETTERS];
v /= NLETTERS;
XXXXXX[1] = letters[v % NLETTERS];
v /= NLETTERS;
XXXXXX[2] = letters[v % NLETTERS];
v /= NLETTERS;
XXXXXX[3] = letters[v % NLETTERS];
v /= NLETTERS;
XXXXXX[4] = letters[v % NLETTERS];
v /= NLETTERS;
XXXXXX[5] = letters[v % NLETTERS];
}
for (i = 0; i < 6; i++)
XXXXXX[i] = letters[g_random_int_range(0, NLETTERS)];
}
/**

View File

@ -83,19 +83,22 @@ read_xattr_name_array (const char *path,
funcstr = fd != -1 ? "fgetxattr" : "lgetxattr";
p = xattrs;
while (p < xattrs+len)
for (p = xattrs; p < xattrs+len; p = p + strlen (p) + 1)
{
ssize_t bytes_read;
char *buf;
GBytes *bytes = NULL;
g_autofree char *buf = NULL;
g_autoptr(GBytes) bytes = NULL;
again:
if (fd != -1)
bytes_read = fgetxattr (fd, p, NULL, 0);
else
bytes_read = lgetxattr (path, p, NULL, 0);
if (bytes_read < 0)
{
if (errno == ENODATA)
continue;
glnx_set_prefix_error_from_errno (error, "%s", funcstr);
goto out;
}
@ -103,24 +106,28 @@ read_xattr_name_array (const char *path,
continue;
buf = g_malloc (bytes_read);
bytes = g_bytes_new_take (buf, bytes_read);
if (fd != -1)
r = fgetxattr (fd, p, buf, bytes_read);
else
r = lgetxattr (path, p, buf, bytes_read);
if (r < 0)
{
g_bytes_unref (bytes);
if (errno == ERANGE)
{
g_free (g_steal_pointer (&buf));
goto again;
}
else if (errno == ENODATA)
continue;
glnx_set_prefix_error_from_errno (error, "%s", funcstr);
goto out;
}
bytes = g_bytes_new_take (g_steal_pointer (&buf), bytes_read);
g_variant_builder_add (builder, "(@ay@ay)",
g_variant_new_bytestring (p),
variant_new_ay_bytes (bytes));
p = p + strlen (p) + 1;
g_bytes_unref (bytes);
}
ret = TRUE;
@ -130,22 +137,29 @@ read_xattr_name_array (const char *path,
static gboolean
get_xattrs_impl (const char *path,
int fd,
GVariant **out_xattrs,
GCancellable *cancellable,
GError **error)
{
gboolean ret = FALSE;
ssize_t bytes_read;
ssize_t bytes_read, real_size;
glnx_free char *xattr_names = NULL;
glnx_free char *xattr_names_canonical = NULL;
GVariantBuilder builder;
gboolean builder_initialized = FALSE;
g_autoptr(GVariant) ret_xattrs = NULL;
g_assert (path != NULL || fd != -1);
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ayay)"));
builder_initialized = TRUE;
again:
if (path)
bytes_read = llistxattr (path, NULL, 0);
else
bytes_read = flistxattr (fd, NULL, 0);
if (bytes_read < 0)
{
@ -158,16 +172,28 @@ get_xattrs_impl (const char *path,
else if (bytes_read > 0)
{
xattr_names = g_malloc (bytes_read);
if (llistxattr (path, xattr_names, bytes_read) < 0)
if (path)
real_size = llistxattr (path, xattr_names, bytes_read);
else
real_size = flistxattr (fd, xattr_names, bytes_read);
if (real_size < 0)
{
if (errno == ERANGE)
{
g_free (xattr_names);
goto again;
}
glnx_set_prefix_error_from_errno (error, "%s", "llistxattr");
goto out;
}
xattr_names_canonical = canonicalize_xattrs (xattr_names, bytes_read);
else if (real_size > 0)
{
xattr_names_canonical = canonicalize_xattrs (xattr_names, real_size);
if (!read_xattr_name_array (path, -1, xattr_names_canonical, bytes_read, &builder, error))
if (!read_xattr_name_array (path, fd, xattr_names_canonical, real_size, &builder, error))
goto out;
}
}
ret_xattrs = g_variant_builder_end (&builder);
builder_initialized = FALSE;
@ -201,52 +227,8 @@ glnx_fd_get_all_xattrs (int fd,
GCancellable *cancellable,
GError **error)
{
gboolean ret = FALSE;
ssize_t bytes_read;
glnx_free char *xattr_names = NULL;
glnx_free char *xattr_names_canonical = NULL;
GVariantBuilder builder;
gboolean builder_initialized = FALSE;
g_autoptr(GVariant) ret_xattrs = NULL;
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ayay)"));
builder_initialized = TRUE;
bytes_read = flistxattr (fd, NULL, 0);
if (bytes_read < 0)
{
if (errno != ENOTSUP)
{
glnx_set_prefix_error_from_errno (error, "%s", "flistxattr");
goto out;
}
}
else if (bytes_read > 0)
{
xattr_names = g_malloc (bytes_read);
if (flistxattr (fd, xattr_names, bytes_read) < 0)
{
glnx_set_prefix_error_from_errno (error, "%s", "flistxattr");
goto out;
}
xattr_names_canonical = canonicalize_xattrs (xattr_names, bytes_read);
if (!read_xattr_name_array (NULL, fd, xattr_names_canonical, bytes_read, &builder, error))
goto out;
}
ret_xattrs = g_variant_builder_end (&builder);
builder_initialized = FALSE;
g_variant_ref_sink (ret_xattrs);
ret = TRUE;
if (out_xattrs)
*out_xattrs = g_steal_pointer (&ret_xattrs);
out:
if (!builder_initialized)
g_variant_builder_clear (&builder);
return ret;
return get_xattrs_impl (NULL, fd, out_xattrs,
cancellable, error);
}
/**
@ -269,7 +251,7 @@ glnx_dfd_name_get_all_xattrs (int dfd,
{
if (dfd == AT_FDCWD || dfd == -1)
{
return get_xattrs_impl (name, out_xattrs, cancellable, error);
return get_xattrs_impl (name, -1, out_xattrs, cancellable, error);
}
else
{
@ -278,7 +260,7 @@ glnx_dfd_name_get_all_xattrs (int dfd,
* https://mail.gnome.org/archives/ostree-list/2014-February/msg00017.html
*/
snprintf (buf, sizeof (buf), "/proc/self/fd/%d/%s", dfd, name);
return get_xattrs_impl (buf, out_xattrs, cancellable, error);
return get_xattrs_impl (buf, -1, out_xattrs, cancellable, error);
}
}

View File

@ -0,0 +1,282 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2017 Red Hat, 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.
*/
#include "config.h"
#include "libglnx.h"
#include <glib.h>
#include <stdlib.h>
#include <gio/gio.h>
#include <string.h>
#define XATTR_THREAD_RUN_TIME_USECS (5 * G_USEC_PER_SEC)
struct XattrWorker {
int dfd;
gboolean is_writer;
guint n_attrs_read;
};
typedef enum {
WRITE_RUN_MUTATE,
WRITE_RUN_CREATE,
} WriteType;
static gboolean
set_random_xattr_value (int fd, const char *name, GError **error)
{
const guint8 randxattrbyte = g_random_int_range (0, 256);
const guint32 randxattrvalue_len = (g_random_int () % 256) + 1; /* Picked to be not too small or large */
g_autofree char *randxattrvalue = g_malloc (randxattrvalue_len);
memset (randxattrvalue, randxattrbyte, randxattrvalue_len);
if (fsetxattr (fd, name, randxattrvalue, randxattrvalue_len, 0) < 0)
{
glnx_set_error_from_errno (error);
return FALSE;
}
return TRUE;
}
static gboolean
add_random_xattrs (int fd, GError **error)
{
const guint nattrs = MIN (2, g_random_int () % 16);
for (guint i = 0; i < nattrs; i++)
{
guint32 randxattrname_v = g_random_int ();
g_autofree char *randxattrname = g_strdup_printf ("user.test%u", randxattrname_v);
if (!set_random_xattr_value (fd, randxattrname, error))
return FALSE;
}
return TRUE;
}
static gboolean
do_write_run (GLnxDirFdIterator *dfd_iter, GError **error)
{
WriteType wtype = g_random_int () % 2;
if (wtype == WRITE_RUN_CREATE)
{
guint32 randname_v = g_random_int ();
g_autofree char *randname = g_strdup_printf ("file%u", randname_v);
glnx_fd_close int fd = -1;
again:
fd = openat (dfd_iter->fd, randname, O_CREAT | O_EXCL, 0644);
if (fd < 0)
{
if (errno == EEXIST)
{
g_printerr ("Congratulations! I suggest purchasing a lottery ticket today!\n");
goto again;
}
else
{
glnx_set_error_from_errno (error);
return FALSE;
}
}
if (!add_random_xattrs (fd, error))
return FALSE;
}
else if (wtype == WRITE_RUN_MUTATE)
{
while (TRUE)
{
g_autoptr(GVariant) current_xattrs = NULL;
glnx_fd_close int fd = -1;
struct dirent *dent;
if (!glnx_dirfd_iterator_next_dent (dfd_iter, &dent, NULL, error))
return FALSE;
if (!dent)
break;
fd = openat (dfd_iter->fd, dent->d_name, O_RDONLY | O_CLOEXEC);
if (fd < 0)
{
glnx_set_error_from_errno (error);
return FALSE;
}
if (!glnx_fd_get_all_xattrs (fd, &current_xattrs, NULL, error))
return FALSE;
for (int i = 0; i < g_variant_n_children (current_xattrs); i++)
{
const char *name, *value;
g_variant_get_child (current_xattrs, i, "(^&ay^&ay)", &name, &value);
/* We don't want to potentially test/change xattrs like security.selinux
* that were injected by the system.
*/
if (!g_str_has_prefix (name, "user.test"))
continue;
if (!set_random_xattr_value (fd, name, error))
return FALSE;
}
}
}
else
g_assert_not_reached ();
return TRUE;
}
static gboolean
do_read_run (GLnxDirFdIterator *dfd_iter,
guint *out_n_read,
GError **error)
{
guint nattrs = 0;
while (TRUE)
{
g_autoptr(GVariant) current_xattrs = NULL;
glnx_fd_close int fd = -1;
struct dirent *dent;
if (!glnx_dirfd_iterator_next_dent (dfd_iter, &dent, NULL, error))
return FALSE;
if (!dent)
break;
fd = openat (dfd_iter->fd, dent->d_name, O_RDONLY | O_CLOEXEC);
if (fd < 0)
{
glnx_set_error_from_errno (error);
return FALSE;
}
if (!glnx_fd_get_all_xattrs (fd, &current_xattrs, NULL, error))
return FALSE;
/* We don't actually care about the values, just use the variable
* to avoid compiler warnings.
*/
nattrs += g_variant_n_children (current_xattrs);
}
*out_n_read = nattrs;
return TRUE;
}
static gpointer
xattr_thread (gpointer data)
{
g_autoptr(GError) local_error = NULL;
GError **error = &local_error;
struct XattrWorker *worker = data;
guint64 end_time = g_get_monotonic_time () + XATTR_THREAD_RUN_TIME_USECS;
guint n_read = 0;
while (g_get_monotonic_time () < end_time)
{
g_auto(GLnxDirFdIterator) dfd_iter = { 0, };
if (!glnx_dirfd_iterator_init_at (worker->dfd, ".", TRUE, &dfd_iter, error))
goto out;
if (worker->is_writer)
{
if (!do_write_run (&dfd_iter, error))
goto out;
}
else
{
if (!do_read_run (&dfd_iter, &n_read, error))
goto out;
}
}
out:
g_assert_no_error (local_error);
return GINT_TO_POINTER (n_read);
}
static void
test_xattr_races (void)
{
/* If for some reason we're built in a VM which only has one vcpu, let's still
* at least make the test do something.
*/
/* FIXME - this deadlocks for me on 4.9.4-201.fc25.x86_64, whether
* using overlayfs or xfs as source/dest.
*/
const guint nprocs = MAX (4, g_get_num_processors ());
struct XattrWorker wdata[nprocs];
GThread *threads[nprocs];
g_autoptr(GError) local_error = NULL;
GError **error = &local_error;
glnx_fd_close int dfd = -1;
g_autofree char *tmpdir = g_strdup_printf ("%s/libglnx-xattrs-XXXXXX",
getenv ("TMPDIR") ?: "/var/tmp");
guint nread = 0;
if (!glnx_mkdtempat (AT_FDCWD, tmpdir, 0700, error))
goto out;
if (!glnx_opendirat (AT_FDCWD, tmpdir, TRUE, &dfd, error))
goto out;
for (guint i = 0; i < nprocs; i++)
{
struct XattrWorker *worker = &wdata[i];
worker->dfd = dfd;
worker->is_writer = i % 2 == 0;
threads[i] = g_thread_new (NULL, xattr_thread, worker);
}
for (guint i = 0; i < nprocs; i++)
{
if (wdata[i].is_writer)
(void) g_thread_join (threads[i]);
else
nread += GPOINTER_TO_UINT (g_thread_join (threads[i]));
}
g_print ("Read %u xattrs race free!\n", nread);
(void) glnx_shutil_rm_rf_at (AT_FDCWD, tmpdir, NULL, NULL);
out:
g_assert_no_error (local_error);
}
int main (int argc, char **argv)
{
int ret;
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/xattr-races", test_xattr_races);
ret = g_test_run();
return ret;
}

View File

@ -2,7 +2,7 @@
.\" Title: ostree admin cleanup
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree admin cleanup
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree admin config-diff
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree admin config-diff
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree admin deploy
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree admin deploy
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree admin init-fs
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree admin init-fs
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree admin instutil
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree admin instutil
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree admin os-init
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree admin os-init
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree admin set-origin
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree admin set-origin
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree admin status
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree admin status
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree admin switch
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree admin switch
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree admin undeploy
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree admin undeploy
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree admin unlock
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree admin unlock
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree admin upgrade
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree admin upgrade
.\" Source: OSTree
.\" Language: English
@ -34,7 +34,10 @@ ostree-admin-upgrade \- Construct new tree from current origin and deploy it, if
\fBostree admin upgrade\fR [OPTIONS...]
.SH "DESCRIPTION"
.PP
Downloads the latest version of the current ref from the build server and deploys it, if it changed\&. Reboot the machine for the changes to take effect\&.
Downloads the latest version of the current ref from the build server and deploys it, if it changed\&. Reboot the machine for the changes to take effect\&. These phases can be split via
\fB\-\-pull\-only\fR
and
\fB\-\-deploy\-only\fR\&.
.SH "OPTIONS"
.PP
\fB\-\-os\fR="OSNAME"
@ -42,6 +45,17 @@ Downloads the latest version of the current ref from the build server and deploy
Use a different operating system root than the current one\&.
.RE
.PP
\fB\-\-pull\-only\fR
.RS 4
Only perform a pull into the repository; do not create a deployment\&. This option can hence safely be used in a background scheduled job with the assurance of not changing system state\&.
.RE
.PP
\fB\-\-deploy\-only\fR
.RS 4
Create a new deployment from the latest commit in the tracked origin refspec\&. This option is intended to be used by a scheduled system that detected changes via
\fB\-\-pull\-only\fR, and is ready to deploy them\&.
.RE
.PP
\fB\-\-reboot\fR,\fB\-r\fR
.RS 4
Reboot after a successful upgrade\&.

View File

@ -57,7 +57,10 @@ Boston, MA 02111-1307, USA.
<title>Description</title>
<para>
Downloads the latest version of the current ref from the build server and deploys it, if it changed. Reboot the machine for the changes to take effect.
Downloads the latest version of the current ref from the build
server and deploys it, if it changed. Reboot the machine for the
changes to take effect. These phases can be split via
<option>--pull-only</option> and <option>--deploy-only</option>.
</para>
</refsect1>
@ -73,6 +76,24 @@ Boston, MA 02111-1307, USA.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--pull-only</option></term>
<listitem><para> Only perform a pull into the repository; do not
create a deployment. This option can hence safely be used in a
background scheduled job with the assurance of not changing
system state.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--deploy-only</option></term>
<listitem><para>Create a new deployment from the latest commit
in the tracked origin refspec. This option is intended to be used
by a scheduled system that detected changes via <option>--pull-only</option>,
and is ready to deploy them.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--reboot</option>,<option>-r</option></term>

View File

@ -2,7 +2,7 @@
.\" Title: ostree admin
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree admin
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree cat
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree cat
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree checkout
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree checkout
.\" Source: OSTree
.\" Language: English
@ -54,6 +54,11 @@ Checkout sub\-directory PATH\&.
Keep existing directories and unchanged files, overwrite existing files\&.
.RE
.PP
\fB\-\-union\-add\fR
.RS 4
Keep existing directories and files\&.
.RE
.PP
\fB\-\-allow\-noent\fR
.RS 4
Do nothing if specified path does not exist\&.

View File

@ -89,6 +89,14 @@ Boston, MA 02111-1307, USA.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--union-add</option></term>
<listitem><para>
Keep existing directories and files.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--allow-noent</option></term>

View File

@ -2,7 +2,7 @@
.\" Title: ostree checksum
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree checksum
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree commit
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree commit
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree config
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree config
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree diff
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree diff
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree export
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree export
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree fsck
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree fsck
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree gpg-sign
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree gpg-sign
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree init
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree init
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree log
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree log
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree ls
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree ls
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree prune
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree prune
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree pull-local
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree pull-local
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree pull
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree pull
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree refs
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree refs
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree remote
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree remote
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree reset
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree reset
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree rev-parse
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree rev-parse
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree show
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree show
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree static-delta
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree static-delta
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree summary
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree summary
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree trivial-httpd
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree trivial-httpd
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: ostree.repo-config
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree.repo-config
.\" Source: OSTree
.\" Language: English
@ -82,10 +82,15 @@ Describes a remote repository location\&.
.PP
\fIurl\fR
.RS 4
Must be present; declares URL for accessing this remote\&. The only supported schemes are the moment are
file,
http, and
https\&.
Must be present; declares URL for accessing metadata and content for remote\&. See also
contenturl\&. The supported schemes are documented below\&.
.RE
.PP
\fIcontenturl\fR
.RS 4
Declares URL for accessing content (filez, static delta parts)\&. When specified,
url
is used just for metadata: summary, static delta "superblocks"\&.
.RE
.PP
\fIproxy\fR
@ -140,6 +145,32 @@ file, remotes may also be specified in
\&.conf; files whose name does not end in
\&.conf
will be ignored\&.
.SH "REPOSITORY URL/CONTENTURL"
.PP
Originally, OSTree had just a
url
option for remotes\&. Since then, the
contenturl
option was introduced\&. Both of these support
file,
http, and
https
schemes\&.
.PP
Additionally, both of these can be prefixed with the string
mirrorlist=, which instructs the client that the target url is a "mirrorlist" format, which is a plain text file of newline\-separated URLs\&. Earlier URLs will be given precedence\&.
.PP
Note that currently, the
tls\-ca\-path
and
tls\-client\-cert\-path
options apply to every HTTP request, even when
contenturl
and/or
mirrorlist
are in use\&. This may change in the future to only apply to metadata (i\&.e\&.
url, not
contenturl) fetches\&.
.SH "PER\-REMOTE GPG KEYRINGS AND VERIFICATION"
.PP
OSTree supports a per\-remote GPG keyring, as well as a

View File

@ -127,10 +127,16 @@ Boston, MA 02111-1307, USA.
<variablelist>
<varlistentry>
<term><varname>url</varname></term>
<listitem><para>Must be present; declares URL for accessing
this remote. The only supported schemes are the moment are
<literal>file</literal>, <literal>http</literal>, and
<literal>https</literal>.</para></listitem>
<listitem><para>Must be present; declares URL for accessing metadata and
content for remote. See also <literal>contenturl</literal>. The
supported schemes are documented below.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>contenturl</varname></term>
<listitem><para>Declares URL for accessing content (filez, static delta
parts). When specified, <literal>url</literal> is used just for
metadata: summary, static delta "superblocks".</para></listitem>
</varlistentry>
<varlistentry>
@ -201,6 +207,32 @@ Boston, MA 02111-1307, USA.
</para>
</refsect1>
<refsect1>
<title>Repository url/contenturl</title>
<para>
Originally, OSTree had just a <literal>url</literal> option
for remotes. Since then, the <literal>contenturl</literal>
option was introduced. Both of these support
<literal>file</literal>, <literal>http</literal>, and
<literal>https</literal> schemes.
</para>
<para>
Additionally, both of these can be prefixed with the string
<literal>mirrorlist=</literal>, which instructs the client
that the target url is a "mirrorlist" format, which is
a plain text file of newline-separated URLs. Earlier
URLs will be given precedence.
</para>
<para>
Note that currently, the <literal>tls-ca-path</literal> and
<literal>tls-client-cert-path</literal> options apply to every HTTP
request, even when <literal>contenturl</literal> and/or
<literal>mirrorlist</literal> are in use. This may change in the future to
only apply to metadata (i.e. <literal>url</literal>, not
<literal>contenturl</literal>) fetches.
</para>
</refsect1>
<refsect1>
<title>Per-remote GPG keyrings and verification</title>
<para>

View File

@ -2,7 +2,7 @@
.\" Title: ostree.repo
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: ostree.repo
.\" Source: OSTree
.\" Language: English

View File

@ -2,7 +2,7 @@
.\" Title: rofiles-fuse
.\" Author: Colin Walters <walters@verbum.org>
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
.\" Date: 01/19/2017
.\" Date: 03/10/2017
.\" Manual: rofiles-fuse
.\" Source: rofiles-fuse
.\" Language: English

View File

@ -80,7 +80,8 @@ static uint32_t rollsum_digest(Rollsum *r)
}
static uint32_t rollsum_sum(uint8_t *buf, size_t ofs, size_t len)
uint32_t
bupsplit_sum(uint8_t *buf, size_t ofs, size_t len)
{
size_t count;
Rollsum r;
@ -115,38 +116,3 @@ int bupsplit_find_ofs(const unsigned char *buf, int len, int *bits)
}
return 0;
}
#ifndef BUP_NO_SELFTEST
#define BUP_SELFTEST_SIZE 100000
int bupsplit_selftest()
{
uint8_t *buf = malloc(BUP_SELFTEST_SIZE);
uint32_t sum1a, sum1b, sum2a, sum2b, sum3a, sum3b;
unsigned count;
srandom(1);
for (count = 0; count < BUP_SELFTEST_SIZE; count++)
buf[count] = random();
sum1a = rollsum_sum(buf, 0, BUP_SELFTEST_SIZE);
sum1b = rollsum_sum(buf, 1, BUP_SELFTEST_SIZE);
sum2a = rollsum_sum(buf, BUP_SELFTEST_SIZE - BUP_WINDOWSIZE*5/2,
BUP_SELFTEST_SIZE - BUP_WINDOWSIZE);
sum2b = rollsum_sum(buf, 0, BUP_SELFTEST_SIZE - BUP_WINDOWSIZE);
sum3a = rollsum_sum(buf, 0, BUP_WINDOWSIZE+3);
sum3b = rollsum_sum(buf, 3, BUP_WINDOWSIZE+3);
fprintf(stderr, "sum1a = 0x%08x\n", sum1a);
fprintf(stderr, "sum1b = 0x%08x\n", sum1b);
fprintf(stderr, "sum2a = 0x%08x\n", sum2a);
fprintf(stderr, "sum2b = 0x%08x\n", sum2b);
fprintf(stderr, "sum3a = 0x%08x\n", sum3a);
fprintf(stderr, "sum3b = 0x%08x\n", sum3b);
free(buf);
return sum1a!=sum1b || sum2a!=sum2b || sum3a!=sum3b;
}
#endif // !BUP_NO_SELFTEST

View File

@ -30,6 +30,9 @@
#ifndef __BUPSPLIT_H
#define __BUPSPLIT_H
#include <stdint.h>
#include <sys/types.h>
#define BUP_BLOBBITS (13)
#define BUP_BLOBSIZE (1<<BUP_BLOBBITS)
#define BUP_WINDOWBITS (7)
@ -39,8 +42,8 @@
extern "C" {
#endif
uint32_t bupsplit_sum(uint8_t *buf, size_t ofs, size_t len);
int bupsplit_find_ofs(const unsigned char *buf, int len, int *bits);
int bupsplit_selftest(void);
#ifdef __cplusplus
}

View File

@ -366,21 +366,39 @@ global:
/* No new symbols in 2016.15 */
/* NOTE NOTE NOTE
* Versions above here are released. Only add symbols below this line.
* NOTE NOTE NOTE
*/
LIBOSTREE_2017.1 {
global:
ostree_repo_prune_from_reachable;
} LIBOSTREE_2016.14;
/* Stub section for the stable release *after* this development one; don't
* edit this other than to update the last number. This is just a copy/paste
* source.
LIBOSTREE_2016.XX {
LIBOSTREE_2017.2 {
global:
ostree_repo_reload_config;
} LIBOSTREE_2017.1;
LIBOSTREE_2017.3 {
global:
ostree_raw_file_to_archive_z2_stream_with_options;
} LIBOSTREE_2017.2;
/* NOTE NOTE NOTE
* Versions above here are released. Only add symbols below this line.
* NOTE NOTE NOTE
*/
/* Stub section for new version, uncomment when the first symbol is added
LIBOSTREE_2017.$NEWVERSION {
global:
someostree_symbol_deleteme;
} LIBOSTREE_2016.14;
} LIBOSTREE_2017.2;
*/
/* Stub section for the stable release *after* this development one; don't
* edit this other than to update the last number. This is just a copy/paste
* source. Replace $LASTSTABLE with the last stable version, and $NEWVERSION
* with whatever the next version with new symbols will be.
LIBOSTREE_2017.$NEWVERSION {
global:
someostree_symbol_deleteme;
} LIBOSTREE_2017.$LASTSTABLE;
*/

View File

@ -29,6 +29,20 @@
#include <string.h>
/* I only did some cursory research here, but it appears
* that we only want to use "linux16" for x86 platforms.
* At least, I got a report that "linux16" is definitely wrong
* for ppc64. See
* http://pkgs.fedoraproject.org/cgit/rpms/grub2.git/tree/0036-Use-linux16-when-appropriate-880840.patch?h=f25
* https://bugzilla.redhat.com/show_bug.cgi?id=1108296
* among others.
*/
#if defined(__i386__) || defined(__x86_64__)
#define GRUB2_USES_16 1
#else
#define GRUB2_USES_16 0
#endif
struct _OstreeBootloaderGrub2
{
GObject parent_instance;
@ -203,7 +217,13 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot *sysroot
if (is_efi)
g_string_append (output, "linuxefi ");
else
{
#if GRUB2_USES_16
g_string_append (output, "linux16 ");
#else
g_string_append (output, "linux ");
#endif
}
g_string_append (output, kernel);
options = ostree_bootconfig_parser_get (config, "options");
@ -220,7 +240,13 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot *sysroot
if (is_efi)
g_string_append (output, "initrdefi ");
else
{
#if GRUB2_USES_16
g_string_append (output, "initrd16 ");
#else
g_string_append (output, "initrd ");
#endif
}
g_string_append (output, initrd);
g_string_append_c (output, '\n');
}
@ -239,12 +265,26 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot *sysroot
return ret;
}
typedef struct {
const char *root;
const char *bootversion_str;
gboolean is_efi;
} Grub2ChildSetupData;
static void
grub2_child_setup (gpointer user_data)
{
const char *root = user_data;
Grub2ChildSetupData *cdata = user_data;
if (chdir (root) != 0)
setenv ("_OSTREE_GRUB2_BOOTVERSION", cdata->bootversion_str, TRUE);
/* We have to pass our state to the child */
if (cdata->is_efi)
setenv ("_OSTREE_GRUB2_IS_EFI", "1", TRUE);
if (!cdata->root)
return;
if (chdir (cdata->root) != 0)
{
perror ("chdir");
_exit (1);
@ -268,7 +308,7 @@ grub2_child_setup (gpointer user_data)
_exit (1);
}
if (mount (root, "/", NULL, MS_MOVE, NULL) < 0)
if (mount (cdata->root, "/", NULL, MS_MOVE, NULL) < 0)
{
perror ("failed to MS_MOVE to /");
_exit (1);
@ -290,14 +330,15 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader,
OstreeBootloaderGrub2 *self = OSTREE_BOOTLOADER_GRUB2 (bootloader);
gboolean ret = FALSE;
g_autoptr(GFile) new_config_path = NULL;
GSubprocessFlags subp_flags = 0;
glnx_unref_object GSubprocessLauncher *launcher = NULL;
glnx_unref_object GSubprocess *proc = NULL;
g_autofree char *bootversion_str = g_strdup_printf ("%u", (guint)bootversion);
g_autoptr(GFile) config_path_efi_dir = NULL;
g_autofree char *grub2_mkconfig_chroot = NULL;
gboolean use_system_grub2_mkconfig = TRUE;
const gchar *grub_exec = NULL;
const char *grub_argv[4] = { NULL, "-o", NULL, NULL};
GSpawnFlags grub_spawnflags = G_SPAWN_SEARCH_PATH;
int grub2_estatus;
Grub2ChildSetupData cdata = { NULL, };
#ifdef USE_BUILTIN_GRUB2_MKCONFIG
use_system_grub2_mkconfig = FALSE;
@ -354,22 +395,15 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader,
bootversion);
}
grub_argv[0] = grub_exec;
grub_argv[2] = gs_file_get_path_cached (new_config_path);
if (!g_getenv ("OSTREE_DEBUG_GRUB2"))
subp_flags |= (G_SUBPROCESS_FLAGS_STDOUT_SILENCE | G_SUBPROCESS_FLAGS_STDERR_SILENCE);
launcher = g_subprocess_launcher_new (subp_flags);
g_subprocess_launcher_setenv (launcher, "_OSTREE_GRUB2_BOOTVERSION", bootversion_str, TRUE);
/* We have to pass our state to the child */
if (self->is_efi)
g_subprocess_launcher_setenv (launcher, "_OSTREE_GRUB2_IS_EFI", "1", TRUE);
/* We need to chroot() if we're not in /. This assumes our caller has
* set up the bind mounts outside.
*/
if (grub2_mkconfig_chroot != NULL)
g_subprocess_launcher_set_child_setup (launcher, grub2_child_setup, grub2_mkconfig_chroot, NULL);
/* In the current Fedora grub2 package, this script doesn't even try
grub_spawnflags |= G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL;
cdata.root = grub2_mkconfig_chroot;
cdata.bootversion_str = bootversion_str;
cdata.is_efi = self->is_efi;
/* Note in older versions of the grub2 package, this script doesn't even try
to be atomic; it just does:
cat ${grub_cfg}.new > ${grub_cfg}
@ -377,13 +411,15 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader,
Upstream is fixed though.
*/
proc = g_subprocess_launcher_spawn (launcher, error,
grub_exec, "-o",
gs_file_get_path_cached (new_config_path),
NULL);
if (!g_subprocess_wait_check (proc, cancellable, error))
if (!g_spawn_sync (NULL, (char**)grub_argv, NULL, grub_spawnflags,
grub2_child_setup, &cdata, NULL, NULL,
&grub2_estatus, error))
goto out;
if (!g_spawn_check_exit_status (grub2_estatus, error))
{
g_prefix_error (error, "%s: ", grub_argv[0]);
goto out;
}
/* Now let's fdatasync() for the new file */
{ glnx_fd_close int new_config_fd = open (gs_file_get_path_cached (new_config_path), O_RDONLY | O_CLOEXEC);

View File

@ -24,6 +24,9 @@
G_BEGIN_DECLS
/* It's what gzip does, 9 is too slow */
#define OSTREE_ARCHIVE_DEFAULT_COMPRESSION_LEVEL (6)
/* This file contains private implementation data format definitions
* read by multiple implementation .c files.
*/
@ -143,4 +146,16 @@ _ostree_detached_metadata_append_gpg_sig (GVariant *existing_metadata,
GFile *
_ostree_get_default_sysroot_path (void);
_OSTREE_PUBLIC
gboolean
_ostree_raw_file_to_archive_stream (GInputStream *input,
GFileInfo *file_info,
GVariant *xattrs,
guint compression_level,
GInputStream **out_input,
GCancellable *cancellable,
GError **error);
G_END_DECLS

View File

@ -453,6 +453,34 @@ header_and_input_to_stream (GVariant *file_header,
return TRUE;
}
gboolean
_ostree_raw_file_to_archive_stream (GInputStream *input,
GFileInfo *file_info,
GVariant *xattrs,
guint compression_level,
GInputStream **out_input,
GCancellable *cancellable,
GError **error)
{
g_autoptr(GVariant) file_header = NULL;
g_autoptr(GInputStream) zlib_input = NULL;
file_header = _ostree_zlib_file_header_new (file_info, xattrs);
if (input != NULL)
{
g_autoptr(GConverter) zlib_compressor = NULL;
zlib_compressor = G_CONVERTER (g_zlib_compressor_new (G_ZLIB_COMPRESSOR_FORMAT_RAW, compression_level));
zlib_input = g_converter_input_stream_new (input, zlib_compressor);
}
return header_and_input_to_stream (file_header,
zlib_input,
out_input,
NULL,
cancellable,
error);
}
/**
* ostree_raw_file_to_archive_z2_stream:
* @input: File raw content stream
@ -473,23 +501,49 @@ ostree_raw_file_to_archive_z2_stream (GInputStream *input,
GCancellable *cancellable,
GError **error)
{
g_autoptr(GVariant) file_header = NULL;
g_autoptr(GInputStream) zlib_input = NULL;
file_header = _ostree_zlib_file_header_new (file_info, xattrs);
if (input != NULL)
{
g_autoptr(GConverter) zlib_compressor = NULL;
zlib_compressor = G_CONVERTER (g_zlib_compressor_new (G_ZLIB_COMPRESSOR_FORMAT_RAW, 9));
zlib_input = g_converter_input_stream_new (input, zlib_compressor);
return _ostree_raw_file_to_archive_stream (input, file_info, xattrs,
OSTREE_ARCHIVE_DEFAULT_COMPRESSION_LEVEL,
out_input, cancellable, error);
}
return header_and_input_to_stream (file_header,
zlib_input,
out_input,
NULL,
cancellable,
error);
/**
* ostree_raw_file_to_archive_z2_stream_with_options:
* @input: File raw content stream
* @file_info: A file info
* @xattrs: (allow-none): Optional extended attributes
* @options: (nullable): A GVariant `a{sv}` with an extensible set of flags
* @out_input: (out): Serialized object stream
* @cancellable: Cancellable
* @error: Error
*
* Like ostree_raw_file_to_archive_z2_stream(), but supports an extensible set
* of flags. The following flags are currently defined:
*
* - `compression-level` (`i`): Level of compression to use, 09, with 0 being
* the least compression, and <0 giving the default level (currently 6).
*
* Since: 2017.3
*/
gboolean
ostree_raw_file_to_archive_z2_stream_with_options (GInputStream *input,
GFileInfo *file_info,
GVariant *xattrs,
GVariant *options,
GInputStream **out_input,
GCancellable *cancellable,
GError **error)
{
gint compression_level = -1;
if (options)
(void) g_variant_lookup (options, "compression-level", "i", &compression_level);
if (compression_level < 0)
compression_level = OSTREE_ARCHIVE_DEFAULT_COMPRESSION_LEVEL;
return _ostree_raw_file_to_archive_stream (input, file_info, xattrs,
compression_level,
out_input, cancellable, error);
}
/**

View File

@ -311,6 +311,16 @@ ostree_raw_file_to_archive_z2_stream (GInputStream *input,
GCancellable *cancellable,
GError **error);
_OSTREE_PUBLIC
gboolean
ostree_raw_file_to_archive_z2_stream_with_options (GInputStream *input,
GFileInfo *file_info,
GVariant *xattrs,
GVariant *options,
GInputStream **out_input,
GCancellable *cancellable,
GError **error);
_OSTREE_PUBLIC
gboolean ostree_raw_file_to_content_stream (GInputStream *input,
GFileInfo *file_info,

View File

@ -1,86 +0,0 @@
/* Generated data (by glib-mkenums) */
/*
* Copyright (C) 2015 Red Hat, 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.
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <string.h>
#include "ostree-enumtypes.h"
/* enumerations from "./src/libostree/ostree-fetcher.h" */
#include "./src/libostree/ostree-fetcher.h"
GType
_ostree_fetcher_config_flags_get_type (void)
{
static volatile gsize the_type__volatile = 0;
if (g_once_init_enter (&the_type__volatile))
{
static const GFlagsValue values[] = {
{ OSTREE_FETCHER_FLAGS_NONE,
"OSTREE_FETCHER_FLAGS_NONE",
"none" },
{ OSTREE_FETCHER_FLAGS_TLS_PERMISSIVE,
"OSTREE_FETCHER_FLAGS_TLS_PERMISSIVE",
"tls-permissive" },
{ 0, NULL, NULL }
};
GType the_type = g_flags_register_static (
g_intern_static_string ("OstreeFetcherConfigFlags"),
values);
g_once_init_leave (&the_type__volatile, the_type);
}
return the_type__volatile;
}
GType
_ostree_fetcher_request_flags_get_type (void)
{
static volatile gsize the_type__volatile = 0;
if (g_once_init_enter (&the_type__volatile))
{
static const GFlagsValue values[] = {
{ OSTREE_FETCHER_REQUEST_NUL_TERMINATION,
"OSTREE_FETCHER_REQUEST_NUL_TERMINATION",
"termination" },
{ 0, NULL, NULL }
};
GType the_type = g_flags_register_static (
g_intern_static_string ("OstreeFetcherRequestFlags"),
values);
g_once_init_leave (&the_type__volatile, the_type);
}
return the_type__volatile;
}
/* Generated data ends here */

View File

@ -0,0 +1,941 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2016 Colin Walters <walters@verbum.org>
*
* 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.
*/
#include "config.h"
#include <gio/gfiledescriptorbased.h>
#include <gio/gunixoutputstream.h>
#include <glib-unix.h>
#include <curl/curl.h>
/* These macros came from 7.43.0, but we want to check
* for versions a bit earlier than that (to work on CentOS 7),
* so define them here if we're using an older version.
*/
#ifndef CURL_VERSION_BITS
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
#endif
#ifndef CURL_AT_LEAST_VERSION
#define CURL_AT_LEAST_VERSION(x,y,z) (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
#endif
#include "ostree-fetcher.h"
#include "ostree-fetcher-util.h"
#include "ostree-enumtypes.h"
#include "ostree-repo-private.h"
#include "otutil.h"
#include "ostree-soup-uri.h"
typedef struct FetcherRequest FetcherRequest;
typedef struct SockInfo SockInfo;
static int sock_cb (CURL *e, curl_socket_t s, int what, void *cbp, void *sockp);
static gboolean timer_cb (gpointer data);
static void sock_unref (SockInfo *f);
static int update_timeout_cb (CURLM *multi, long timeout_ms, void *userp);
static void request_unref (FetcherRequest *req);
static void initiate_next_curl_request (FetcherRequest *req, GTask *task);
static void destroy_and_unref_source (GSource *source);
struct OstreeFetcher
{
GObject parent_instance;
OstreeFetcherConfigFlags config_flags;
char *remote_name;
char *tls_ca_db_path;
char *tls_client_cert_path;
char *tls_client_key_path;
char *cookie_jar_path;
char *proxy;
struct curl_slist *extra_headers;
int tmpdir_dfd;
GMainContext *mainctx;
CURLM *multi;
GSource *timer_event;
int curl_running;
GHashTable *outstanding_requests; /* Set<GTask> */
GHashTable *sockets; /* Set<SockInfo> */
guint64 bytes_transferred;
};
/* Information associated with a request */
struct FetcherRequest {
guint refcount;
GPtrArray *mirrorlist;
guint idx;
char *filename;
guint64 current_size;
guint64 max_size;
OstreeFetcherRequestFlags flags;
gboolean is_membuf;
GError *caught_write_error;
char *out_tmpfile;
int out_tmpfile_fd;
GString *output_buf;
CURL *easy;
char error[CURL_ERROR_SIZE];
OstreeFetcher *fetcher;
};
/* Information associated with a specific socket */
struct SockInfo {
guint refcount;
curl_socket_t sockfd;
int action;
long timeout;
GSource *ch;
OstreeFetcher *fetcher;
};
enum {
PROP_0,
PROP_CONFIG_FLAGS
};
G_DEFINE_TYPE (OstreeFetcher, _ostree_fetcher, G_TYPE_OBJECT)
static void
_ostree_fetcher_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
OstreeFetcher *self = OSTREE_FETCHER (object);
switch (prop_id)
{
case PROP_CONFIG_FLAGS:
self->config_flags = g_value_get_flags (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
_ostree_fetcher_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
OstreeFetcher *self = OSTREE_FETCHER (object);
switch (prop_id)
{
case PROP_CONFIG_FLAGS:
g_value_set_flags (value, self->config_flags);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
_ostree_fetcher_finalize (GObject *object)
{
OstreeFetcher *self = OSTREE_FETCHER (object);
g_free (self->remote_name);
g_free (self->cookie_jar_path);
g_free (self->proxy);
g_assert_cmpint (g_hash_table_size (self->outstanding_requests), ==, 0);
g_clear_pointer (&self->extra_headers, (GDestroyNotify)curl_slist_free_all);
g_hash_table_unref (self->outstanding_requests);
g_hash_table_unref (self->sockets);
g_clear_pointer (&self->timer_event, (GDestroyNotify)destroy_and_unref_source);
if (self->mainctx)
g_main_context_unref (self->mainctx);
curl_multi_cleanup (self->multi);
G_OBJECT_CLASS (_ostree_fetcher_parent_class)->finalize (object);
}
static void
_ostree_fetcher_constructed (GObject *object)
{
// OstreeFetcher *self = OSTREE_FETCHER (object);
G_OBJECT_CLASS (_ostree_fetcher_parent_class)->constructed (object);
}
static void
_ostree_fetcher_class_init (OstreeFetcherClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->set_property = _ostree_fetcher_set_property;
gobject_class->get_property = _ostree_fetcher_get_property;
gobject_class->finalize = _ostree_fetcher_finalize;
gobject_class->constructed = _ostree_fetcher_constructed;
g_object_class_install_property (gobject_class,
PROP_CONFIG_FLAGS,
g_param_spec_flags ("config-flags",
"",
"",
OSTREE_TYPE_FETCHER_CONFIG_FLAGS,
OSTREE_FETCHER_FLAGS_NONE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
}
static void
_ostree_fetcher_init (OstreeFetcher *self)
{
self->multi = curl_multi_init();
self->outstanding_requests = g_hash_table_new_full (NULL, NULL, (GDestroyNotify)g_object_unref, NULL);
self->sockets = g_hash_table_new_full (NULL, NULL, (GDestroyNotify)sock_unref, NULL);
curl_multi_setopt (self->multi, CURLMOPT_SOCKETFUNCTION, sock_cb);
curl_multi_setopt (self->multi, CURLMOPT_SOCKETDATA, self);
curl_multi_setopt (self->multi, CURLMOPT_TIMERFUNCTION, update_timeout_cb);
curl_multi_setopt (self->multi, CURLMOPT_TIMERDATA, self);
#if CURL_AT_LEAST_VERSION(7, 30, 0)
/* Let's do something reasonable here. */
curl_multi_setopt (self->multi, CURLMOPT_MAX_TOTAL_CONNECTIONS, 8);
#endif
}
OstreeFetcher *
_ostree_fetcher_new (int tmpdir_dfd,
const char *remote_name,
OstreeFetcherConfigFlags flags)
{
OstreeFetcher *fetcher = g_object_new (OSTREE_TYPE_FETCHER, "config-flags", flags, NULL);
fetcher->remote_name = g_strdup (remote_name);
fetcher->tmpdir_dfd = tmpdir_dfd;
return fetcher;
}
static void
destroy_and_unref_source (GSource *source)
{
g_source_destroy (source);
g_source_unref (source);
}
static char *
request_get_uri (FetcherRequest *req, guint idx)
{
SoupURI *baseuri = req->mirrorlist->pdata[idx];
if (!req->filename)
return soup_uri_to_string (baseuri, FALSE);
{ g_autofree char *uristr = soup_uri_to_string (baseuri, FALSE);
return g_build_filename (uristr, req->filename, NULL);
}
}
static gboolean
ensure_tmpfile (FetcherRequest *req, GError **error)
{
if (req->out_tmpfile_fd == -1)
{
if (!glnx_open_tmpfile_linkable_at (req->fetcher->tmpdir_dfd, ".",
O_WRONLY, &req->out_tmpfile_fd,
&req->out_tmpfile,
error))
return FALSE;
}
return TRUE;
}
/* Check for completed transfers, and remove their easy handles */
static void
check_multi_info (OstreeFetcher *fetcher)
{
CURLMsg *msg;
int msgs_left;
while ((msg = curl_multi_info_read (fetcher->multi, &msgs_left)) != NULL)
{
long response;
CURL *easy = msg->easy_handle;
CURLcode curlres = msg->data.result;
GTask *task;
FetcherRequest *req;
const char *eff_url;
gboolean is_file;
gboolean continued_request = FALSE;
if (msg->msg != CURLMSG_DONE)
continue;
curl_easy_getinfo (easy, CURLINFO_PRIVATE, &task);
curl_easy_getinfo (easy, CURLINFO_EFFECTIVE_URL, &eff_url);
/* We should have limited the protocols; this is what
* curl's tool_operate.c does.
*/
is_file = g_str_has_prefix (eff_url, "file:");
g_assert (is_file || g_str_has_prefix (eff_url, "http"));
req = g_task_get_task_data (task);
if (req->caught_write_error)
g_task_return_error (task, g_steal_pointer (&req->caught_write_error));
else if (curlres != CURLE_OK)
{
if (is_file && curlres == CURLE_FILE_COULDNT_READ_FILE)
{
/* Handle file not found */
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
"%s",
curl_easy_strerror (curlres));
}
else
{
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, "[%u] %s",
curlres,
curl_easy_strerror (curlres));
if (req->fetcher->remote_name)
_ostree_fetcher_journal_failure (req->fetcher->remote_name,
eff_url, curl_easy_strerror (curlres));
}
}
else
{
curl_easy_getinfo (easy, CURLINFO_RESPONSE_CODE, &response);
if (!is_file && !(response >= 200 && response < 300))
{
GIOErrorEnum giocode;
/* TODO - share with soup */
switch (response)
{
case 404:
case 403:
case 410:
giocode = G_IO_ERROR_NOT_FOUND;
break;
default:
giocode = G_IO_ERROR_FAILED;
}
if (req->idx + 1 == req->mirrorlist->len)
{
g_autofree char *msg = g_strdup_printf ("Server returned HTTP %lu", response);
g_task_return_new_error (task, G_IO_ERROR, giocode,
"%s", msg);
if (req->fetcher->remote_name)
_ostree_fetcher_journal_failure (req->fetcher->remote_name,
eff_url, msg);
}
else
{
continued_request = TRUE;
}
}
else if (req->is_membuf)
{
GBytes *ret;
if ((req->flags & OSTREE_FETCHER_REQUEST_NUL_TERMINATION) > 0)
g_string_append_c (req->output_buf, '\0');
ret = g_string_free_to_bytes (req->output_buf);
req->output_buf = NULL;
g_task_return_pointer (task, ret, (GDestroyNotify)g_bytes_unref);
}
else
{
g_autoptr(GError) local_error = NULL;
GError **error = &local_error;
/* TODO - share file naming with soup, and fix it */
g_autofree char *tmpfile_path =
g_compute_checksum_for_string (G_CHECKSUM_SHA256,
eff_url, strlen (eff_url));
if (!ensure_tmpfile (req, error))
{
g_task_return_error (task, g_steal_pointer (&local_error));
}
else if (fchmod (req->out_tmpfile_fd, 0644) < 0)
{
glnx_set_error_from_errno (error);
g_task_return_error (task, g_steal_pointer (&local_error));
}
else if (!glnx_link_tmpfile_at (fetcher->tmpdir_dfd,
GLNX_LINK_TMPFILE_REPLACE,
req->out_tmpfile_fd,
req->out_tmpfile,
fetcher->tmpdir_dfd,
tmpfile_path,
error))
g_task_return_error (task, g_steal_pointer (&local_error));
else
{
g_task_return_pointer (task, g_steal_pointer (&tmpfile_path), g_free);
}
}
}
curl_multi_remove_handle (fetcher->multi, easy);
if (continued_request)
{
req->idx++;
initiate_next_curl_request (req, task);
}
else
{
g_hash_table_remove (fetcher->outstanding_requests, task);
if (g_hash_table_size (fetcher->outstanding_requests) == 0)
{
g_clear_pointer (&fetcher->mainctx, g_main_context_unref);
}
}
}
}
/* Called by glib when our timeout expires */
static gboolean
timer_cb (gpointer data)
{
OstreeFetcher *fetcher = data;
CURLMcode rc;
GSource *orig_src = fetcher->timer_event;
rc = curl_multi_socket_action (fetcher->multi, CURL_SOCKET_TIMEOUT, 0, &fetcher->curl_running);
g_assert (rc == CURLM_OK);
check_multi_info (fetcher);
if (fetcher->timer_event == orig_src)
fetcher->timer_event = NULL;
return FALSE;
}
/* Update the event timer after curl_multi library calls */
static int
update_timeout_cb (CURLM *multi, long timeout_ms, void *userp)
{
OstreeFetcher *fetcher = userp;
g_clear_pointer (&fetcher->timer_event, (GDestroyNotify)destroy_and_unref_source);
if (timeout_ms != -1)
{
fetcher->timer_event = g_timeout_source_new (timeout_ms);
g_source_set_callback (fetcher->timer_event, timer_cb, fetcher, NULL);
g_source_attach (fetcher->timer_event, fetcher->mainctx);
}
return 0;
}
/* Called by glib when we get action on a multi socket */
static gboolean
event_cb (int fd, GIOCondition condition, gpointer data)
{
OstreeFetcher *fetcher = data;
CURLMcode rc;
int action =
(condition & G_IO_IN ? CURL_CSELECT_IN : 0) |
(condition & G_IO_OUT ? CURL_CSELECT_OUT : 0);
rc = curl_multi_socket_action (fetcher->multi, fd, action, &fetcher->curl_running);
g_assert (rc == CURLM_OK);
check_multi_info (fetcher);
if (fetcher->curl_running > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}
/* Clean up the SockInfo structure */
static void
sock_unref (SockInfo *f)
{
if (!f)
return;
if (--f->refcount != 0)
return;
g_clear_pointer (&f->ch, (GDestroyNotify)destroy_and_unref_source);
g_free (f);
}
/* Assign information to a SockInfo structure */
static void
setsock (SockInfo*f, curl_socket_t s, int act, OstreeFetcher *fetcher)
{
GIOCondition kind =
(act&CURL_POLL_IN?G_IO_IN:0)|(act&CURL_POLL_OUT?G_IO_OUT:0);
f->sockfd = s;
f->action = act;
g_clear_pointer (&f->ch, (GDestroyNotify)destroy_and_unref_source);
/* TODO - investigate new g_source_modify_unix_fd() so changing the poll
* flags involves less allocation.
*/
f->ch = g_unix_fd_source_new (f->sockfd, kind);
g_source_set_callback (f->ch, (GSourceFunc) event_cb, fetcher, NULL);
g_source_attach (f->ch, fetcher->mainctx);
}
/* Initialize a new SockInfo structure */
static void
addsock (curl_socket_t s, CURL *easy, int action, OstreeFetcher *fetcher)
{
SockInfo *fdp = g_new0 (SockInfo, 1);
fdp->refcount = 1;
fdp->fetcher = fetcher;
setsock (fdp, s, action, fetcher);
curl_multi_assign (fetcher->multi, s, fdp);
g_hash_table_add (fetcher->sockets, fdp);
}
/* CURLMOPT_SOCKETFUNCTION */
static int
sock_cb (CURL *easy, curl_socket_t s, int what, void *cbp, void *sockp)
{
OstreeFetcher *fetcher = cbp;
SockInfo *fdp = (SockInfo*) sockp;
if (what == CURL_POLL_REMOVE)
{
if (!g_hash_table_remove (fetcher->sockets, fdp))
g_assert_not_reached ();
}
else
{
if (!fdp)
{
addsock (s, easy, what, fetcher);
}
else
{
setsock (fdp, s, what, fetcher);
}
}
return 0;
}
/* CURLOPT_WRITEFUNCTION */
static size_t
write_cb (void *ptr, size_t size, size_t nmemb, void *data)
{
const size_t realsize = size * nmemb;
GTask *task = data;
FetcherRequest *req;
req = g_task_get_task_data (task);
if (req->caught_write_error)
return -1;
if (req->max_size > 0)
{
if (realsize > req->max_size ||
(realsize + req->current_size) > req->max_size)
{
const char *eff_url;
curl_easy_getinfo (req->easy, CURLINFO_EFFECTIVE_URL, &eff_url);
req->caught_write_error = g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED,
"URI %s exceeded maximum size of %" G_GUINT64_FORMAT " bytes",
eff_url, req->max_size);
return -1;
}
}
if (req->is_membuf)
g_string_append_len (req->output_buf, ptr, realsize);
else
{
if (!ensure_tmpfile (req, &req->caught_write_error))
return -1;
g_assert (req->out_tmpfile_fd >= 0);
if (glnx_loop_write (req->out_tmpfile_fd, ptr, realsize) < 0)
{
glnx_set_error_from_errno (&req->caught_write_error);
return -1;
}
}
req->current_size += realsize;
req->fetcher->bytes_transferred += realsize;
return realsize;
}
/* CURLOPT_PROGRESSFUNCTION */
static int
prog_cb (void *p, double dltotal, double dlnow, double ult, double uln)
{
GTask *task = p;
FetcherRequest *req;
char *eff_url;
req = g_task_get_task_data (task);
curl_easy_getinfo (req->easy, CURLINFO_EFFECTIVE_URL, &eff_url);
g_printerr ("Progress: %s (%g/%g)\n", eff_url, dlnow, dltotal);
return 0;
}
static void
request_unref (FetcherRequest *req)
{
if (--req->refcount != 0)
return;
g_ptr_array_unref (req->mirrorlist);
g_free (req->filename);
g_clear_error (&req->caught_write_error);
if (req->out_tmpfile_fd != -1)
(void) close (req->out_tmpfile_fd);
g_free (req->out_tmpfile);
if (req->output_buf)
g_string_free (req->output_buf, TRUE);
curl_easy_cleanup (req->easy);
g_free (req);
}
int
_ostree_fetcher_get_dfd (OstreeFetcher *fetcher)
{
return fetcher->tmpdir_dfd;
}
void
_ostree_fetcher_set_proxy (OstreeFetcher *self,
const char *http_proxy)
{
g_free (self->proxy);
self->proxy = g_strdup (http_proxy);
}
void
_ostree_fetcher_set_cookie_jar (OstreeFetcher *self,
const char *jar_path)
{
g_free (self->cookie_jar_path);
self->cookie_jar_path = g_strdup (jar_path);
}
void
_ostree_fetcher_set_client_cert (OstreeFetcher *self,
const char *cert_path,
const char *key_path)
{
g_assert ((cert_path == NULL && key_path == NULL)
|| (cert_path != NULL && key_path != NULL));
g_free (self->tls_client_cert_path);
self->tls_client_cert_path = g_strdup (cert_path);
g_free (self->tls_client_key_path);
self->tls_client_key_path = g_strdup (key_path);
}
void
_ostree_fetcher_set_tls_database (OstreeFetcher *self,
const char *dbpath)
{
g_free (self->tls_ca_db_path);
self->tls_ca_db_path = g_strdup (dbpath);
}
void
_ostree_fetcher_set_extra_headers (OstreeFetcher *self,
GVariant *extra_headers)
{
GVariantIter viter;
const char *key;
const char *value;
g_clear_pointer (&self->extra_headers, (GDestroyNotify)curl_slist_free_all);
g_variant_iter_init (&viter, extra_headers);
while (g_variant_iter_loop (&viter, "(&s&s)", &key, &value))
{
g_autofree char *header = g_strdup_printf ("%s: %s", key, value);
self->extra_headers = curl_slist_append (self->extra_headers, header);
}
}
/* Re-bind all of the outstanding curl items to our new main context */
static void
adopt_steal_mainctx (OstreeFetcher *self,
GMainContext *mainctx)
{
GHashTableIter hiter;
gpointer key, value;
g_assert (self->mainctx == NULL);
self->mainctx = mainctx; /* Transfer */
if (self->timer_event != NULL)
{
guint64 readytime = g_source_get_ready_time (self->timer_event);
guint64 curtime = g_source_get_time (self->timer_event);
guint64 timeout_micros = curtime - readytime;
if (timeout_micros < 0)
timeout_micros = 0;
update_timeout_cb (self->multi, timeout_micros / 1000, self);
}
g_hash_table_iter_init (&hiter, self->sockets);
while (g_hash_table_iter_next (&hiter, &key, &value))
{
SockInfo *fdp = key;
setsock (fdp, fdp->sockfd, fdp->action, self);
}
}
static void
initiate_next_curl_request (FetcherRequest *req,
GTask *task)
{
CURLMcode rc;
OstreeFetcher *self = req->fetcher;
if (req->easy)
curl_easy_cleanup (req->easy);
req->easy = curl_easy_init ();
g_assert (req->easy);
g_assert_cmpint (req->idx, <, req->mirrorlist->len);
{ g_autofree char *uri = request_get_uri (req, req->idx);
curl_easy_setopt (req->easy, CURLOPT_URL, uri);
}
curl_easy_setopt (req->easy, CURLOPT_USERAGENT, "ostree ");
if (self->extra_headers)
curl_easy_setopt (req->easy, CURLOPT_HTTPHEADER, self->extra_headers);
if (self->cookie_jar_path)
{
rc = curl_easy_setopt (req->easy, CURLOPT_COOKIEFILE, self->cookie_jar_path);
g_assert_cmpint (rc, ==, CURLM_OK);
rc = curl_easy_setopt (req->easy, CURLOPT_COOKIELIST, "RELOAD");
g_assert_cmpint (rc, ==, CURLM_OK);
}
if (self->proxy)
{
rc = curl_easy_setopt (req->easy, CURLOPT_PROXY, self->proxy);
g_assert_cmpint (rc, ==, CURLM_OK);
}
if (self->tls_ca_db_path)
curl_easy_setopt (req->easy, CURLOPT_CAINFO, self->tls_ca_db_path);
if ((self->config_flags & OSTREE_FETCHER_FLAGS_TLS_PERMISSIVE) > 0)
curl_easy_setopt (req->easy, CURLOPT_SSL_VERIFYPEER, 0L);
if (self->tls_client_cert_path)
{
curl_easy_setopt (req->easy, CURLOPT_SSLCERT, self->tls_client_cert_path);
curl_easy_setopt (req->easy, CURLOPT_SSLKEY, self->tls_client_key_path);
}
/* We should only speak HTTP; TODO: only enable file if specified */
curl_easy_setopt (req->easy, CURLOPT_PROTOCOLS, (long)(CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FILE));
/* Picked the current version in F25 as of 20170127, since
* there are numerous HTTP/2 fixes since the original version in
* libcurl 7.43.0.
*/
#if CURL_AT_LEAST_VERSION(7, 51, 0)
curl_easy_setopt (req->easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
#endif
curl_easy_setopt (req->easy, CURLOPT_WRITEFUNCTION, write_cb);
if (g_getenv ("OSTREE_DEBUG_HTTP"))
curl_easy_setopt (req->easy, CURLOPT_VERBOSE, 1L);
curl_easy_setopt (req->easy, CURLOPT_ERRORBUFFER, req->error);
/* Note that the "easy" object's privdata is the task */
curl_easy_setopt (req->easy, CURLOPT_NOPROGRESS, 1L);
curl_easy_setopt (req->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
curl_easy_setopt (req->easy, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt (req->easy, CURLOPT_CONNECTTIMEOUT, 30L);
curl_easy_setopt (req->easy, CURLOPT_LOW_SPEED_LIMIT, 1L);
curl_easy_setopt (req->easy, CURLOPT_LOW_SPEED_TIME, 30L);
/* closure bindings -> task */
curl_easy_setopt (req->easy, CURLOPT_PRIVATE, task);
curl_easy_setopt (req->easy, CURLOPT_WRITEDATA, task);
curl_easy_setopt (req->easy, CURLOPT_PROGRESSDATA, task);
rc = curl_multi_add_handle (self->multi, req->easy);
g_assert (rc == CURLM_OK);
}
static void
_ostree_fetcher_request_async (OstreeFetcher *self,
GPtrArray *mirrorlist,
const char *filename,
OstreeFetcherRequestFlags flags,
gboolean is_membuf,
guint64 max_size,
int priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_autoptr(GTask) task = NULL;
FetcherRequest *req;
g_autoptr(GMainContext) mainctx = g_main_context_ref_thread_default ();
/* We don't support multiple concurrent main contexts; take
* a ref to the first one, and require that later invocations
* share it.
*/
if (g_hash_table_size (self->outstanding_requests) == 0
&& mainctx != self->mainctx)
{
adopt_steal_mainctx (self, g_steal_pointer (&mainctx));
}
else
{
g_assert (self->mainctx == mainctx);
}
req = g_new0 (FetcherRequest, 1);
req->refcount = 1;
req->error[0]='\0';
req->fetcher = self;
req->mirrorlist = g_ptr_array_ref (mirrorlist);
req->filename = g_strdup (filename);
req->max_size = max_size;
req->flags = flags;
req->is_membuf = is_membuf;
/* We'll allocate the tmpfile on demand, so we handle
* file I/O errors just in the write func.
*/
req->out_tmpfile_fd = -1;
if (req->is_membuf)
req->output_buf = g_string_new ("");
task = g_task_new (self, cancellable, callback, user_data);
/* We'll use the GTask priority for our own priority queue. */
g_task_set_priority (task, priority);
g_task_set_source_tag (task, _ostree_fetcher_request_async);
g_task_set_task_data (task, req, (GDestroyNotify) request_unref);
initiate_next_curl_request (req, task);
g_hash_table_add (self->outstanding_requests, g_steal_pointer (&task));
/* Sanity check, I added * 2 just so we don't abort if something odd happens,
* but we do want to abort if we're asked to do obviously too many requests.
*/
g_assert_cmpint (g_hash_table_size (self->outstanding_requests), <,
_OSTREE_MAX_OUTSTANDING_FETCHER_REQUESTS * 2);
}
void
_ostree_fetcher_request_to_tmpfile (OstreeFetcher *self,
GPtrArray *mirrorlist,
const char *filename,
guint64 max_size,
int priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
_ostree_fetcher_request_async (self, mirrorlist, filename, 0, FALSE,
max_size, priority, cancellable,
callback, user_data);
}
gboolean
_ostree_fetcher_request_to_tmpfile_finish (OstreeFetcher *self,
GAsyncResult *result,
char **out_filename,
GError **error)
{
GTask *task;
FetcherRequest *req;
gpointer ret;
g_return_val_if_fail (g_task_is_valid (result, self), FALSE);
g_return_val_if_fail (g_async_result_is_tagged (result, _ostree_fetcher_request_async), FALSE);
task = (GTask*)result;
req = g_task_get_task_data (task);
ret = g_task_propagate_pointer (task, error);
if (!ret)
return FALSE;
g_assert (!req->is_membuf);
g_assert (out_filename);
*out_filename = ret;
return TRUE;
}
void
_ostree_fetcher_request_to_membuf (OstreeFetcher *self,
GPtrArray *mirrorlist,
const char *filename,
OstreeFetcherRequestFlags flags,
guint64 max_size,
int priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
_ostree_fetcher_request_async (self, mirrorlist, filename, flags, TRUE,
max_size, priority, cancellable,
callback, user_data);
}
gboolean
_ostree_fetcher_request_to_membuf_finish (OstreeFetcher *self,
GAsyncResult *result,
GBytes **out_buf,
GError **error)
{
GTask *task;
FetcherRequest *req;
gpointer ret;
g_return_val_if_fail (g_task_is_valid (result, self), FALSE);
g_return_val_if_fail (g_async_result_is_tagged (result, _ostree_fetcher_request_async), FALSE);
task = (GTask*)result;
req = g_task_get_task_data (task);
ret = g_task_propagate_pointer (task, error);
if (!ret)
return FALSE;
g_assert (req->is_membuf);
g_assert (out_buf);
*out_buf = ret;
return TRUE;
}
guint64
_ostree_fetcher_bytes_transferred (OstreeFetcher *self)
{
return self->bytes_transferred;
}

View File

@ -32,6 +32,7 @@
#include "libglnx.h"
#include "ostree-fetcher.h"
#include "ostree-fetcher-util.h"
#ifdef HAVE_LIBSOUP_CLIENT_CERTS
#include "ostree-tls-cert-interaction.h"
#endif
@ -55,6 +56,7 @@ typedef struct {
GError *initialization_error; /* Any failure to load the db */
int tmpdir_dfd;
char *remote_name;
char *tmpdir_name;
GLnxLockFile tmpdir_lock;
int base_tmpdir_dfd;
@ -62,8 +64,7 @@ typedef struct {
GVariant *extra_headers;
int max_outstanding;
/* Queue for libsoup, see bgo#708591 */
GQueue pending_queue;
/* Our active HTTP requests */
GHashTable *outstanding;
/* Shared across threads; be sure to lock. */
@ -77,9 +78,6 @@ typedef struct {
} ThreadClosure;
static void
session_thread_process_pending_queue (ThreadClosure *thread_closure);
typedef struct {
volatile int ref_count;
@ -172,6 +170,8 @@ thread_closure_unref (ThreadClosure *thread_closure)
g_clear_pointer (&thread_closure->oob_error, g_error_free);
g_free (thread_closure->remote_name);
g_slice_free (ThreadClosure, thread_closure);
}
}
@ -187,18 +187,6 @@ idle_closure_free (IdleClosure *idle_closure)
g_slice_free (IdleClosure, idle_closure);
}
static int
pending_task_compare (gconstpointer a,
gconstpointer b,
gpointer unused)
{
gint priority_a = g_task_get_priority (G_TASK (a));
gint priority_b = g_task_get_priority (G_TASK (b));
return (priority_a == priority_b) ? 0 :
(priority_a < priority_b) ? -1 : 1;
}
static OstreeFetcherPendingURI *
pending_uri_ref (OstreeFetcherPendingURI *pending)
{
@ -403,30 +391,23 @@ static void
on_request_sent (GObject *object, GAsyncResult *result, gpointer user_data);
static void
session_thread_process_pending_queue (ThreadClosure *thread_closure)
start_pending_request (ThreadClosure *thread_closure,
GTask *task)
{
while (g_queue_peek_head (&thread_closure->pending_queue) != NULL &&
g_hash_table_size (thread_closure->outstanding) < thread_closure->max_outstanding)
{
GTask *task;
OstreeFetcherPendingURI *pending;
GCancellable *cancellable;
task = g_queue_pop_head (&thread_closure->pending_queue);
g_assert_cmpint (g_hash_table_size (thread_closure->outstanding), <, thread_closure->max_outstanding);
pending = g_task_get_task_data (task);
cancellable = g_task_get_cancellable (task);
g_hash_table_add (thread_closure->outstanding, pending_uri_ref (pending));
soup_request_send_async (pending->request,
cancellable,
on_request_sent,
g_object_ref (task));
g_object_unref (task);
}
}
static void
@ -547,10 +528,7 @@ session_thread_request_uri (ThreadClosure *thread_closure,
pending->out_tmpfile = tmpfile;
tmpfile = NULL; /* Transfer ownership */
g_queue_insert_sorted (&thread_closure->pending_queue,
g_object_ref (task),
pending_task_compare, NULL);
session_thread_process_pending_queue (thread_closure);
start_pending_request (thread_closure, task);
}
}
@ -578,11 +556,11 @@ ostree_fetcher_session_thread (gpointer data)
/* XXX: Now that we have mirrorlist support, we could make this even smarter
* by spreading requests across mirrors. */
g_object_get (closure->session, "max-conns-per-host", &max_conns, NULL);
if (max_conns < 8)
if (max_conns < _OSTREE_MAX_OUTSTANDING_FETCHER_REQUESTS)
{
/* We download a lot of small objects in ostree, so this
* helps a lot. Also matches what most modern browsers do. */
max_conns = 8;
max_conns = _OSTREE_MAX_OUTSTANDING_FETCHER_REQUESTS;
g_object_set (closure->session,
"max-conns-per-host",
max_conns, NULL);
@ -600,8 +578,6 @@ ostree_fetcher_session_thread (gpointer data)
* unreference all data related to the SoupSession ourself to ensure
* it's freed in the same thread where it was created. */
g_clear_pointer (&closure->outstanding, g_hash_table_unref);
while (!g_queue_is_empty (&closure->pending_queue))
g_object_unref (g_queue_pop_head (&closure->pending_queue));
g_clear_pointer (&closure->session, g_object_unref);
thread_closure_unref (closure);
@ -753,12 +729,13 @@ _ostree_fetcher_init (OstreeFetcher *self)
OstreeFetcher *
_ostree_fetcher_new (int tmpdir_dfd,
const char *remote_name,
OstreeFetcherConfigFlags flags)
{
OstreeFetcher *self;
self = g_object_new (OSTREE_TYPE_FETCHER, "config-flags", flags, NULL);
self->thread_closure->remote_name = g_strdup (remote_name);
self->thread_closure->base_tmpdir_dfd = tmpdir_dfd;
return self;
@ -903,11 +880,6 @@ finish_stream (OstreeFetcherPendingURI *pending,
pending->state = OSTREE_FETCHER_STATE_COMPLETE;
/* Now that we've finished downloading, continue with other queued
* requests.
*/
session_thread_process_pending_queue (pending->thread_closure);
if (!pending->is_membuf)
{
if (stbuf.st_size < pending->content_length)
@ -935,14 +907,13 @@ on_stream_read (GObject *object,
gpointer user_data);
static void
remove_pending_rerun_queue (OstreeFetcherPendingURI *pending)
remove_pending (OstreeFetcherPendingURI *pending)
{
/* Hold a temporary ref to ensure the reference to
* pending->thread_closure is valid.
*/
pending_uri_ref (pending);
g_hash_table_remove (pending->thread_closure->outstanding, pending);
session_thread_process_pending_queue (pending->thread_closure);
pending_uri_unref (pending);
}
@ -976,7 +947,7 @@ on_out_splice_complete (GObject *object,
if (local_error)
{
g_task_return_error (task, local_error);
remove_pending_rerun_queue (pending);
remove_pending (pending);
}
g_object_unref (task);
@ -1018,7 +989,7 @@ on_stream_read (GObject *object,
g_strdup (pending->out_tmpfile),
(GDestroyNotify) g_free);
}
remove_pending_rerun_queue (pending);
remove_pending (pending);
}
else
{
@ -1057,7 +1028,7 @@ on_stream_read (GObject *object,
if (local_error)
{
g_task_return_error (task, local_error);
remove_pending_rerun_queue (pending);
remove_pending (pending);
}
g_object_unref (task);
@ -1096,7 +1067,7 @@ on_request_sent (GObject *object,
g_task_return_pointer (task,
g_strdup (pending->out_tmpfile),
(GDestroyNotify) g_free);
remove_pending_rerun_queue (pending);
remove_pending (pending);
goto out;
}
else if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
@ -1110,13 +1081,14 @@ on_request_sent (GObject *object,
goto out;
(void) g_input_stream_close (pending->request_body, NULL, NULL);
g_queue_insert_sorted (&pending->thread_closure->pending_queue,
g_object_ref (task), pending_task_compare,
NULL);
remove_pending_rerun_queue (pending);
start_pending_request (pending->thread_closure, task);
}
else
{
g_autofree char *uristring
= soup_uri_to_string (soup_request_get_uri (pending->request), FALSE);
GIOErrorEnum code;
switch (msg->status_code)
{
@ -1151,6 +1123,10 @@ on_request_sent (GObject *object,
g_prefix_error (&local_error,
"All %u mirrors failed. Last error was: ",
pending->mirrorlist->len);
if (pending->thread_closure->remote_name)
_ostree_fetcher_journal_failure (pending->thread_closure->remote_name,
uristring, local_error->message);
}
goto out;
}
@ -1204,7 +1180,7 @@ on_request_sent (GObject *object,
if (pending->request_body)
(void) g_input_stream_close (pending->request_body, NULL, NULL);
g_task_return_error (task, local_error);
remove_pending_rerun_queue (pending);
remove_pending (pending);
}
g_object_unref (task);
@ -1368,84 +1344,3 @@ _ostree_fetcher_bytes_transferred (OstreeFetcher *self)
return ret;
}
void
_ostree_fetcher_uri_free (OstreeFetcherURI *uri)
{
if (uri)
soup_uri_free ((SoupURI*)uri);
}
OstreeFetcherURI *
_ostree_fetcher_uri_parse (const char *str,
GError **error)
{
SoupURI *soupuri = soup_uri_new (str);
if (soupuri == NULL)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Failed to parse uri: %s", str);
return NULL;
}
return (OstreeFetcherURI*)soupuri;
}
static OstreeFetcherURI *
_ostree_fetcher_uri_new_path_internal (OstreeFetcherURI *uri,
gboolean extend,
const char *path)
{
SoupURI *newuri = soup_uri_copy ((SoupURI*)uri);
if (path)
{
if (extend)
{
const char *origpath = soup_uri_get_path ((SoupURI*)uri);
g_autofree char *newpath = g_build_filename (origpath, path, NULL);
soup_uri_set_path (newuri, newpath);
}
else
{
soup_uri_set_path (newuri, path);
}
}
return (OstreeFetcherURI*)newuri;
}
OstreeFetcherURI *
_ostree_fetcher_uri_new_path (OstreeFetcherURI *uri,
const char *path)
{
return _ostree_fetcher_uri_new_path_internal (uri, FALSE, path);
}
OstreeFetcherURI *
_ostree_fetcher_uri_new_subpath (OstreeFetcherURI *uri,
const char *subpath)
{
return _ostree_fetcher_uri_new_path_internal (uri, TRUE, subpath);
}
OstreeFetcherURI *
_ostree_fetcher_uri_clone (OstreeFetcherURI *uri)
{
return _ostree_fetcher_uri_new_subpath (uri, NULL);
}
char *
_ostree_fetcher_uri_get_scheme (OstreeFetcherURI *uri)
{
return g_strdup (soup_uri_get_scheme ((SoupURI*)uri));
}
char *
_ostree_fetcher_uri_get_path (OstreeFetcherURI *uri)
{
return g_strdup (soup_uri_get_path ((SoupURI*)uri));
}
char *
_ostree_fetcher_uri_to_string (OstreeFetcherURI *uri)
{
return soup_uri_to_string ((SoupURI*)uri, FALSE);
}

View File

@ -0,0 +1,118 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2011,2017 Colin Walters <walters@verbum.org>
*
* 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.
*
* Author: Colin Walters <walters@verbum.org>
*/
#include "config.h"
#ifdef HAVE_LIBCURL
#include "ostree-soup-uri.h"
#else
#define LIBSOUP_USE_UNSTABLE_REQUEST_API
#include <libsoup/soup.h>
#include <libsoup/soup-requester.h>
#include <libsoup/soup-request-http.h>
#endif
#include "ostree-fetcher.h"
#include "libglnx.h"
void
_ostree_fetcher_uri_free (OstreeFetcherURI *uri)
{
if (uri)
soup_uri_free ((SoupURI*)uri);
}
OstreeFetcherURI *
_ostree_fetcher_uri_parse (const char *str,
GError **error)
{
SoupURI *soupuri = soup_uri_new (str);
if (soupuri == NULL)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Failed to parse uri: %s", str);
return NULL;
}
return (OstreeFetcherURI*)soupuri;
}
static OstreeFetcherURI *
_ostree_fetcher_uri_new_path_internal (OstreeFetcherURI *uri,
gboolean extend,
const char *path)
{
SoupURI *newuri = soup_uri_copy ((SoupURI*)uri);
if (path)
{
if (extend)
{
const char *origpath = soup_uri_get_path ((SoupURI*)uri);
g_autofree char *newpath = g_build_filename (origpath, path, NULL);
soup_uri_set_path (newuri, newpath);
}
else
{
soup_uri_set_path (newuri, path);
}
}
return (OstreeFetcherURI*)newuri;
}
OstreeFetcherURI *
_ostree_fetcher_uri_new_path (OstreeFetcherURI *uri,
const char *path)
{
return _ostree_fetcher_uri_new_path_internal (uri, FALSE, path);
}
OstreeFetcherURI *
_ostree_fetcher_uri_new_subpath (OstreeFetcherURI *uri,
const char *subpath)
{
return _ostree_fetcher_uri_new_path_internal (uri, TRUE, subpath);
}
OstreeFetcherURI *
_ostree_fetcher_uri_clone (OstreeFetcherURI *uri)
{
return _ostree_fetcher_uri_new_subpath (uri, NULL);
}
char *
_ostree_fetcher_uri_get_scheme (OstreeFetcherURI *uri)
{
return g_strdup (soup_uri_get_scheme ((SoupURI*)uri));
}
char *
_ostree_fetcher_uri_get_path (OstreeFetcherURI *uri)
{
return g_strdup (soup_uri_get_path ((SoupURI*)uri));
}
char *
_ostree_fetcher_uri_to_string (OstreeFetcherURI *uri)
{
return soup_uri_to_string ((SoupURI*)uri, FALSE);
}

View File

@ -23,6 +23,10 @@
#include <gio/gfiledescriptorbased.h>
#include <gio/gunixoutputstream.h>
#ifdef HAVE_LIBSYSTEMD
#include <systemd/sd-journal.h>
#endif
#include "ostree-fetcher-util.h"
#include "otutil.h"
@ -122,3 +126,23 @@ _ostree_fetcher_request_uri_to_membuf (OstreeFetcher *fetcher,
out_contents, max_size,
cancellable, error);
}
#define OSTREE_HTTP_FAILURE_ID SD_ID128_MAKE(f0,2b,ce,89,a5,4e,4e,fa,b3,a9,4a,79,7d,26,20,4a)
void
_ostree_fetcher_journal_failure (const char *remote_name,
const char *url,
const char *msg)
{
#ifdef HAVE_LIBSYSTEMD
/* Sanity - we don't want to log this when doing local/file pulls */
if (!remote_name)
return;
sd_journal_send ("MESSAGE=libostree HTTP error from remote %s for <%s>: %s",
remote_name, url, msg,
"MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(OSTREE_HTTP_FAILURE_ID),
"OSTREE_REMOTE=%s", remote_name,
"OSTREE_URL=%s", url,
NULL);
#endif
}

View File

@ -44,6 +44,12 @@ gboolean _ostree_fetcher_request_uri_to_membuf (OstreeFetcher *fetcher,
guint64 max_size,
GCancellable *cancellable,
GError **error);
void _ostree_fetcher_journal_failure (const char *remote_name,
const char *url,
const char *msg);
G_END_DECLS
#endif

View File

@ -82,6 +82,7 @@ _ostree_fetcher_uri_to_string (OstreeFetcherURI *uri);
GType _ostree_fetcher_get_type (void) G_GNUC_CONST;
OstreeFetcher *_ostree_fetcher_new (int tmpdir_dfd,
const char *remote_name,
OstreeFetcherConfigFlags flags);
int _ostree_fetcher_get_dfd (OstreeFetcher *fetcher);

View File

@ -37,6 +37,9 @@ GLNX_DEFINE_CLEANUP_FUNCTION (void *, flatpak_local_free_write_archive, archive_
GLNX_DEFINE_CLEANUP_FUNCTION (void *, flatpak_local_free_read_archive, archive_read_free)
#define ot_cleanup_read_archive __attribute__((cleanup (flatpak_local_free_read_archive)))
#else
#define ot_cleanup_write_archive
#define ot_cleanup_read_archive
#endif
G_END_DECLS

View File

@ -200,10 +200,18 @@ checkout_file_from_input_at (OstreeRepo *self,
destination_dfd, destination_name);
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (res == -1)
{
if (errno == EEXIST && options->overwrite_mode == OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES)
{
ret = TRUE;
goto out;
}
else
{
glnx_set_error_from_errno (error);
goto out;
}
}
if (options->mode != OSTREE_REPO_CHECKOUT_MODE_USER)
{
@ -240,6 +248,11 @@ checkout_file_from_input_at (OstreeRepo *self,
while (G_UNLIKELY (fd == -1 && errno == EINTR));
if (fd == -1)
{
if (errno == EEXIST && options->overwrite_mode == OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES)
{
ret = TRUE;
goto out;
}
glnx_set_error_from_errno (error);
goto out;
}
@ -332,6 +345,12 @@ checkout_file_unioning_from_input_at (OstreeRepo *repo,
return ret;
}
typedef enum {
HARDLINK_RESULT_NOT_SUPPORTED,
HARDLINK_RESULT_SKIP_EXISTED,
HARDLINK_RESULT_LINKED
} HardlinkResult;
static gboolean
checkout_file_hardlink (OstreeRepo *self,
OstreeRepoCheckoutAtOptions *options,
@ -339,28 +358,32 @@ checkout_file_hardlink (OstreeRepo *self,
int destination_dfd,
const char *destination_name,
gboolean allow_noent,
gboolean *out_was_supported,
HardlinkResult *out_result,
GCancellable *cancellable,
GError **error)
{
gboolean ret = FALSE;
gboolean ret_was_supported = FALSE;
HardlinkResult ret_result = HARDLINK_RESULT_NOT_SUPPORTED;
int srcfd = (self->mode == OSTREE_REPO_MODE_BARE || self->mode == OSTREE_REPO_MODE_BARE_USER) ?
self->objects_dir_fd : self->uncompressed_objects_dir_fd;
again:
if (linkat (srcfd, loose_path, destination_dfd, destination_name, 0) != -1)
ret_was_supported = TRUE;
if (linkat (srcfd, loose_path, destination_dfd, destination_name, 0) == 0)
ret_result = HARDLINK_RESULT_LINKED;
else if (!options->no_copy_fallback && (errno == EMLINK || errno == EXDEV || errno == EPERM))
{
/* EMLINK, EXDEV and EPERM shouldn't be fatal; we just can't do the
* optimization of hardlinking instead of copying.
*/
ret_was_supported = FALSE;
}
else if (allow_noent && errno == ENOENT)
{
ret_was_supported = FALSE;
}
else if (errno == EEXIST && options->overwrite_mode == OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES)
{
/* In this mode, we keep existing content. Distinguish this case though to
* avoid inserting into the devino cache.
*/
ret_result = HARDLINK_RESULT_SKIP_EXISTED;
}
else if (errno == EEXIST && options->overwrite_mode == OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES)
{
@ -379,14 +402,12 @@ checkout_file_hardlink (OstreeRepo *self,
{
g_prefix_error (error, "Hardlinking %s to %s: ", loose_path, destination_name);
glnx_set_error_from_errno (error);
goto out;
return FALSE;
}
ret = TRUE;
if (out_was_supported)
*out_was_supported = ret_was_supported;
out:
return ret;
if (out_result)
*out_result = ret_result;
return TRUE;
}
static gboolean
@ -439,7 +460,7 @@ checkout_one_file_at (OstreeRepo *repo,
}
else
{
gboolean did_hardlink = FALSE;
HardlinkResult hardlink_res = HARDLINK_RESULT_NOT_SUPPORTED;
/* Try to do a hardlink first, if it's a regular file. This also
* traverses all parent repos.
*/
@ -469,11 +490,11 @@ checkout_one_file_at (OstreeRepo *repo,
options,
loose_path_buf,
destination_dfd, destination_name,
TRUE, &did_hardlink,
TRUE, &hardlink_res,
cancellable, error))
goto out;
if (did_hardlink && options->devino_to_csum_cache)
if (hardlink_res == HARDLINK_RESULT_LINKED && options->devino_to_csum_cache)
{
struct stat stbuf;
OstreeDevIno *key;
@ -492,13 +513,13 @@ checkout_one_file_at (OstreeRepo *repo,
g_hash_table_add ((GHashTable*)options->devino_to_csum_cache, key);
}
if (did_hardlink)
if (hardlink_res != HARDLINK_RESULT_NOT_SUPPORTED)
break;
}
current_repo = current_repo->parent_repo;
}
need_copy = !did_hardlink;
need_copy = (hardlink_res == HARDLINK_RESULT_NOT_SUPPORTED);
}
can_cache = (options->enable_uncompressed_cache
@ -514,7 +535,7 @@ checkout_one_file_at (OstreeRepo *repo,
&& repo->mode == OSTREE_REPO_MODE_ARCHIVE_Z2
&& options->mode == OSTREE_REPO_CHECKOUT_MODE_USER)
{
gboolean did_hardlink;
HardlinkResult hardlink_res = HARDLINK_RESULT_NOT_SUPPORTED;
if (!ostree_repo_load_file (repo, checksum, &input, NULL, NULL,
cancellable, error))
@ -560,19 +581,20 @@ checkout_one_file_at (OstreeRepo *repo,
if (!checkout_file_hardlink (repo, options, loose_path_buf,
destination_dfd, destination_name,
FALSE, &did_hardlink,
FALSE, &hardlink_res,
cancellable, error))
{
g_prefix_error (error, "Using new cached uncompressed hardlink of %s to %s: ", checksum, destination_name);
goto out;
}
need_copy = !did_hardlink;
need_copy = (hardlink_res == HARDLINK_RESULT_NOT_SUPPORTED);
}
/* Fall back to copy if we couldn't hardlink */
if (need_copy)
{
g_assert (!options->no_copy_fallback);
if (!ostree_repo_load_file (repo, checksum, &input, NULL, &xattrs,
cancellable, error))
goto out;
@ -641,6 +663,8 @@ checkout_tree_at (OstreeRepo *self,
gboolean did_exist = FALSE;
glnx_fd_close int destination_dfd = -1;
int res;
struct stat repo_dfd_stat;
struct stat destination_stat;
g_autoptr(GVariant) xattrs = NULL;
g_autoptr(GFileEnumerator) dir_enum = NULL;
@ -653,7 +677,9 @@ checkout_tree_at (OstreeRepo *self,
while (G_UNLIKELY (res == -1 && errno == EINTR));
if (res == -1)
{
if (errno == EEXIST && options->overwrite_mode == OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES)
if (errno == EEXIST &&
(options->overwrite_mode == OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES
|| options->overwrite_mode == OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES))
did_exist = TRUE;
else
{
@ -666,6 +692,25 @@ checkout_tree_at (OstreeRepo *self,
&destination_dfd, error))
goto out;
if (fstat (self->repo_dir_fd, &repo_dfd_stat) < 0)
{
glnx_set_error_from_errno (error);
goto out;
}
if (fstat (destination_dfd, &destination_stat) < 0)
{
glnx_set_error_from_errno (error);
goto out;
}
if (options->no_copy_fallback && repo_dfd_stat.st_dev != destination_stat.st_dev)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Unable to do hardlink checkout across devices (src=%"G_GUINT64_FORMAT" destination=%"G_GUINT64_FORMAT")",
(guint64)repo_dfd_stat.st_dev, (guint64)destination_stat.st_dev);
goto out;
}
/* Set the xattrs now, so any derived labeling works */
if (!did_exist && options->mode != OSTREE_REPO_CHECKOUT_MODE_USER)
{
@ -902,10 +947,6 @@ ostree_repo_checkout_at (OstreeRepo *self,
GCancellable *cancellable,
GError **error)
{
gboolean ret = FALSE;
g_autoptr(GFile) commit_root = NULL;
g_autoptr(GFile) target_dir = NULL;
g_autoptr(GFileInfo) target_info = NULL;
OstreeRepoCheckoutAtOptions default_options = { 0, };
if (!options)
@ -914,33 +955,33 @@ ostree_repo_checkout_at (OstreeRepo *self,
options = &default_options;
}
commit_root = (GFile*) _ostree_repo_file_new_for_commit (self, commit, error);
g_autoptr(GFile) commit_root = (GFile*) _ostree_repo_file_new_for_commit (self, commit, error);
if (!commit_root)
goto out;
return FALSE;
if (!ostree_repo_file_ensure_resolved ((OstreeRepoFile*)commit_root, error))
goto out;
return FALSE;
g_autoptr(GFile) target_dir = NULL;
if (options->subpath && strcmp (options->subpath, "/") != 0)
target_dir = g_file_get_child (commit_root, options->subpath);
else
target_dir = g_object_ref (commit_root);
target_info = g_file_query_info (target_dir, OSTREE_GIO_FAST_QUERYINFO,
g_autoptr(GFileInfo) target_info =
g_file_query_info (target_dir, OSTREE_GIO_FAST_QUERYINFO,
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
cancellable, error);
if (!target_info)
goto out;
return FALSE;
if (!checkout_tree_at (self, options,
destination_dfd,
destination_path,
(OstreeRepoFile*)target_dir, target_info,
cancellable, error))
goto out;
return FALSE;
ret = TRUE;
out:
return ret;
return TRUE;
}
static guint
@ -994,16 +1035,15 @@ ostree_repo_checkout_gc (OstreeRepo *self,
GCancellable *cancellable,
GError **error)
{
gboolean ret = FALSE;
g_autoptr(GHashTable) to_clean_dirs = NULL;
GHashTableIter iter;
gpointer key, value;
g_mutex_lock (&self->cache_lock);
to_clean_dirs = self->updated_uncompressed_dirs;
self->updated_uncompressed_dirs = g_hash_table_new (NULL, NULL);
g_mutex_unlock (&self->cache_lock);
GHashTableIter iter;
gpointer key, value;
if (to_clean_dirs)
g_hash_table_iter_init (&iter, to_clean_dirs);
while (to_clean_dirs && g_hash_table_iter_next (&iter, &key, &value))
@ -1013,7 +1053,7 @@ ostree_repo_checkout_gc (OstreeRepo *self,
if (!glnx_dirfd_iterator_init_at (self->uncompressed_objects_dir_fd, objdir_name, FALSE,
&dfd_iter, error))
goto out;
return FALSE;
while (TRUE)
{
@ -1021,14 +1061,14 @@ ostree_repo_checkout_gc (OstreeRepo *self,
struct stat stbuf;
if (!glnx_dirfd_iterator_next_dent (&dfd_iter, &dent, cancellable, error))
goto out;
return FALSE;
if (dent == NULL)
break;
if (fstatat (dfd_iter.fd, dent->d_name, &stbuf, AT_SYMLINK_NOFOLLOW) != 0)
{
glnx_set_error_from_errno (error);
goto out;
return FALSE;
}
if (stbuf.st_nlink == 1)
@ -1036,13 +1076,11 @@ ostree_repo_checkout_gc (OstreeRepo *self,
if (unlinkat (dfd_iter.fd, dent->d_name, 0) != 0)
{
glnx_set_error_from_errno (error);
goto out;
return FALSE;
}
}
}
}
ret = TRUE;
out:
return ret;
return TRUE;
}

View File

@ -110,6 +110,30 @@ write_file_metadata_to_xattr (int fd,
return TRUE;
}
/* See https://github.com/ostreedev/ostree/pull/698 */
#ifdef WITH_SMACK
#define XATTR_NAME_SMACK "security.SMACK64"
#endif
static void
ot_security_smack_reset_dfd_name (int dfd, const char *name)
{
#ifdef WITH_SMACK
char buf[PATH_MAX];
/* See glnx-xattrs.c */
snprintf (buf, sizeof (buf), "/proc/self/fd/%d/%s", dfd, name);
(void) lremovexattr (buf, XATTR_NAME_SMACK);
#endif
}
static void
ot_security_smack_reset_fd (int fd)
{
#ifdef WITH_SMACK
(void) fremovexattr (fd, XATTR_NAME_SMACK);
#endif
}
gboolean
_ostree_repo_commit_loose_final (OstreeRepo *self,
const char *checksum,
@ -221,6 +245,7 @@ commit_loose_object_trusted (OstreeRepo *self,
if (xattrs != NULL)
{
ot_security_smack_reset_dfd_name (self->tmp_dir_fd, temp_filename);
if (!glnx_dfd_name_set_all_xattrs (self->tmp_dir_fd, temp_filename,
xattrs, cancellable, error))
goto out;
@ -252,6 +277,7 @@ commit_loose_object_trusted (OstreeRepo *self,
if (xattrs)
{
ot_security_smack_reset_fd (fd);
if (!glnx_fd_set_all_xattrs (fd, xattrs, cancellable, error))
goto out;
}
@ -719,7 +745,7 @@ write_object (OstreeRepo *self,
if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_REGULAR)
{
zlib_compressor = (GConverter*)g_zlib_compressor_new (G_ZLIB_COMPRESSOR_FORMAT_RAW, 9);
zlib_compressor = (GConverter*)g_zlib_compressor_new (G_ZLIB_COMPRESSOR_FORMAT_RAW, self->zlib_compression_level);
compressed_out_stream = g_converter_output_stream_new (temp_out, zlib_compressor);
/* Don't close the base; we'll do that later */
g_filter_output_stream_set_close_base_stream ((GFilterOutputStream*)compressed_out_stream, FALSE);

View File

@ -32,6 +32,17 @@ G_BEGIN_DECLS
#define _OSTREE_SUMMARY_CACHE_DIR "summaries"
#define _OSTREE_CACHE_DIR "cache"
#define _OSTREE_MAX_OUTSTANDING_FETCHER_REQUESTS 8
#define _OSTREE_MAX_OUTSTANDING_DELTAPART_REQUESTS 2
/* In most cases, writing to disk should be much faster than
* fetching from the network, so we shouldn't actually hit
* this. But if using pipelining and e.g. pulling over LAN
* (or writing to slow media), we can have a runaway
* situation towards EMFILE.
* */
#define _OSTREE_MAX_OUTSTANDING_WRITE_REQUESTS 16
typedef enum {
OSTREE_REPO_TEST_ERROR_PRE_COMMIT = (1 << 0)
} OstreeRepoTestErrorFlags;
@ -89,6 +100,7 @@ struct OstreeRepo {
GError *writable_error;
gboolean in_transaction;
gboolean disable_fsync;
guint zlib_compression_level;
GHashTable *loose_object_devino_hash;
GHashTable *updated_uncompressed_dirs;
GHashTable *object_sizes;

View File

@ -26,7 +26,7 @@
#include "ostree.h"
#include "otutil.h"
#ifdef HAVE_LIBSOUP
#ifdef HAVE_LIBCURL_OR_LIBSOUP
#include "ostree-core-private.h"
#include "ostree-repo-private.h"
@ -81,6 +81,10 @@ typedef struct {
GHashTable *scanned_metadata; /* Maps object name to itself */
GHashTable *requested_metadata; /* Maps object name to itself */
GHashTable *requested_content; /* Maps checksum to itself */
GHashTable *requested_fallback_content; /* Maps checksum to itself */
GHashTable *pending_fetch_metadata; /* Map<ObjectName,FetchObjectData> */
GHashTable *pending_fetch_content; /* Map<checksum,FetchObjectData> */
GHashTable *pending_fetch_deltaparts; /* Set<FetchStaticDeltaData> */
guint n_outstanding_metadata_fetches;
guint n_outstanding_metadata_write_requests;
guint n_outstanding_content_fetches;
@ -88,11 +92,14 @@ typedef struct {
guint n_outstanding_deltapart_fetches;
guint n_outstanding_deltapart_write_requests;
guint n_total_deltaparts;
guint n_total_delta_fallbacks;
guint64 fetched_deltapart_size; /* How much of the delta we have now */
guint64 total_deltapart_size;
guint64 total_deltapart_usize;
gint n_requested_metadata;
gint n_requested_content;
guint n_fetched_deltaparts;
guint n_fetched_deltapart_fallbacks;
guint n_fetched_metadata;
guint n_fetched_content;
@ -133,6 +140,10 @@ typedef struct {
OtPullData *pull_data;
GVariant *objects;
char *expected_checksum;
char *from_revision;
char *to_revision;
guint i;
guint64 size;
} FetchStaticDeltaData;
typedef struct {
@ -142,6 +153,10 @@ typedef struct {
guint recursion_depth;
} ScanObjectQueueData;
static void start_fetch (OtPullData *pull_data, FetchObjectData *fetch);
static void start_fetch_deltapart (OtPullData *pull_data,
FetchStaticDeltaData *fetch);
static gboolean fetcher_queue_is_full (OtPullData *pull_data);
static void queue_scan_one_metadata_object (OtPullData *pull_data,
const char *csum,
OstreeObjectType objtype,
@ -199,6 +214,7 @@ update_progress (gpointer user_data)
ostree_async_progress_set_uint (pull_data->progress, "outstanding-writes", outstanding_writes);
ostree_async_progress_set_uint (pull_data->progress, "fetched", fetched);
ostree_async_progress_set_uint (pull_data->progress, "requested", requested);
ostree_async_progress_set_uint (pull_data->progress, "scanning", g_queue_is_empty (&pull_data->scan_object_queue) ? 0 : 1);
ostree_async_progress_set_uint (pull_data->progress, "scanned-metadata", n_scanned_metadata);
ostree_async_progress_set_uint64 (pull_data->progress, "bytes-transferred", bytes_transferred);
ostree_async_progress_set_uint64 (pull_data->progress, "start-time", start_time);
@ -208,6 +224,12 @@ update_progress (gpointer user_data)
pull_data->n_fetched_deltaparts);
ostree_async_progress_set_uint (pull_data->progress, "total-delta-parts",
pull_data->n_total_deltaparts);
ostree_async_progress_set_uint (pull_data->progress, "fetched-delta-fallbacks",
pull_data->n_fetched_deltapart_fallbacks);
ostree_async_progress_set_uint (pull_data->progress, "total-delta-fallbacks",
pull_data->n_total_delta_fallbacks);
ostree_async_progress_set_uint64 (pull_data->progress, "fetched-delta-part-size",
pull_data->fetched_deltapart_size);
ostree_async_progress_set_uint64 (pull_data->progress, "total-delta-part-size",
pull_data->total_deltapart_size);
ostree_async_progress_set_uint64 (pull_data->progress, "total-delta-part-usize",
@ -271,6 +293,88 @@ check_outstanding_requests_handle_error (OtPullData *pull_data,
g_error_free (error);
}
}
else
{
GHashTableIter hiter;
gpointer key, value;
/* We may have just completed an async fetch operation. Now we look at
* possibly enqueuing more requests. The goal of queuing is to both avoid
* overloading the fetcher backend with HTTP requests, but also to
* prioritize metadata fetches over content, so we have accurate
* reporting. Hence here, we process metadata fetches first.
*/
/* Try filling the queue with metadata we need to fetch */
g_hash_table_iter_init (&hiter, pull_data->pending_fetch_metadata);
while (!fetcher_queue_is_full (pull_data) &&
g_hash_table_iter_next (&hiter, &key, &value))
{
GVariant *objname = key;
FetchObjectData *fetch = value;
/* Steal both key and value */
g_hash_table_iter_steal (&hiter);
/* This takes ownership of the value */
start_fetch (pull_data, fetch);
/* And unref the key */
g_variant_unref (objname);
}
/* Now, process deltapart requests */
g_hash_table_iter_init (&hiter, pull_data->pending_fetch_deltaparts);
while (!fetcher_queue_is_full (pull_data) &&
g_hash_table_iter_next (&hiter, &key, &value))
{
FetchStaticDeltaData *fetch = key;
g_hash_table_iter_steal (&hiter);
/* Takes ownership */
start_fetch_deltapart (pull_data, fetch);
}
/* Next, fill the queue with content */
g_hash_table_iter_init (&hiter, pull_data->pending_fetch_content);
while (!fetcher_queue_is_full (pull_data) &&
g_hash_table_iter_next (&hiter, &key, &value))
{
char *checksum = key;
FetchObjectData *fetch = value;
/* Steal both key and value */
g_hash_table_iter_steal (&hiter);
/* This takes ownership of the value */
start_fetch (pull_data, fetch);
/* And unref the key */
g_free (checksum);
}
}
}
/* We have a total-request limit, as well has a hardcoded max of 2 for delta
* parts. The logic for the delta one is that processing them is expensive, and
* doing multiple simultaneously could risk space/memory on smaller devices. We
* also throttle on outstanding writes in case fetches are faster.
*/
static gboolean
fetcher_queue_is_full (OtPullData *pull_data)
{
const gboolean fetch_full =
((pull_data->n_outstanding_metadata_fetches +
pull_data->n_outstanding_content_fetches +
pull_data->n_outstanding_deltapart_fetches) ==
_OSTREE_MAX_OUTSTANDING_FETCHER_REQUESTS);
const gboolean deltas_full =
(pull_data->n_outstanding_deltapart_fetches ==
_OSTREE_MAX_OUTSTANDING_DELTAPART_REQUESTS);
const gboolean writes_full =
((pull_data->n_outstanding_metadata_write_requests +
pull_data->n_outstanding_content_write_requests +
pull_data->n_outstanding_deltapart_write_requests) >=
_OSTREE_MAX_OUTSTANDING_WRITE_REQUESTS);
return fetch_full || deltas_full || writes_full;
}
static gboolean
@ -685,6 +789,9 @@ content_fetch_on_write_complete (GObject *object,
}
pull_data->n_fetched_content++;
/* Was this a delta fallback? */
if (g_hash_table_remove (pull_data->requested_fallback_content, expected_checksum))
pull_data->n_fetched_deltapart_fallbacks++;
out:
pull_data->n_outstanding_content_write_requests--;
check_outstanding_requests_handle_error (pull_data, local_error);
@ -942,6 +1049,8 @@ fetch_static_delta_data_free (gpointer data)
FetchStaticDeltaData *fetch_data = data;
g_free (fetch_data->expected_checksum);
g_variant_unref (fetch_data->objects);
g_free (fetch_data->from_revision);
g_free (fetch_data->to_revision);
g_free (fetch_data);
}
@ -1035,14 +1144,22 @@ process_verify_result (OtPullData *pull_data,
GError **error)
{
if (result == NULL)
{
g_prefix_error (error, "Commit %s: ", checksum);
return FALSE;
}
/* Allow callers to output the results immediately. */
g_signal_emit_by_name (pull_data->repo,
"gpg-verify-result",
checksum, result);
return ostree_gpg_verify_result_require_valid_signature (result, error);
if (!ostree_gpg_verify_result_require_valid_signature (result, error))
{
g_prefix_error (error, "Commit %s: ", checksum);
return FALSE;
}
return TRUE;
}
static gboolean
@ -1060,8 +1177,9 @@ gpg_verify_unwritten_commit (OtPullData *pull_data,
if (!detached_metadata)
{
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"No detached metadata found for GPG verification");
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Commit %s: no detached metadata found for GPG verification",
checksum);
return FALSE;
}
@ -1334,41 +1452,11 @@ enqueue_one_object_request (OtPullData *pull_data,
gboolean is_detached_meta,
gboolean object_is_stored)
{
g_autofree char *obj_subpath = NULL;
gboolean is_meta;
FetchObjectData *fetch_data;
guint64 *expected_max_size_p;
guint64 expected_max_size;
GPtrArray *mirrorlist = NULL;
g_debug ("queuing fetch of %s.%s%s", checksum,
ostree_object_type_to_string (objtype),
is_detached_meta ? " (detached)" : "");
if (is_detached_meta)
{
char buf[_OSTREE_LOOSE_PATH_MAX];
_ostree_loose_path (buf, checksum, OSTREE_OBJECT_TYPE_COMMIT_META, pull_data->remote_mode);
obj_subpath = g_build_filename ("objects", buf, NULL);
mirrorlist = pull_data->meta_mirrorlist;
}
else
{
obj_subpath = _ostree_get_relative_object_path (checksum, objtype, TRUE);
mirrorlist = pull_data->content_mirrorlist;
}
is_meta = OSTREE_OBJECT_TYPE_IS_META (objtype);
if (is_meta)
{
pull_data->n_outstanding_metadata_fetches++;
pull_data->n_requested_metadata++;
}
else
{
pull_data->n_outstanding_content_fetches++;
pull_data->n_requested_content++;
}
fetch_data = g_new0 (FetchObjectData, 1);
fetch_data->pull_data = pull_data;
fetch_data->object = ostree_object_name_serialize (checksum, objtype);
@ -1376,10 +1464,80 @@ enqueue_one_object_request (OtPullData *pull_data,
fetch_data->is_detached_meta = is_detached_meta;
fetch_data->object_is_stored = object_is_stored;
expected_max_size_p = is_detached_meta ? NULL : g_hash_table_lookup (pull_data->expected_commit_sizes, checksum);
if (is_meta)
pull_data->n_requested_metadata++;
else
pull_data->n_requested_content++;
/* Are too many requests are in flight? */
if (fetcher_queue_is_full (pull_data))
{
g_debug ("queuing fetch of %s.%s%s", checksum,
ostree_object_type_to_string (objtype),
is_detached_meta ? " (detached)" : "");
if (is_meta)
{
GVariant *objname = ostree_object_name_serialize (checksum, objtype);
g_hash_table_insert (pull_data->pending_fetch_metadata, objname, fetch_data);
}
else
{
g_hash_table_insert (pull_data->pending_fetch_content, g_strdup (checksum), fetch_data);
}
}
else
{
start_fetch (pull_data, fetch_data);
}
}
static void
start_fetch (OtPullData *pull_data,
FetchObjectData *fetch)
{
gboolean is_meta;
g_autofree char *obj_subpath = NULL;
guint64 *expected_max_size_p;
guint64 expected_max_size;
const char *expected_checksum;
OstreeObjectType objtype;
GPtrArray *mirrorlist = NULL;
ostree_object_name_deserialize (fetch->object, &expected_checksum, &objtype);
is_meta = OSTREE_OBJECT_TYPE_IS_META (objtype);
g_debug ("starting fetch of %s.%s%s", expected_checksum,
ostree_object_type_to_string (objtype),
fetch->is_detached_meta ? " (detached)" : "");
is_meta = OSTREE_OBJECT_TYPE_IS_META (objtype);
if (is_meta)
pull_data->n_outstanding_metadata_fetches++;
else
pull_data->n_outstanding_content_fetches++;
/* Override the path if we're trying to fetch the .commitmeta file first */
if (fetch->is_detached_meta)
{
char buf[_OSTREE_LOOSE_PATH_MAX];
_ostree_loose_path (buf, expected_checksum, OSTREE_OBJECT_TYPE_COMMIT_META, pull_data->remote_mode);
obj_subpath = g_build_filename ("objects", buf, NULL);
mirrorlist = pull_data->meta_mirrorlist;
}
else
{
obj_subpath = _ostree_get_relative_object_path (expected_checksum, objtype, TRUE);
mirrorlist = pull_data->content_mirrorlist;
}
/* We may have determined maximum sizes from the summary file content; if so,
* honor it. Otherwise, metadata has a baseline max size.
*/
expected_max_size_p = fetch->is_detached_meta ? NULL : g_hash_table_lookup (pull_data->expected_commit_sizes, expected_checksum);
if (expected_max_size_p)
expected_max_size = *expected_max_size_p;
else if (is_meta)
else if (OSTREE_OBJECT_TYPE_IS_META (objtype))
expected_max_size = OSTREE_MAX_METADATA_SIZE;
else
expected_max_size = 0;
@ -1389,7 +1547,7 @@ enqueue_one_object_request (OtPullData *pull_data,
is_meta ? OSTREE_REPO_PULL_METADATA_PRIORITY
: OSTREE_REPO_PULL_CONTENT_PRIORITY,
pull_data->cancellable,
is_meta ? meta_fetch_on_complete : content_fetch_on_complete, fetch_data);
is_meta ? meta_fetch_on_complete : content_fetch_on_complete, fetch);
}
static gboolean
@ -1445,15 +1603,10 @@ process_one_static_delta_fallback (OtPullData *pull_data,
compressed_size = maybe_swap_endian_u64 (delta_byteswap, compressed_size);
uncompressed_size = maybe_swap_endian_u64 (delta_byteswap, uncompressed_size);
pull_data->n_total_delta_fallbacks += 1;
pull_data->total_deltapart_size += compressed_size;
pull_data->total_deltapart_usize += uncompressed_size;
if (pull_data->dry_run)
{
ret = TRUE;
goto out;
}
objtype = (OstreeObjectType)objtype_y;
checksum = ostree_checksum_from_bytes_v (csum_v);
@ -1462,28 +1615,37 @@ process_one_static_delta_fallback (OtPullData *pull_data,
cancellable, error))
goto out;
if (is_stored)
pull_data->fetched_deltapart_size += compressed_size;
if (pull_data->dry_run)
{
ret = TRUE;
goto out;
}
if (!is_stored)
{
/* The delta compiler never did this, there's no reason to support it */
if (OSTREE_OBJECT_TYPE_IS_META (objtype))
{
g_autoptr(GVariant) objname = ostree_object_name_serialize (checksum, objtype);
if (!g_hash_table_lookup (pull_data->requested_metadata, objname))
{
gboolean do_fetch_detached;
g_hash_table_add (pull_data->requested_metadata, g_variant_ref (objname));
do_fetch_detached = (objtype == OSTREE_OBJECT_TYPE_COMMIT);
enqueue_one_object_request (pull_data, checksum, objtype, NULL, do_fetch_detached, FALSE);
checksum = NULL; /* Transfer ownership */
}
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Found metadata object as fallback: %s.%s", checksum,
ostree_object_type_to_string (objtype));
goto out;
}
else
{
if (!g_hash_table_lookup (pull_data->requested_content, checksum))
{
/* Mark this as requested, like we do in the non-delta path */
g_hash_table_add (pull_data->requested_content, checksum);
/* But also record it's a delta fallback object, so we can account
* for it as logically part of the delta fetch.
*/
g_hash_table_add (pull_data->requested_fallback_content, g_strdup (checksum));
enqueue_one_object_request (pull_data, checksum, OSTREE_OBJECT_TYPE_FILE, NULL, FALSE, FALSE);
checksum = NULL; /* Transfer ownership */
checksum = NULL; /* We transferred ownership to the requested_content hash */
}
}
}
@ -1493,6 +1655,22 @@ process_one_static_delta_fallback (OtPullData *pull_data,
return ret;
}
static void
start_fetch_deltapart (OtPullData *pull_data,
FetchStaticDeltaData *fetch)
{
g_autofree char *deltapart_path = _ostree_get_relative_static_delta_part_path (fetch->from_revision, fetch->to_revision, fetch->i);
pull_data->n_outstanding_deltapart_fetches++;
g_assert_cmpint (pull_data->n_outstanding_deltapart_fetches, <=, _OSTREE_MAX_OUTSTANDING_DELTAPART_REQUESTS);
_ostree_fetcher_request_to_tmpfile (pull_data->fetcher,
pull_data->content_mirrorlist,
deltapart_path, fetch->size,
OSTREE_FETCHER_DEFAULT_PRIORITY,
pull_data->cancellable,
static_deltapart_fetch_on_complete,
fetch);
}
static gboolean
process_one_static_delta (OtPullData *pull_data,
const char *from_revision,
@ -1618,11 +1796,15 @@ process_one_static_delta (OtPullData *pull_data,
cancellable, error))
goto out;
pull_data->total_deltapart_size += size;
pull_data->total_deltapart_usize += usize;
if (have_all)
{
g_debug ("Have all objects from static delta %s-%s part %u",
from_revision ? from_revision : "empty", to_revision,
i);
pull_data->fetched_deltapart_size += size;
pull_data->n_fetched_deltaparts++;
continue;
}
@ -1636,16 +1818,17 @@ process_one_static_delta (OtPullData *pull_data,
inline_part_bytes = g_variant_get_data_as_bytes (part_datav);
}
pull_data->total_deltapart_size += size;
pull_data->total_deltapart_usize += usize;
if (pull_data->dry_run)
continue;
fetch_data = g_new0 (FetchStaticDeltaData, 1);
fetch_data->from_revision = g_strdup (from_revision);
fetch_data->to_revision = g_strdup (to_revision);
fetch_data->pull_data = pull_data;
fetch_data->objects = g_variant_ref (objects);
fetch_data->expected_checksum = ostree_checksum_from_bytes_v (csum_v);
fetch_data->size = size;
fetch_data->i = i;
if (inline_part_bytes != NULL)
{
@ -1669,14 +1852,12 @@ process_one_static_delta (OtPullData *pull_data,
}
else
{
_ostree_fetcher_request_to_tmpfile (pull_data->fetcher,
pull_data->content_mirrorlist,
deltapart_path, size,
OSTREE_FETCHER_DEFAULT_PRIORITY,
pull_data->cancellable,
static_deltapart_fetch_on_complete,
fetch_data);
pull_data->n_outstanding_deltapart_fetches++;
if (!fetcher_queue_is_full (pull_data))
start_fetch_deltapart (pull_data, fetch_data);
else
{
g_hash_table_add (pull_data->pending_fetch_deltaparts, fetch_data);
}
}
}
@ -1685,6 +1866,87 @@ process_one_static_delta (OtPullData *pull_data,
return ret;
}
/* Loop over the static delta data we got from the summary,
* and find the newest commit for @out_from_revision that
* goes to @to_revision.
*/
static gboolean
get_best_static_delta_start_for (OtPullData *pull_data,
const char *to_revision,
char **out_from_revision,
GCancellable *cancellable,
GError **error)
{
GHashTableIter hiter;
gpointer hkey, hvalue;
/* Array<char*> of possible from checksums */
g_autoptr(GPtrArray) candidates = g_ptr_array_new_with_free_func (g_free);
const char *newest_candidate = NULL;
guint64 newest_candidate_timestamp;
g_assert (pull_data->summary_deltas_checksums != NULL);
g_hash_table_iter_init (&hiter, pull_data->summary_deltas_checksums);
/* Loop over all deltas known from the summary file,
* finding ones which go to to_revision */
while (g_hash_table_iter_next (&hiter, &hkey, &hvalue))
{
const char *delta_name = hkey;
g_autofree char *cur_from_rev = NULL;
g_autofree char *cur_to_rev = NULL;
/* Gracefully handle corrupted (or malicious) summary files */
if (!_ostree_parse_delta_name (delta_name, &cur_from_rev, &cur_to_rev, error))
return FALSE;
/* Is this the checksum we want? */
if (strcmp (cur_to_rev, to_revision) != 0)
continue;
if (cur_from_rev)
g_ptr_array_add (candidates, g_steal_pointer (&cur_from_rev));
}
/* Loop over our candidates, find the newest one */
for (guint i = 0; i < candidates->len; i++)
{
const char *candidate = candidates->pdata[i];
guint64 candidate_ts;
g_autoptr(GVariant) commit = NULL;
OstreeRepoCommitState state;
gboolean have_candidate;
/* Do we have this commit at all? If not, skip it */
if (!ostree_repo_has_object (pull_data->repo, OSTREE_OBJECT_TYPE_COMMIT,
candidate, &have_candidate,
NULL, error))
return FALSE;
if (!have_candidate)
continue;
/* Load it */
if (!ostree_repo_load_commit (pull_data->repo, candidate,
&commit, &state, error))
return FALSE;
/* Ignore partial commits, we can't use them */
if (state & OSTREE_REPO_COMMIT_STATE_PARTIAL)
continue;
/* Is it newer? */
candidate_ts = ostree_commit_get_timestamp (commit);
if (newest_candidate == NULL ||
candidate_ts > newest_candidate_timestamp)
{
newest_candidate = candidate;
newest_candidate_timestamp = candidate_ts;
}
}
*out_from_revision = g_strdup (newest_candidate);
return TRUE;
}
typedef struct {
OtPullData *pull_data;
char *from_revision;
@ -1926,7 +2188,7 @@ _ostree_repo_remote_new_fetcher (OstreeRepo *self,
if (tls_permissive)
fetcher_flags |= OSTREE_FETCHER_FLAGS_TLS_PERMISSIVE;
fetcher = _ostree_fetcher_new (self->tmp_dir_fd, fetcher_flags);
fetcher = _ostree_fetcher_new (self->tmp_dir_fd, remote_name, fetcher_flags);
{
g_autofree char *tls_client_cert_path = NULL;
@ -2327,6 +2589,7 @@ reinitialize_fetcher (OtPullData *pull_data, const char *remote_name, GError **e
* * override-url (s): Fetch objects from this URL if remote specifies no metalink in options
* * inherit-transaction (b): Don't initiate, finish or abort a transaction, usefult to do mutliple pulls in one transaction.
* * http-headers (a(ss)): Additional headers to add to all HTTP requests
* * update-frequency (u): Frequency to call the async progress callback in milliseconds, if any; only values higher than 0 are valid
*/
gboolean
ostree_repo_pull_with_options (OstreeRepo *self,
@ -2351,6 +2614,7 @@ ostree_repo_pull_with_options (OstreeRepo *self,
char **configured_branches = NULL;
guint64 bytes_transferred;
guint64 end_time;
guint update_frequency = 0;
OstreeRepoPullFlags flags = 0;
const char *dir_to_pull = NULL;
g_autofree char **dirs_to_pull = NULL;
@ -2361,7 +2625,6 @@ ostree_repo_pull_with_options (OstreeRepo *self,
gboolean opt_gpg_verify_set = FALSE;
gboolean opt_gpg_verify_summary_set = FALSE;
const char *url_override = NULL;
gboolean mirroring_into_archive;
gboolean inherit_transaction = FALSE;
int i;
@ -2387,6 +2650,7 @@ ostree_repo_pull_with_options (OstreeRepo *self,
(void) g_variant_lookup (options, "override-url", "&s", &url_override);
(void) g_variant_lookup (options, "inherit-transaction", "b", &inherit_transaction);
(void) g_variant_lookup (options, "http-headers", "@a(ss)", &pull_data->extra_headers);
(void) g_variant_lookup (options, "update-frequency", "u", &update_frequency);
}
g_return_val_if_fail (pull_data->maxdepth >= -1, FALSE);
@ -2400,6 +2664,7 @@ ostree_repo_pull_with_options (OstreeRepo *self,
g_return_val_if_fail (dirs_to_pull[i][0] == '/', FALSE);
g_return_val_if_fail (!(disable_static_deltas && pull_data->require_static_deltas), FALSE);
/* We only do dry runs with static deltas, because we don't really have any
* in-advance information for bare fetches.
*/
@ -2410,8 +2675,6 @@ ostree_repo_pull_with_options (OstreeRepo *self,
pull_data->is_untrusted = (flags & OSTREE_REPO_PULL_FLAGS_UNTRUSTED) > 0;
pull_data->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
mirroring_into_archive = pull_data->is_mirror && self->mode == OSTREE_REPO_MODE_ARCHIVE_Z2;
if (error)
pull_data->async_error = &pull_data->cached_async_error;
else
@ -2435,8 +2698,18 @@ ostree_repo_pull_with_options (OstreeRepo *self,
(GDestroyNotify)g_variant_unref, NULL);
pull_data->requested_content = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify)g_free, NULL);
pull_data->requested_fallback_content = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify)g_free, NULL);
pull_data->requested_metadata = g_hash_table_new_full (ostree_hash_object_name, g_variant_equal,
(GDestroyNotify)g_variant_unref, NULL);
pull_data->pending_fetch_content = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify)g_free,
(GDestroyNotify)fetch_object_data_free);
pull_data->pending_fetch_metadata = g_hash_table_new_full (ostree_hash_object_name, g_variant_equal,
(GDestroyNotify)g_variant_unref,
(GDestroyNotify)fetch_object_data_free);
pull_data->pending_fetch_deltaparts = g_hash_table_new_full (NULL, NULL, (GDestroyNotify)fetch_static_delta_data_free, NULL);
if (dir_to_pull != NULL || dirs_to_pull != NULL)
{
pull_data->dirs = g_ptr_array_new_with_free_func (g_free);
@ -2671,6 +2944,23 @@ ostree_repo_pull_with_options (OstreeRepo *self,
if (pull_data->remote_repo_local && !pull_data->require_static_deltas)
disable_static_deltas = TRUE;
/* We can't use static deltas if pulling into an archive-z2 repo. */
if (self->mode == OSTREE_REPO_MODE_ARCHIVE_Z2)
{
if (pull_data->require_static_deltas)
{
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Can't use static deltas in an archive repo");
goto out;
}
disable_static_deltas = TRUE;
}
/* It's not efficient to use static deltas if all we want is the commit
* metadata. */
if (pull_data->is_commit_only)
disable_static_deltas = TRUE;
pull_data->static_delta_superblocks = g_ptr_array_new_with_free_func ((GDestroyNotify)g_variant_unref);
{
@ -2953,11 +3243,23 @@ ostree_repo_pull_with_options (OstreeRepo *self,
const char *ref = key;
const char *to_revision = value;
/* If we have a summary, find the latest local commit we have
* to use as a from revision for static deltas.
*/
if (pull_data->summary)
{
if (!get_best_static_delta_start_for (pull_data, to_revision, &from_revision,
cancellable, error))
goto out;
}
else
{
if (!ostree_repo_resolve_rev (pull_data->repo, ref, TRUE,
&from_revision, error))
goto out;
}
if (!(disable_static_deltas || mirroring_into_archive || pull_data->is_commit_only) &&
if (!disable_static_deltas &&
(from_revision == NULL || g_strcmp0 (from_revision, to_revision) != 0))
{
g_autofree char *delta_name =
@ -2984,7 +3286,12 @@ ostree_repo_pull_with_options (OstreeRepo *self,
if (pull_data->progress)
{
/* Setup a custom frequency if set */
if (update_frequency > 0)
update_timeout = g_timeout_source_new (pull_data->dry_run ? 0 : update_frequency);
else
update_timeout = g_timeout_source_new_seconds (pull_data->dry_run ? 0 : 1);
g_source_set_priority (update_timeout, G_PRIORITY_HIGH);
g_source_set_callback (update_timeout, update_progress, pull_data, NULL);
g_source_attach (update_timeout, pull_data->main_context);
@ -3147,7 +3454,11 @@ ostree_repo_pull_with_options (OstreeRepo *self,
g_clear_pointer (&pull_data->scanned_metadata, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&pull_data->summary_deltas_checksums, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&pull_data->requested_content, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&pull_data->requested_fallback_content, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&pull_data->requested_metadata, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&pull_data->pending_fetch_content, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&pull_data->pending_fetch_metadata, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&pull_data->pending_fetch_deltaparts, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&pull_data->idle_src, (GDestroyNotify) g_source_destroy);
g_clear_pointer (&pull_data->dirs, (GDestroyNotify) g_ptr_array_unref);
g_clear_pointer (&remote_config, (GDestroyNotify) g_key_file_unref);
@ -3242,7 +3553,7 @@ out:
return ret;
}
#else /* HAVE_LIBSOUP */
#else /* HAVE_LIBCURL_OR_LIBSOUP */
gboolean
ostree_repo_pull_with_options (OstreeRepo *self,
@ -3271,4 +3582,4 @@ ostree_repo_remote_fetch_summary_with_options (OstreeRepo *self,
return FALSE;
}
#endif /* HAVE_LIBSOUP */
#endif /* HAVE_LIBCURL_OR_LIBSOUP */

View File

@ -1003,11 +1003,7 @@ generate_delta_lowlatency (OstreeRepo *repo,
if (!check_object_world_readable (repo, from_checksum, &from_world_readable, cancellable, error))
goto out;
if (!from_world_readable)
{
g_hash_table_iter_steal (&hashiter);
g_hash_table_add (new_reachable_regfile_content, (char*)from_checksum);
continue;
}
if (!try_content_rollsum (repo, opts, from_checksum, to_checksum,
&rollsum, cancellable, error))

View File

@ -884,10 +884,6 @@ _ostree_repo_static_delta_dump (OstreeRepo *self,
OT_VARIANT_MAP_TRUSTED, &delta_superblock, error))
goto out;
{ g_autofree char *variant_string = g_variant_print (delta_superblock, 1);
g_print ("%s\n", variant_string);
}
g_print ("Delta: %s\n", delta_id);
{ const char *endianness_description;
gboolean was_heuristic;
@ -940,9 +936,13 @@ _ostree_repo_static_delta_dump (OstreeRepo *self,
for (i = 0; i < n_fallback; i++)
{
guint64 size, usize;
g_variant_get_child (fallback, i, "(y@aytt)", NULL, NULL, &size, &usize);
g_autoptr(GVariant) checksum_v = NULL;
char checksum[OSTREE_SHA256_STRING_LEN+1];
g_variant_get_child (fallback, i, "(y@aytt)", NULL, &checksum_v, &size, &usize);
ostree_checksum_inplace_from_bytes (ostree_checksum_bytes_peek (checksum_v), checksum);
size = maybe_swap_endian_u64 (swap_endian, size);
usize = maybe_swap_endian_u64 (swap_endian, usize);
g_print (" %s\n", checksum);
total_fallback_size += size;
total_fallback_usize += usize;
}

View File

@ -284,7 +284,7 @@ _ostree_repo_remote_name_is_file (const char *remote_name)
* OSTree remotes are represented by keyfile groups, formatted like:
* `[remote "remotename"]`. This function returns a value named @option_name
* underneath that group, or @default_value if the remote exists but not the
* option name.
* option name. If an error is returned, @out_value will be set to %NULL.
*
* Returns: %TRUE on success, otherwise %FALSE with @error set
*/
@ -360,8 +360,9 @@ ostree_repo_get_remote_option (OstreeRepo *self,
*
* OSTree remotes are represented by keyfile groups, formatted like:
* `[remote "remotename"]`. This function returns a value named @option_name
* underneath that group, and returns it as an zero terminated array of strings.
* If the option is not set, @out_value will be set to %NULL.
* underneath that group, and returns it as a zero terminated array of strings.
* If the option is not set, or if an error is returned, @out_value will be set
* to %NULL.
*
* Returns: %TRUE on success, otherwise %FALSE with @error set
*/
@ -435,7 +436,8 @@ ostree_repo_get_remote_list_option (OstreeRepo *self,
* OSTree remotes are represented by keyfile groups, formatted like:
* `[remote "remotename"]`. This function returns a value named @option_name
* underneath that group, and returns it as a boolean.
* If the option is not set, @out_value will be set to @default_value.
* If the option is not set, @out_value will be set to @default_value. If an
* error is returned, @out_value will be set to %FALSE.
*
* Returns: %TRUE on success, otherwise %FALSE with @error set
*/
@ -2002,7 +2004,124 @@ get_remotes_d_dir (OstreeRepo *self)
}
static gboolean
append_remotes_d (OstreeRepo *self,
reload_core_config (OstreeRepo *self,
GCancellable *cancellable,
GError **error)
{
g_autofree char *version = NULL;
g_autofree char *mode = NULL;
g_autofree char *contents = NULL;
g_autofree char *parent_repo_path = NULL;
gboolean is_archive;
gsize len;
g_clear_pointer (&self->config, (GDestroyNotify)g_key_file_unref);
self->config = g_key_file_new ();
contents = glnx_file_get_contents_utf8_at (self->repo_dir_fd, "config", &len,
NULL, error);
if (!contents)
return FALSE;
if (!g_key_file_load_from_data (self->config, contents, len, 0, error))
{
g_prefix_error (error, "Couldn't parse config file: ");
return FALSE;
}
version = g_key_file_get_value (self->config, "core", "repo_version", error);
if (!version)
return FALSE;
if (strcmp (version, "1") != 0)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Invalid repository version '%s'", version);
return FALSE;
}
if (!ot_keyfile_get_boolean_with_default (self->config, "core", "archive",
FALSE, &is_archive, error))
return FALSE;
if (is_archive)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
"This version of OSTree no longer supports \"archive\" repositories; use archive-z2 instead");
return FALSE;
}
if (!ot_keyfile_get_value_with_default (self->config, "core", "mode",
"bare", &mode, error))
return FALSE;
if (!ostree_repo_mode_from_string (mode, &self->mode, error))
return FALSE;
if (self->writable)
{
if (!ot_keyfile_get_boolean_with_default (self->config, "core", "enable-uncompressed-cache",
TRUE, &self->enable_uncompressed_cache, error))
return FALSE;
}
else
self->enable_uncompressed_cache = FALSE;
{
gboolean do_fsync;
if (!ot_keyfile_get_boolean_with_default (self->config, "core", "fsync",
TRUE, &do_fsync, error))
return FALSE;
if (!do_fsync)
ostree_repo_set_disable_fsync (self, TRUE);
}
{ g_autofree char *tmp_expiry_seconds = NULL;
/* 86400 secs = one day */
if (!ot_keyfile_get_value_with_default (self->config, "core", "tmp-expiry-secs", "86400",
&tmp_expiry_seconds, error))
return FALSE;
self->tmp_expiry_seconds = g_ascii_strtoull (tmp_expiry_seconds, NULL, 10);
}
{ g_autofree char *compression_level_str = NULL;
/* gzip defaults to 6 */
(void)ot_keyfile_get_value_with_default (self->config, "archive", "zlib-level", NULL,
&compression_level_str, NULL);
if (compression_level_str)
/* Ensure level is in [1,9] */
self->zlib_compression_level = MAX (1, MIN (9, g_ascii_strtoull (compression_level_str, NULL, 10)));
else
self->zlib_compression_level = OSTREE_ARCHIVE_DEFAULT_COMPRESSION_LEVEL;
}
if (!ot_keyfile_get_value_with_default (self->config, "core", "parent",
NULL, &parent_repo_path, error))
return FALSE;
if (parent_repo_path && parent_repo_path[0])
{
g_autoptr(GFile) parent_repo_f = g_file_new_for_path (parent_repo_path);
g_clear_object (&self->parent_repo);
self->parent_repo = ostree_repo_new (parent_repo_f);
if (!ostree_repo_open (self->parent_repo, cancellable, error))
{
g_prefix_error (error, "While checking parent repository '%s': ",
gs_file_get_path_cached (parent_repo_f));
return FALSE;
}
}
return TRUE;
}
static gboolean
reload_remote_config (OstreeRepo *self,
GCancellable *cancellable,
GError **error)
{
@ -2010,6 +2129,13 @@ append_remotes_d (OstreeRepo *self,
g_autoptr(GFile) remotes_d = NULL;
g_autoptr(GFileEnumerator) direnum = NULL;
g_mutex_lock (&self->remotes_lock);
g_hash_table_remove_all (self->remotes);
g_mutex_unlock (&self->remotes_lock);
if (!add_remotes_from_keyfile (self, self->config, NULL, error))
goto out;
remotes_d = get_remotes_d_dir (self);
if (remotes_d == NULL)
return TRUE;
@ -2050,17 +2176,34 @@ append_remotes_d (OstreeRepo *self,
return ret;
}
/**
* ostree_repo_reload_config:
* @self: repo
* @cancellable: cancellable
* @error: error
*
* By default, an #OstreeRepo will cache the remote configuration and its
* own repo/config data. This API can be used to reload it.
*/
gboolean
ostree_repo_reload_config (OstreeRepo *self,
GCancellable *cancellable,
GError **error)
{
if (!reload_core_config (self, cancellable, error))
return FALSE;
if (!reload_remote_config (self, cancellable, error))
return FALSE;
return TRUE;
}
gboolean
ostree_repo_open (OstreeRepo *self,
GCancellable *cancellable,
GError **error)
{
gboolean ret = FALSE;
gboolean is_archive;
struct stat stbuf;
g_autofree char *version = NULL;
g_autofree char *mode = NULL;
g_autofree char *parent_repo_path = NULL;
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
@ -2126,102 +2269,6 @@ ostree_repo_open (OstreeRepo *self,
self->target_owner_uid = self->target_owner_gid = -1;
}
self->config = g_key_file_new ();
{ g_autofree char *contents = NULL;
gsize len;
contents = glnx_file_get_contents_utf8_at (self->repo_dir_fd, "config", &len,
NULL, error);
if (!contents)
goto out;
if (!g_key_file_load_from_data (self->config, contents, len, 0, error))
{
g_prefix_error (error, "Couldn't parse config file: ");
goto out;
}
}
if (!add_remotes_from_keyfile (self, self->config, NULL, error))
goto out;
version = g_key_file_get_value (self->config, "core", "repo_version", error);
if (!version)
goto out;
if (strcmp (version, "1") != 0)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Invalid repository version '%s'", version);
goto out;
}
if (!ot_keyfile_get_boolean_with_default (self->config, "core", "archive",
FALSE, &is_archive, error))
goto out;
if (is_archive)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
"This version of OSTree no longer supports \"archive\" repositories; use archive-z2 instead");
goto out;
}
if (!ot_keyfile_get_value_with_default (self->config, "core", "mode",
"bare", &mode, error))
goto out;
if (!ostree_repo_mode_from_string (mode, &self->mode, error))
goto out;
if (!ot_keyfile_get_value_with_default (self->config, "core", "parent",
NULL, &parent_repo_path, error))
goto out;
if (parent_repo_path && parent_repo_path[0])
{
g_autoptr(GFile) parent_repo_f = g_file_new_for_path (parent_repo_path);
self->parent_repo = ostree_repo_new (parent_repo_f);
if (!ostree_repo_open (self->parent_repo, cancellable, error))
{
g_prefix_error (error, "While checking parent repository '%s': ",
gs_file_get_path_cached (parent_repo_f));
goto out;
}
}
if (self->writable)
{
if (!ot_keyfile_get_boolean_with_default (self->config, "core", "enable-uncompressed-cache",
TRUE, &self->enable_uncompressed_cache, error))
goto out;
}
else
self->enable_uncompressed_cache = FALSE;
{
gboolean do_fsync;
if (!ot_keyfile_get_boolean_with_default (self->config, "core", "fsync",
TRUE, &do_fsync, error))
goto out;
if (!do_fsync)
ostree_repo_set_disable_fsync (self, TRUE);
}
{ g_autofree char *tmp_expiry_seconds = NULL;
/* 86400 secs = one day */
if (!ot_keyfile_get_value_with_default (self->config, "core", "tmp-expiry-secs", "86400",
&tmp_expiry_seconds, error))
goto out;
self->tmp_expiry_seconds = g_ascii_strtoull (tmp_expiry_seconds, NULL, 10);
}
if (!append_remotes_d (self, cancellable, error))
goto out;
if (!glnx_opendirat (self->repo_dir_fd, "tmp", TRUE, &self->tmp_dir_fd, error))
goto out;
@ -2234,6 +2281,10 @@ ostree_repo_open (OstreeRepo *self,
goto out;
}
if (!ostree_repo_reload_config (self, cancellable, error))
goto out;
/* TODO - delete this */
if (self->mode == OSTREE_REPO_MODE_ARCHIVE_Z2 && self->enable_uncompressed_cache)
{
if (!glnx_shutil_mkdir_p_at (self->repo_dir_fd, "uncompressed-objects-cache", 0755,
@ -3797,7 +3848,6 @@ _formatted_time_remaining_from_seconds (guint64 seconds_remaining)
if (minutes_remaining)
g_string_append_printf (description, "%" G_GUINT64_FORMAT " minutes ", minutes_remaining % 60);
if (seconds_remaining)
g_string_append_printf (description, "%" G_GUINT64_FORMAT " seconds ", seconds_remaining % 60);
return g_string_free (description, FALSE);
@ -3827,12 +3877,15 @@ ostree_repo_pull_default_console_progress_changed (OstreeAsyncProgress *progress
{
GString *buf;
g_autofree char *status = NULL;
gboolean scanning;
guint outstanding_fetches;
guint outstanding_metadata_fetches;
guint outstanding_writes;
guint n_scanned_metadata;
guint fetched_delta_parts;
guint total_delta_parts;
guint fetched_delta_part_fallbacks;
guint total_delta_part_fallbacks;
buf = g_string_new ("");
@ -3840,9 +3893,12 @@ ostree_repo_pull_default_console_progress_changed (OstreeAsyncProgress *progress
outstanding_fetches = ostree_async_progress_get_uint (progress, "outstanding-fetches");
outstanding_metadata_fetches = ostree_async_progress_get_uint (progress, "outstanding-metadata-fetches");
outstanding_writes = ostree_async_progress_get_uint (progress, "outstanding-writes");
scanning = ostree_async_progress_get_uint (progress, "scanning") == 1;
n_scanned_metadata = ostree_async_progress_get_uint (progress, "scanned-metadata");
fetched_delta_parts = ostree_async_progress_get_uint (progress, "fetched-delta-parts");
total_delta_parts = ostree_async_progress_get_uint (progress, "total-delta-parts");
fetched_delta_part_fallbacks = ostree_async_progress_get_uint (progress, "fetched-delta-fallbacks");
total_delta_part_fallbacks = ostree_async_progress_get_uint (progress, "total-delta-fallbacks");
if (status)
{
@ -3860,35 +3916,56 @@ ostree_repo_pull_default_console_progress_changed (OstreeAsyncProgress *progress
g_autofree char *formatted_bytes_transferred =
g_format_size_full (bytes_transferred, 0);
g_autofree char *formatted_bytes_sec = NULL;
g_autofree char *formatted_est_time_remaining = NULL;
guint64 bytes_sec;
/* Ignore the first second, or when we haven't transferred any
* data, since those could cause divide by zero below.
*/
if ((current_time - start_time) < G_USEC_PER_SEC || bytes_transferred == 0)
{
bytes_sec = 0;
formatted_bytes_sec = g_strdup ("-");
formatted_est_time_remaining = g_strdup ("- ");
}
else
{
guint64 bytes_sec = bytes_transferred / ((current_time - start_time) / G_USEC_PER_SEC);
guint64 est_time_remaining = (total_delta_part_size - bytes_transferred) / bytes_sec;
bytes_sec = bytes_transferred / ((current_time - start_time) / G_USEC_PER_SEC);
formatted_bytes_sec = g_format_size (bytes_sec);
formatted_est_time_remaining = _formatted_time_remaining_from_seconds (est_time_remaining);
}
/* Are we doing deltas? If so, we can be more accurate */
if (total_delta_parts > 0)
{
g_autofree char *formatted_total =
g_format_size (total_delta_part_size);
guint64 fetched_delta_part_size = ostree_async_progress_get_uint64 (progress, "fetched-delta-part-size");
g_autofree char *formatted_fetched = NULL;
g_autofree char *formatted_total = NULL;
/* Here we merge together deltaparts + fallbacks to avoid bloating the text UI */
fetched_delta_parts += fetched_delta_part_fallbacks;
total_delta_parts += total_delta_part_fallbacks;
formatted_fetched = g_format_size (fetched_delta_part_size);
formatted_total = g_format_size (total_delta_part_size);
if (bytes_sec > 0)
{
/* MAX(0, value) here just to be defensive */
guint64 est_time_remaining = MAX(0, (total_delta_part_size - fetched_delta_part_size)) / bytes_sec;
g_autofree char *formatted_est_time_remaining = _formatted_time_remaining_from_seconds (est_time_remaining);
/* No space between %s and remaining, since formatted_est_time_remaining has a trailing space */
g_string_append_printf (buf, "Receiving delta parts: %u/%u %s/s %s/%s %sremaining",
g_string_append_printf (buf, "Receiving delta parts: %u/%u %s/%s %s/s %sremaining",
fetched_delta_parts, total_delta_parts,
formatted_bytes_sec, formatted_bytes_transferred,
formatted_total, formatted_est_time_remaining);
formatted_fetched, formatted_total,
formatted_bytes_sec,
formatted_est_time_remaining);
}
else if (outstanding_metadata_fetches)
else
{
g_string_append_printf (buf, "Receiving delta parts: %u/%u %s/%s",
fetched_delta_parts, total_delta_parts,
formatted_fetched, formatted_total);
}
}
else if (scanning || outstanding_metadata_fetches)
{
g_string_append_printf (buf, "Receiving metadata objects: %u/(estimating) %s/s %s",
metadata_fetched, formatted_bytes_sec, formatted_bytes_transferred);
@ -4232,16 +4309,14 @@ find_keyring (OstreeRepo *self,
OstreeRemote *remote,
GCancellable *cancellable)
{
g_autoptr(GFile) remotes_d = NULL;
g_autoptr(GFile) file = NULL;
file = g_file_get_child (self->repodir, remote->keyring);
g_autoptr(GFile) file = g_file_get_child (self->repodir, remote->keyring);
if (g_file_query_exists (file, cancellable))
{
return g_steal_pointer (&file);
}
remotes_d = get_remotes_d_dir (self);
g_autoptr(GFile) remotes_d = get_remotes_d_dir (self);
if (remotes_d)
{
g_autoptr(GFile) file2 = g_file_get_child (remotes_d, remote->keyring);
@ -4356,7 +4431,7 @@ _ostree_repo_gpg_verify_with_metadata (OstreeRepo *self,
_OSTREE_METADATA_GPGSIGS_TYPE);
if (!signaturedata)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
"GPG verification enabled, but no signatures found (use gpg-verify=false in remote config to disable)");
return NULL;
}
@ -4474,7 +4549,12 @@ ostree_repo_verify_commit (OstreeRepo *self,
keyringdir, extra_keyring,
cancellable, error);
return ostree_gpg_verify_result_require_valid_signature (result, error);
if (!ostree_gpg_verify_result_require_valid_signature (result, error))
{
g_prefix_error (error, "Commit %s: ", commit_checksum);
return FALSE;
}
return TRUE;
}
/**

Some files were not shown because too many files have changed in this diff Show More