core: Add generic "commit filter" API, use it to implement statoverride

The builder wants the ability to mark a given file as e.g. setuid.  To
implement this, the repo now has a callback-based API when importing a
directory to modify or remove items.

The commit tool accepts a "statoverride" file as input which looks like:

+mode /path/to/file
This commit is contained in:
Colin Walters committed 2012-01-22 13:27:38 -05:00
1 parent a322ecacba
commit e8dbaa3c07
4 files changed
+303 -101

No files matched your search

+13 -3
View File
@@ -135,15 +135,25 @@ gboolean ostree_repo_load_variant (OstreeRepo *self,
GVariant **out_variant,
GError **error);
typedef enum {
OSTREE_REPO_COMMIT_FILTER_ALLOW,
OSTREE_REPO_COMMIT_FILTER_SKIP
} OstreeRepoCommitFilterResult;
typedef OstreeRepoCommitFilterResult (*OstreeRepoCommitFilter) (OstreeRepo *repo,
const char *path,
GFileInfo *file_info,
gpointer user_data);
typedef struct {
volatile gint refcount;
gint uid;
gint gid;
guint reserved_flags : 31;
guint skip_xattrs : 1;
OstreeRepoCommitFilter filter;
gpointer user_data;
gpointer reserved[3];
} OstreeRepoCommitModifier;