lib/repo: Add a new private API for bare content writes
authorColin Walters <walters@verbum.org>
Sat, 14 Oct 2017 01:01:20 +0000 (21:01 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 30 Nov 2017 16:39:52 +0000 (16:39 +0000)
commit17308e21493b4bbe1eb9a7b03cdd90209dfc37a8
tree12e9c141af6282608f06187c9f01fc84cd09c219
parentbd6a15e7a32b1879c301ac1a77bbe4de1cee523d
lib/repo: Add a new private API for bare content writes

This lowers into the commit core what the static delta code
was doing, and improves the API.

The bigger picture issue is that for writing large files, our current "pull" API
where the caller provides a `GInputStream` is very awkward in some scenarios.
For example, we have a whole "libarchive input stream" that is a ~200 line
GObject that boils down to wrapping `archive_read_data()`.

This came more to a head when I was working on rpm-ostree jigdo since I had to
copy that object.

One step we can take after this is to further split `write_content_object()`
into a "write symlink or archive object" versus "write bare content object"
(it already has a mess of conditionals) and teach the latter case to call
this.

The eventual goal here is to make this API public.

Closes: #1355
Approved by: jlebon
src/libostree/ostree-repo-commit.c
src/libostree/ostree-repo-private.h
src/libostree/ostree-repo-static-delta-processing.c