[recipes] Importer: Allow importing recipes without chef
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Importer: Allow importing recipes without chef
- Date: Thu, 15 Dec 2016 02:23:58 +0000 (UTC)
commit f72e7aae043b5c37bbf6086428705d6878dd205b
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Dec 14 15:10:51 2016 -0500
Importer: Allow importing recipes without chef
We already have such recipes in the system, so we might
as well allow creating them via import.
src/gr-recipe-importer.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-recipe-importer.c b/src/gr-recipe-importer.c
index 85f43db..5530703 100644
--- a/src/gr-recipe-importer.c
+++ b/src/gr-recipe-importer.c
@@ -602,7 +602,13 @@ finish_import (GrRecipeImporter *importer)
keyfile = g_key_file_new ();
path = g_build_filename (importer->dir, "chefs.db", NULL);
if (!g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, &error)) {
- error_cb (importer->extractor, error, importer);
+ if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
+ error_cb (importer->extractor, error, importer);
+ return;
+ }
+
+ importer->chef_name = g_strdup ("anonymous");
+ import_recipe (importer);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]