[ostree] core: Unify queryinfo flags such that we just use stat/readlink



commit e71f60cb21933b80c857988fd4c1725d05759474
Author: Colin Walters <walters verbum org>
Date:   Sun Nov 6 16:24:11 2011 -0500

    core: Unify queryinfo flags such that we just use stat/readlink

 libostree/ostree-checkout.c |    2 +-
 libostree/ostree-core.h     |    2 ++
 libostree/ostree-repo.c     |    4 ++--
 ostree/ot-builtin-compose.c |   10 ++++------
 4 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/libostree/ostree-checkout.c b/libostree/ostree-checkout.c
index 0569f28..0fbe4a0 100644
--- a/libostree/ostree-checkout.c
+++ b/libostree/ostree-checkout.c
@@ -312,7 +312,7 @@ ostree_checkout_run_triggers (OstreeCheckout *self,
   triggerdir_path = g_build_filename (LIBEXECDIR, "ostree", "triggers.d", NULL);
   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,
                                           NULL, 
                                           error);
diff --git a/libostree/ostree-core.h b/libostree/ostree-core.h
index c1fb491..959a46b 100644
--- a/libostree/ostree-core.h
+++ b/libostree/ostree-core.h
@@ -26,6 +26,8 @@
 
 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";
 
 typedef enum {
diff --git a/libostree/ostree-repo.c b/libostree/ostree-repo.c
index 13be0b2..3e7f65c 100644
--- a/libostree/ostree-repo.c
+++ b/libostree/ostree-repo.c
@@ -1853,7 +1853,7 @@ iter_object_dir (OstreeRepo   *self,
 
   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,
                                           NULL, 
                                           error);
@@ -1919,7 +1919,7 @@ ostree_repo_iter_objects (OstreeRepo  *self,
   g_return_val_if_fail (priv->inited, FALSE);
 
   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,
                                           NULL, 
                                           error);
diff --git a/ostree/ot-builtin-compose.c b/ostree/ot-builtin-compose.c
index 570aaca..831bdb0 100644
--- a/ostree/ot-builtin-compose.c
+++ b/ostree/ot-builtin-compose.c
@@ -26,8 +26,6 @@
 
 #include <glib/gi18n.h>
 
-#define FAST_QUERYINFO "standard::name,standard::type,standard::is-symlink,standard::symlink-target,unix::*"
-
 static char *compose_metadata_path;
 
 static GOptionEntry options[] = {
@@ -41,7 +39,7 @@ rm_rf (GFile *path)
   GFileEnumerator *path_enum = NULL;
   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,
                              NULL, NULL);
   if (!finfo)
@@ -50,7 +48,7 @@ rm_rf (GFile *path)
   type = g_file_info_get_attribute_uint32 (finfo, "standard::type");
   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,
                                              NULL, NULL);
       if (!path_enum)
@@ -94,7 +92,7 @@ merge_dir (GFile    *destination,
   dest_path = g_file_get_path (destination);
   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,
                                      NULL, &temp_error);
   if (dest_fileinfo)
@@ -108,7 +106,7 @@ merge_dir (GFile    *destination,
           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,
                                             NULL, error);
       if (!src_enum)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]