repo: Add ostree_repo_import_archive_to_mtree

This is a more flexible version of the previous
ostree_repo_write_archive_to_mtree() which took a file reference.
This has an extensible options structure, and in particular
now supports `ignore_unsupported_content`.

I plan to use this for importing Docker images which contain device
nodes.  (There's no reason for container images to have those, so
we'll just ignore them).

Also here, just like the export variant, the caller is responsible for
setting up libarchive.
This commit is contained in:
Colin Walters committed 2016-02-19 08:54:04 -05:00
1 parent b08b1abccd
commit 3a555114bc
4 files changed
+334 -40

No files matched your search

+23
View File
@@ -450,6 +450,29 @@ gboolean ostree_repo_write_archive_to_mtree (OstreeRepo *
GCancellable *cancellable,
GError **error);
/**
* OstreeRepoImportArchiveOptions:
*
* An extensible options structure controlling archive import. Ensure that
* you have entirely zeroed the structure, then set just the desired
* options. This is used by ostree_repo_import_archive_to_mtree().
*/
typedef struct {
guint ignore_unsupported_content : 1;
guint autocreate_parents : 1;
guint reserved : 30;
guint unused_uint[8];
gpointer unused_ptrs[8];
} OstreeRepoImportArchiveOptions;
gboolean ostree_repo_import_archive_to_mtree (OstreeRepo *self,
OstreeRepoImportArchiveOptions *opts,
void *archive, /* Really struct archive * */
OstreeMutableTree *mtree,
OstreeRepoCommitModifier *modifier,
GCancellable *cancellable,
GError **error);
/**
* OstreeRepoExportArchiveOptions:
*