~ubuntu-branches/ubuntu/wily/gnome-software/wily-proposed

« back to all changes in this revision

Viewing changes to src/plugins/gs-moduleset.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2015-07-22 00:03:04 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20150722000304-ctnkwytku720qft7
Tags: 3.16.4-1
* New upstream release.
* Update Build-Depends as per configure.ac:
  - Add appstream-util.
  - Add libpolkit-gobject-1-dev.
  - Bump libappstream-glib-dev to (>= 0.3.4).
  - Bump libgtk-3-dev to (>= 3.16).
* Drop hard-coded dependency on libappstream-glib7 now that the library
  provides a symbols file.
* Use dh_install's exclude (-X) functionality to not install the .a and .la
  files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <string.h>
25
25
#include <glib.h>
26
26
 
 
27
#include "gs-cleanup.h"
27
28
#include "gs-moduleset.h"
28
29
 
29
30
typedef struct {
235
236
                NULL };
236
237
        GMarkupParseContext *ctx;
237
238
        gboolean ret;
238
 
        gchar *data = NULL;
239
239
        gsize data_len;
 
240
        _cleanup_free_ gchar *data = NULL;
240
241
 
241
242
        g_return_val_if_fail (GS_IS_MODULESET (moduleset), FALSE);
242
243
 
252
253
                goto out;
253
254
out:
254
255
        g_markup_parse_context_free (ctx);
255
 
        g_free (data);
256
256
        return ret;
257
257
}
258
258
 
262
262
gboolean
263
263
gs_moduleset_parse_path (GsModuleset *moduleset, const gchar *path, GError **error)
264
264
{
265
 
        GDir *dir;
266
 
        gboolean ret = TRUE;
267
265
        const gchar *filename;
268
 
        gchar *tmp;
 
266
        _cleanup_dir_close_ GDir *dir = NULL;
269
267
 
270
268
        /* search all the files in the path */
271
269
        dir = g_dir_open (path, 0, error);
272
 
        if (dir == NULL) {
273
 
                ret = FALSE;
274
 
                goto out;
275
 
        }
 
270
        if (dir == NULL)
 
271
                return FALSE;
276
272
        while ((filename = g_dir_read_name (dir)) != NULL) {
 
273
                _cleanup_free_ gchar *tmp = NULL;
277
274
                if (!g_str_has_suffix (filename, ".xml"))
278
275
                        continue;
279
276
                tmp = g_build_filename (path, filename, NULL);
280
 
                ret = gs_moduleset_parse_filename (moduleset, tmp, error);
281
 
                g_free (tmp);
282
 
                if (!ret)
283
 
                        goto out;
 
277
                if (!gs_moduleset_parse_filename (moduleset, tmp, error))
 
278
                        return FALSE;
284
279
        }
285
 
out:
286
 
        if (dir != NULL)
287
 
                g_dir_close (dir);
288
 
        return ret;
 
280
        return TRUE;
289
281
}
290
282
 
291
283
static void