[gnome-builder] todo: avoid grep --exclude-dirs on FreeBSD



commit 9489d51e1fd2dfd010917a2a83e466a37da2e7f3
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 24 16:30:02 2018 -0800

    todo: avoid grep --exclude-dirs on FreeBSD
    
    We don't have a new enough grep on FreeBSD to support --exclude-dirs, so
    just drop that optimization on FreeBSD.
    
    #361

 src/plugins/todo/gbp-todo-model.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/src/plugins/todo/gbp-todo-model.c b/src/plugins/todo/gbp-todo-model.c
index 7a7ed50d1..f90850e03 100644
--- a/src/plugins/todo/gbp-todo-model.c
+++ b/src/plugins/todo/gbp-todo-model.c
@@ -59,12 +59,14 @@ static GParamSpec *properties [N_PROPS];
 static GRegex *line1;
 static GRegex *line2;
 
+#ifndef __FreeBSD__
 static const gchar *exclude_dirs[] = {
   ".bzr",
   ".flatpak-builder",
   ".git",
   ".svn",
 };
+#endif
 
 static const gchar *exclude_files[] = {
   "*.m4",
@@ -330,6 +332,12 @@ gbp_todo_model_mine_worker (GTask        *task,
       ide_subprocess_launcher_push_argv (launcher, arg);
     }
 
+#ifndef __FreeBSD__
+  /* Exclude directories to reduce how much data can get into our
+   * GBytes of stdout data. FreeBSD does not currently support
+   * this option in their GNU grep version, so we'll just skip it
+   * and their stdout GBytes will be slightly larger (but work).
+   */
   for (guint i = 0; i < G_N_ELEMENTS (exclude_dirs); i++)
     {
       const gchar *exclude_dir = exclude_dirs[i];
@@ -338,6 +346,7 @@ gbp_todo_model_mine_worker (GTask        *task,
       arg = g_strdup_printf ("--exclude-dir=%s", exclude_dir);
       ide_subprocess_launcher_push_argv (launcher, arg);
     }
+#endif
 
   for (guint i = 0; i < G_N_ELEMENTS (keywords); i++)
     {


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