lib: Add an "is_system" member to OstreeRepo

This is prep for introducing a fd-relative `ostree_repo_new_at()`.
Previously, `ostree_repo_is_system()` compared `GFile` paths, but
there's a much simpler check we can do first - if this repository
was created via `OstreeSysroot`, it must be a system repo.

Closes: #886
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-05-26 19:17:59 +00:00
1 parent 2f834968c6
commit ed430b45de
3 files changed
+9

No files matched your search

+2
View File
@@ -26,6 +26,7 @@
#include <sys/wait.h>
#include "ostree-core-private.h"
#include "ostree-repo-private.h"
#include "ostree-sepolicy-private.h"
#include "ostree-sysroot-private.h"
#include "ostree-deployment-private.h"
@@ -133,6 +134,7 @@ ostree_sysroot_constructed (GObject *object)
repo_path = g_file_resolve_relative_path (self->path, "ostree/repo");
self->repo = ostree_repo_new_for_sysroot_path (repo_path, self->path);
self->repo->is_system = TRUE;
G_OBJECT_CLASS (ostree_sysroot_parent_class)->constructed (object);
}