repo: Add ostree_repo_get_dfd()
I plan to use this in rpm-ostree at least for two reasons: - To find the mtime on the repo - To use the tmp/ directory to stage content (but we should eventually add a better API)
This commit is contained in:
parent
16979cc5ed
commit
3efdcb54b7
|
|
@ -311,3 +311,8 @@ global:
|
||||||
local:
|
local:
|
||||||
*;
|
*;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
LIBOSTREE_2016.4 {
|
||||||
|
global:
|
||||||
|
ostree_repo_get_dfd;
|
||||||
|
} LIBOSTREE_2016.3;
|
||||||
|
|
|
||||||
|
|
@ -2423,6 +2423,24 @@ ostree_repo_get_path (OstreeRepo *self)
|
||||||
return self->repodir;
|
return self->repodir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ostree_repo_get_dfd:
|
||||||
|
* @self: Repo
|
||||||
|
*
|
||||||
|
* In some cases it's useful for applications to access the repository
|
||||||
|
* directly; for example, writing content into `repo/tmp` ensures it's
|
||||||
|
* on the same filesystem. Another case is detecting the mtime on the
|
||||||
|
* repository (to see whether a ref was written).
|
||||||
|
*
|
||||||
|
* Returns: File descriptor for repository root - owned by @self
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
ostree_repo_get_dfd (OstreeRepo *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (self->repo_dir_fd != -1, -1);
|
||||||
|
return self->repo_dir_fd;
|
||||||
|
}
|
||||||
|
|
||||||
OstreeRepoMode
|
OstreeRepoMode
|
||||||
ostree_repo_get_mode (OstreeRepo *self)
|
ostree_repo_get_mode (OstreeRepo *self)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,9 @@ gboolean ostree_repo_create (OstreeRepo *self,
|
||||||
_OSTREE_PUBLIC
|
_OSTREE_PUBLIC
|
||||||
GFile * ostree_repo_get_path (OstreeRepo *self);
|
GFile * ostree_repo_get_path (OstreeRepo *self);
|
||||||
|
|
||||||
|
_OSTREE_PUBLIC
|
||||||
|
int ostree_repo_get_dfd (OstreeRepo *self);
|
||||||
|
|
||||||
_OSTREE_PUBLIC
|
_OSTREE_PUBLIC
|
||||||
OstreeRepoMode ostree_repo_get_mode (OstreeRepo *self);
|
OstreeRepoMode ostree_repo_get_mode (OstreeRepo *self);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue