[glib] resources: compiler: Make to-pixbuf failure fatal
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] resources: compiler: Make to-pixbuf failure fatal
- Date: Thu, 2 Feb 2012 22:45:23 +0000 (UTC)
commit 296a2a72c6837ddc90a372b5bc6aea95a9bf82be
Author: Christian Persch <chpe gnome org>
Date: Tue Jan 31 18:01:25 2012 +0100
resources: compiler: Make to-pixbuf failure fatal
Bug #669123.
gio/glib-compile-resources.c | 12 +++++++++---
gio/gresource.c | 9 +++++----
2 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/gio/glib-compile-resources.c b/gio/glib-compile-resources.c
index f677cb5..93938f8 100644
--- a/gio/glib-compile-resources.c
+++ b/gio/glib-compile-resources.c
@@ -302,13 +302,19 @@ end_element (GMarkupParseContext *context,
real_file = g_strdup (tmp_file);
}
- if (to_pixdata && gdk_pixbuf_pixdata == NULL)
- g_printerr ("GDK_PIXBUF_PIXDATA not set and gdk-pixbuf-pixdata not found in path; skipping to-pixdata preprocessing.\n");
- if (to_pixdata && gdk_pixbuf_pixdata != NULL)
+ if (to_pixdata)
{
gchar *argv[4];
int status, fd, argc;
+ if (gdk_pixbuf_pixdata == NULL)
+ {
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "to-pixbuf preprocessing requested but GDK_PIXBUF_PIXDATA "
+ "not set and gdk-pixbuf-pixdata not found in path");
+ goto cleanup;
+ }
+
tmp_file2 = g_strdup ("resource-XXXXXXXX");
if ((fd = g_mkstemp (tmp_file2)) == -1)
{
diff --git a/gio/gresource.c b/gio/gresource.c
index 150eb5d..f177a85 100644
--- a/gio/gresource.c
+++ b/gio/gresource.c
@@ -68,16 +68,17 @@ G_DEFINE_BOXED_TYPE (GResource, g_resource, g_resource_ref, g_resource_unref)
* <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
* The only options currently supported are:
*
- * <literal>xml-stripblanks</literal> which will use <literal>xmllint</literal> to strip
+ * <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
* ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
* environment variable must be set to the full path to the xmllint executable, or xmllint
* must be in the PATH; otherwise the preprocessing step is skipped.
*
- * <literal>to-pixdata</literal> which will use <literal>gdk-pixbuf-pixdata</literal> to convert
+ * <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
* images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
- * the resource file, rather than an (uncompressed) copy if it. For this to work, the gdk-pixbuf-pixdata
+ * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
* program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
- * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the preprocessing step is skipped.
+ * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
+ * abort.
*
* Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
* which takes an xml file that describes the bundle, and a set of files that the xml references. These
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]