summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-08-11 22:47:33 +0100
committerRichard Hughes <richard@hughsie.com>2014-08-11 22:47:51 +0100
commit47af38f9bb06f1ce499316299c4c682116c32828 (patch)
tree827132eea7d17ff8e8449c71d077643a28892d27
parentbae40691ee551e572cc73e6bd2bce438c429a623 (diff)
downloadappstream-glib-47af38f9bb06f1ce499316299c4c682116c32828.tar.gz
trivial: Do not try to write the icons tarball if there are no icons
-rw-r--r--libappstream-builder/asb-context.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libappstream-builder/asb-context.c b/libappstream-builder/asb-context.c
index 9fbdad3..c520dac 100644
--- a/libappstream-builder/asb-context.c
+++ b/libappstream-builder/asb-context.c
@@ -628,10 +628,12 @@ asb_context_write_icons (AsbContext *ctx,
const gchar *basename,
GError **error)
{
- _cleanup_free_ gchar *filename;
- _cleanup_free_ gchar *icons_dir;
+ _cleanup_free_ gchar *filename = NULL;
+ _cleanup_free_ gchar *icons_dir = NULL;
icons_dir = g_build_filename (temp_dir, "icons", NULL);
+ if (!g_file_test (icons_dir, G_FILE_TEST_EXISTS))
+ return TRUE;
filename = g_strdup_printf ("%s/%s-icons.tar.gz", output_dir, basename);
g_print ("Writing %s...\n", filename);
return asb_utils_write_archive_dir (filename, icons_dir, error);