core: Unify queryinfo flags such that we just use stat/readlink
This commit is contained in:
parent
43105183cf
commit
e71f60cb21
|
|
@ -312,7 +312,7 @@ ostree_checkout_run_triggers (OstreeCheckout *self,
|
||||||
triggerdir_path = g_build_filename (LIBEXECDIR, "ostree", "triggers.d", NULL);
|
triggerdir_path = g_build_filename (LIBEXECDIR, "ostree", "triggers.d", NULL);
|
||||||
triggerdir = ot_util_new_file_for_path (triggerdir_path);
|
triggerdir = ot_util_new_file_for_path (triggerdir_path);
|
||||||
|
|
||||||
enumerator = g_file_enumerate_children (triggerdir, "standard::name,standard::type,unix::*",
|
enumerator = g_file_enumerate_children (triggerdir, OSTREE_GIO_FAST_QUERYINFO,
|
||||||
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
||||||
NULL,
|
NULL,
|
||||||
error);
|
error);
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define OSTREE_GIO_FAST_QUERYINFO "standard::name,standard::type,standard::is-symlink,standard::symlink-target,unix::*"
|
||||||
|
|
||||||
#define OSTREE_EMPTY_STRING_SHA256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
|
#define OSTREE_EMPTY_STRING_SHA256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
|
||||||
|
|
@ -1853,7 +1853,7 @@ iter_object_dir (OstreeRepo *self,
|
||||||
|
|
||||||
dirpath = g_file_get_path (dir);
|
dirpath = g_file_get_path (dir);
|
||||||
|
|
||||||
enumerator = g_file_enumerate_children (dir, "standard::name,standard::type,unix::*",
|
enumerator = g_file_enumerate_children (dir, OSTREE_GIO_FAST_QUERYINFO,
|
||||||
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
||||||
NULL,
|
NULL,
|
||||||
error);
|
error);
|
||||||
|
|
@ -1919,7 +1919,7 @@ ostree_repo_iter_objects (OstreeRepo *self,
|
||||||
g_return_val_if_fail (priv->inited, FALSE);
|
g_return_val_if_fail (priv->inited, FALSE);
|
||||||
|
|
||||||
objectdir = ot_util_new_file_for_path (priv->objects_path);
|
objectdir = ot_util_new_file_for_path (priv->objects_path);
|
||||||
enumerator = g_file_enumerate_children (objectdir, "standard::name,standard::type,unix::*",
|
enumerator = g_file_enumerate_children (objectdir, OSTREE_GIO_FAST_QUERYINFO,
|
||||||
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
||||||
NULL,
|
NULL,
|
||||||
error);
|
error);
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,6 @@
|
||||||
|
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
|
||||||
#define FAST_QUERYINFO "standard::name,standard::type,standard::is-symlink,standard::symlink-target,unix::*"
|
|
||||||
|
|
||||||
static char *compose_metadata_path;
|
static char *compose_metadata_path;
|
||||||
|
|
||||||
static GOptionEntry options[] = {
|
static GOptionEntry options[] = {
|
||||||
|
|
@ -41,7 +39,7 @@ rm_rf (GFile *path)
|
||||||
GFileEnumerator *path_enum = NULL;
|
GFileEnumerator *path_enum = NULL;
|
||||||
guint32 type;
|
guint32 type;
|
||||||
|
|
||||||
finfo = g_file_query_info (path, FAST_QUERYINFO,
|
finfo = g_file_query_info (path, OSTREE_GIO_FAST_QUERYINFO,
|
||||||
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
if (!finfo)
|
if (!finfo)
|
||||||
|
|
@ -50,7 +48,7 @@ rm_rf (GFile *path)
|
||||||
type = g_file_info_get_attribute_uint32 (finfo, "standard::type");
|
type = g_file_info_get_attribute_uint32 (finfo, "standard::type");
|
||||||
if (type == G_FILE_TYPE_DIRECTORY)
|
if (type == G_FILE_TYPE_DIRECTORY)
|
||||||
{
|
{
|
||||||
path_enum = g_file_enumerate_children (path, FAST_QUERYINFO,
|
path_enum = g_file_enumerate_children (path, OSTREE_GIO_FAST_QUERYINFO,
|
||||||
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
if (!path_enum)
|
if (!path_enum)
|
||||||
|
|
@ -94,7 +92,7 @@ merge_dir (GFile *destination,
|
||||||
dest_path = g_file_get_path (destination);
|
dest_path = g_file_get_path (destination);
|
||||||
src_path = g_file_get_path (src);
|
src_path = g_file_get_path (src);
|
||||||
|
|
||||||
dest_fileinfo = g_file_query_info (destination, FAST_QUERYINFO,
|
dest_fileinfo = g_file_query_info (destination, OSTREE_GIO_FAST_QUERYINFO,
|
||||||
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
||||||
NULL, &temp_error);
|
NULL, &temp_error);
|
||||||
if (dest_fileinfo)
|
if (dest_fileinfo)
|
||||||
|
|
@ -108,7 +106,7 @@ merge_dir (GFile *destination,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
src_enum = g_file_enumerate_children (src, FAST_QUERYINFO,
|
src_enum = g_file_enumerate_children (src, OSTREE_GIO_FAST_QUERYINFO,
|
||||||
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
|
||||||
NULL, error);
|
NULL, error);
|
||||||
if (!src_enum)
|
if (!src_enum)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue