lib/commit: Implement "adoption" with CONSUME flag
authorColin Walters <walters@verbum.org>
Sat, 14 Oct 2017 02:17:56 +0000 (22:17 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 16 Oct 2017 18:22:09 +0000 (18:22 +0000)
commit16c31a9b580c91ca670c3cdd7143e106ec842ea7
tree3b22ef9d47dc1de0913cfd37627009bc5c65dc38
parent729790bedc1aaad7ea29ea6010bf39eb8c3943ba
lib/commit: Implement "adoption" with CONSUME flag

For checkouts that are on the same device, for regular files we can simply
"adopt" existing files. This is useful in the "build from subtrees" pattern that
happens with e.g. `rpm-ostree install` as well as flatpak and gnome-continuous.

New files are things like an updated `ldconfig` cache, etc. And particularly for
`rpm-ostree` we always regenerate the rpmdb, which for e.g. this workstation is
`61MB`.

We probably should have done this from the start, and instead had a `--copy`
flag to commit, but obviously we have to be backwards compatible.

There's more to do here - the biggest gap is probably for `bare-user` repos,
which are often used with things like `rpm-ostree compose tree` for host
systems. But we can do that later.

Closes: #1272
Approved by: jlebon
src/libostree/ostree-repo-commit.c
tests/basic-test.sh