When exporting, use hardlinks for duplicated files
authorOwen W. Taylor <otaylor@fishsoup.net>
Fri, 29 Sep 2023 16:09:04 +0000 (12:09 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Fri, 29 Sep 2023 17:45:29 +0000 (13:45 -0400)
commit3b2fd6e9ff0a3a91a2b72f524492e4f198069dec
tree0efcc71cfe30c4039820a0cf75241ab27d56bf04
parent8c25452c1e3c8cd533370bb5baa505837e39f5f2
When exporting, use hardlinks for duplicated files

For ostree_repo_export_tree_to_archive(), and 'ostree export', when the
exported tree contains multiple files with the same checksum, write an
archive with hard links.

Without this, importing a tree, then exporting it again breaks
hardlinks.

As an example of savings: this reduces the (compressed) size of the
Fedora Flatpak Runtime image from 1345MiB to 712MiB.

Resolves: #2925
src/libostree/ostree-repo-libarchive.c
tests/archive-test.sh
tests/libtest.sh
tests/test-composefs.sh
tests/test-export.sh