[recipes] Drop libglnx



commit 2a38910a791ff0ed783476a5096b1c8b0b86d42f
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Feb 16 18:57:28 2017 -0500

    Drop libglnx
    
    We we only using its rm_rf function, and only to clean up
    tmp dirs. We can just rely on /tmp getting cleaned regularly
    (in the traditional case) or being a tmpfs (in the sandboxed case).

 Makefile.am              |   21 +++------------------
 autogen.sh               |    3 ---
 src/Makefile.am          |    7 -------
 src/gr-about-dialog.c    |    5 -----
 src/gr-recipe-exporter.c |    6 ------
 src/gr-recipe-importer.c |    5 -----
 src/gr-recipe-store.c    |   28 ++++++++++++++++++++--------
 7 files changed, 23 insertions(+), 52 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index bfab553..83a5a0b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,10 +1,10 @@
 SUBDIRS = . libgd tools data src po tests
 
-EXTRA_DIST = AUTHORS NEWS libgd.info libglnx.info
+EXTRA_DIST = AUTHORS NEWS libgd.info
 
-CLEANFILES = AUTHORS NEWS libgd.info libglnx.info
+CLEANFILES = AUTHORS NEWS libgd.info
 
-BUILT_SOURCES = libgd.info libglnx.info
+BUILT_SOURCES = libgd.info
 
 AUTHORS:
        $(AM_V_GEN)if test -d "$(srcdir)/.git"; \
@@ -29,27 +29,12 @@ NEWS: data/appdata/org.gnome.Recipes.appdata.xml.in
 libgd.info:
        $(AM_V_GEN)(cd libgd; git log -1 --pretty=%h) > $@
 
-libglnx.info:
-       $(AM_V_GEN)(cd libglnx; git log -1 --pretty=%h) > $@
-
 .PHONY: NEWS
 
 # Generate the ChangeLog.
 @GENERATE_CHANGELOG_RULES@
 dist-hook: dist-ChangeLog
 
-if USE_AUTOAR
-lib_LTLIBRARIES =
-noinst_LTLIBRARIES = libglnx.la
-libglnx_srcpath := $(srcdir)/libglnx
-libglnx_cflags := \
-        $(RECIPES_CFLAGS) \
-        "-I$(libglnx_srcpath)" \
-        $(NULL)
-libglnx_libs := $(RECIPES_LIBS)
-include libglnx/Makefile-libglnx.am.inc
-endif
-
 GITIGNOREFILES = \
        **/*.swp \
        *.o \
diff --git a/autogen.sh b/autogen.sh
index bde14b3..f123328 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -14,9 +14,6 @@ cd $srcdir
 
 git submodule update --init --recursive
 
-# Workaround automake bug with subdir-objects and computed paths
-sed -e 's,$(libglnx_srcpath),libglnx,g' < libglnx/Makefile-libglnx.am >libglnx/Makefile-libglnx.am.inc
-
 # shellcheck disable=SC2016
 PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac)
 
diff --git a/src/Makefile.am b/src/Makefile.am
index a3cbd40..025502a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,7 +2,6 @@ bin_PROGRAMS = gnome-recipes
 
 commitid := $(shell $(GIT) describe)
 libgd_info = $(shell cat $(top_srcdir)/libgd.info)
-libglnx_info = $(shell cat $(top_srcdir)/libglnx.info)
 
 gnome_recipes_CFLAGS = \
        $(WARN_CFLAGS)                  \
@@ -14,10 +13,8 @@ gnome_recipes_CFLAGS = \
        -DLOCALEDIR=\"$(localedir)\"    \
        -DCOMMIT_ID=\"$(commitid)\"     \
        -DLIBGD_INFO=\"$(libgd_info)\"  \
-       -DLIBGLNX_INFO=\"$(libglnx_info)\"      \
        -DMICRO_VERSION=$(MICRO_VERSION) \
        -I "$(top_srcdir)/libgd"        \
-       -I "$(top_srcdir)/libglnx"      \
        -I "$(top_srcdir)/src"          \
        -I "$(top_builddir)/src"
 
@@ -26,10 +23,6 @@ gnome_recipes_LDADD = \
        -lm                             \
        $(top_builddir)/libgd/libgd.la
 
-if USE_AUTOAR
-gnome_recipes_LDADD += $(top_builddir)/libglnx.la
-endif
-
 gnome_recipes_SOURCES = \
        main.c                  \
        gr-about-dialog.h       \
diff --git a/src/gr-about-dialog.c b/src/gr-about-dialog.c
index 89eb303..9d67f19 100644
--- a/src/gr-about-dialog.c
+++ b/src/gr-about-dialog.c
@@ -379,9 +379,6 @@ populate_system_tab (GtkTextView *view)
                 text_buffer_append_printf (buffer, "\tlibgd\t%s\t", LIBGD_INFO);
                 text_buffer_append_link (view, buffer, "LGPLv2", 
"http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html";);
                 text_buffer_append (buffer, "\n");
-                text_buffer_append_printf (buffer, "\tlibglnx\t%s\t", LIBGLNX_INFO);
-                text_buffer_append_link (view, buffer, "LGPLv2", 
"http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html";);
-                text_buffer_append (buffer, "\n");
         }
         else {
                 text_buffer_append (buffer, _("System libraries"));
@@ -408,8 +405,6 @@ populate_system_tab (GtkTextView *view)
                 text_buffer_append_printf (buffer, "\tlibgd\t%s\t", LIBGD_INFO);
                 text_buffer_append_link (view, buffer, "LGPLv2", 
"http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html";);
                 text_buffer_append (buffer, "\n");
-                text_buffer_append_printf (buffer, "\tlibglnx\t%s\t", LIBGLNX_INFO);
-                text_buffer_append_link (view, buffer, "LGPLv2", 
"http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html";);
        }
 
         gtk_text_buffer_create_tag (buffer, "smaller", "scale", PANGO_SCALE_SMALL, NULL);
diff --git a/src/gr-recipe-exporter.c b/src/gr-recipe-exporter.c
index 1762247..565ebdf 100644
--- a/src/gr-recipe-exporter.c
+++ b/src/gr-recipe-exporter.c
@@ -25,7 +25,6 @@
 #include <glib/gstdio.h>
 #ifdef ENABLE_AUTOAR
 #include <gnome-autoar/gnome-autoar.h>
-#include "glnx-shutil.h"
 #endif
 
 #include "gr-recipe-exporter.h"
@@ -107,11 +106,6 @@ static void
 cleanup_export (GrRecipeExporter *exporter)
 {
 #ifdef ENABLE_AUTOAR
-        g_autoptr(GError) error = NULL;
-
-        if (!glnx_shutil_rm_rf_at (-1, exporter->dir, NULL, &error))
-                g_warning ("Failed to clean up temp directory %s: %s", exporter->dir, error->message);
-
         g_clear_object (&exporter->compressor);
 #endif
 
diff --git a/src/gr-recipe-importer.c b/src/gr-recipe-importer.c
index b41ffb6..1428d9a 100644
--- a/src/gr-recipe-importer.c
+++ b/src/gr-recipe-importer.c
@@ -25,7 +25,6 @@
 
 #ifdef ENABLE_AUTOAR
 #include <gnome-autoar/gnome-autoar.h>
-#include "glnx-shutil.h"
 #endif
 
 #include "gr-recipe-importer.h"
@@ -181,10 +180,6 @@ static void
 cleanup_import (GrRecipeImporter *importer)
 {
 #ifdef ENABLE_AUTOAR
-        g_autoptr(GError) error = NULL;
-
-        if (!glnx_shutil_rm_rf_at (-1, importer->dir, NULL, &error))
-                g_warning ("Failed to clean up temp directory %s: %s", importer->dir, error->message);
         g_clear_object (&importer->extractor);
 #endif
 
diff --git a/src/gr-recipe-store.c b/src/gr-recipe-store.c
index f30e80c..6807352 100644
--- a/src/gr-recipe-store.c
+++ b/src/gr-recipe-store.c
@@ -32,7 +32,6 @@
 #include "gr-images.h"
 #include "gr-app.h"
 
-#include "glnx-shutil.h"
 
 struct _GrRecipeStore
 {
@@ -1052,18 +1051,31 @@ gr_recipe_store_init (GrRecipeStore *self)
         load_user (self, dir);
 
         dir = get_old_user_data_dir ();
-        if (load_recipes (self, dir, FALSE))
+        if (load_recipes (self, dir, FALSE)) {
+                g_autofree char *filename = g_build_filename (dir, "recipes.db", NULL);
+                g_remove (filename);
                 save_recipes (self);
-        if (load_favorites (self, dir))
+        }
+        if (load_favorites (self, dir)) {
+                g_autofree char *filename = g_build_filename (dir, "favorites.db", NULL);
+                g_remove (filename);
                 save_favorites (self);
-        if (load_shopping (self, dir))
+        }
+        if (load_shopping (self, dir)) {
+                g_autofree char *filename = g_build_filename (dir, "shopping.db", NULL);
+                g_remove (filename);
                 save_shopping (self);
-        if (load_cooked (self, dir))
+        }
+        if (load_cooked (self, dir)) {
+                g_autofree char *filename = g_build_filename (dir, "cooked.db", NULL);
+                g_remove (filename);
                 save_cooked (self);
-        if (load_chefs (self, dir, FALSE))
+        }
+        if (load_chefs (self, dir, FALSE)) {
+                g_autofree char *filename = g_build_filename (dir, "chefs.db", NULL);
+                g_remove (filename);
                 save_chefs (self);
-        if (!glnx_shutil_rm_rf_at (-1, dir, NULL, &error))
-                g_message ("Failed to remove %s: %s", dir, error->message);
+        }
 
         g_message ("%d recipes loaded", g_hash_table_size (self->recipes));
         g_message ("%d chefs loaded", g_hash_table_size (self->chefs));


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