lib/core: add ostree_checksum_file_at API

This is like `ostree_checksum_file` but fd-relative. This will be used
by https://github.com/ostreedev/ostree/pull/1258.

AFAICT, we actually didn't have any tests that check the `checksum` CLI.
Add a basic one here to test the old code as well as the new code.

Closes: #1263
Approved by: cgwalters
This commit is contained in:
Jonathan Lebon authored and Atomic Bot committed 2017-10-12 12:53:01 +00:00
1 parent 60b5925c54
commit 077d2718ad
8 files changed
+173 -15

No files matched your search

+21
View File
@@ -21,6 +21,7 @@
#pragma once
#include <sys/stat.h>
#include <gio/gio.h>
#include <ostree-types.h>
@@ -420,6 +421,26 @@ gboolean ostree_checksum_file (GFile *f,
GCancellable *cancellable,
GError **error);
/**
* OstreeChecksumFlags:
*
* Since: 2017.13
*/
typedef enum {
OSTREE_CHECKSUM_FLAGS_NONE = 0,
OSTREE_CHECKSUM_FLAGS_IGNORE_XATTRS = (1 << 0),
} OstreeChecksumFlags;
_OSTREE_PUBLIC
gboolean ostree_checksum_file_at (int dfd,
const char *path,
struct stat *stbuf,
OstreeObjectType objtype,
OstreeChecksumFlags flags,
char **out_checksum,
GCancellable *cancellable,
GError **error);
_OSTREE_PUBLIC
void ostree_checksum_file_async (GFile *f,
OstreeObjectType objtype,