create-dir-runtime.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From b9cff29978113aefe3ad18521f383f12ab099a34 Mon Sep 17 00:00:00 2001
  2. From: Cosimo Cecchi <cosimo@endlessm.com>
  3. Date: Tue, 25 Feb 2014 09:43:04 +0000
  4. Subject: Create the history directory at runtime
  5. In addition to build time - this increases compatibilty with OSTree,
  6. which starts out with an empty /var.
  7. Signed-off-by: Richard Hughes <richard@hughsie.com>
  8. ---
  9. diff --git a/src/up-history.c b/src/up-history.c
  10. index f9d0fdf..795b093 100644
  11. --- a/src/up-history.c
  12. +++ b/src/up-history.c
  13. @@ -414,6 +414,7 @@ up_history_set_directory (UpHistory *history, const gchar *dir)
  14. {
  15. g_free (history->priv->dir);
  16. history->priv->dir = g_strdup (dir);
  17. + g_mkdir_with_parents (dir, 0755);
  18. }
  19. /**
  20. @@ -887,7 +888,8 @@ up_history_init (UpHistory *history)
  21. history->priv->data_time_full = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
  22. history->priv->data_time_empty = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
  23. history->priv->max_data_age = UP_HISTORY_DEFAULT_MAX_DATA_AGE;
  24. - history->priv->dir = g_build_filename (HISTORY_DIR, NULL);
  25. +
  26. + up_history_set_directory (history, HISTORY_DIR);
  27. }
  28. /**
  29. --
  30. cgit v0.9.0.2-2-gbebe