From 9794808cb5dc38c731e95a168dba61a43dc4cb478733a4d5cb028871cc87f34b Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Thu, 20 Oct 2011 09:56:25 +0000 Subject: [PATCH] Accepting request 88800 from home:vuntz:branches:GNOME:Factory Add fix for unoconv calling OBS-URL: https://build.opensuse.org/request/show/88800 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/sushi?expand=0&rev=15 --- sushi-quote-unoconv.patch | 48 +++++++++++++++++++++++++++++++++++++++ sushi.changes | 6 +++++ sushi.spec | 3 +++ 3 files changed, 57 insertions(+) create mode 100644 sushi-quote-unoconv.patch diff --git a/sushi-quote-unoconv.patch b/sushi-quote-unoconv.patch new file mode 100644 index 0000000..a81e7da --- /dev/null +++ b/sushi-quote-unoconv.patch @@ -0,0 +1,48 @@ +commit e5c7dbe9e4d258bc1aca0c91335da12e759b8a38 +Author: Vincent Untz +Date: Wed Oct 19 16:09:55 2011 +0200 + + pdf-loader: quote the file path before passing it to unoconv + + This fixes unoconv crashing on files with spaces in their names. + + https://bugzilla.gnome.org/show_bug.cgi?id=662197 + +diff --git a/src/libsushi/sushi-pdf-loader.c b/src/libsushi/sushi-pdf-loader.c +index 9730375..b8f822d 100644 +--- a/src/libsushi/sushi-pdf-loader.c ++++ b/src/libsushi/sushi-pdf-loader.c +@@ -101,7 +101,7 @@ unoconv_child_watch_cb (GPid pid, + static void + load_openoffice (SushiPdfLoader *self) + { +- gchar *doc_path, *pdf_path, *tmp_name, *tmp_path; ++ gchar *doc_path, *pdf_path, *tmp_name, *tmp_path, *quoted_path; + GFile *file; + gboolean res; + gchar *cmd; +@@ -113,7 +113,10 @@ load_openoffice (SushiPdfLoader *self) + + file = g_file_new_for_uri (self->priv->uri); + doc_path = g_file_get_path (file); ++ quoted_path = g_shell_quote (doc_path); ++ + g_object_unref (file); ++ g_free (doc_path); + + tmp_name = g_strdup_printf ("sushi-%d.pdf", getpid ()); + tmp_path = g_build_filename (g_get_user_cache_dir (), "sushi", NULL); +@@ -121,11 +124,11 @@ load_openoffice (SushiPdfLoader *self) + g_build_filename (tmp_path, tmp_name, NULL); + g_mkdir_with_parents (tmp_path, 0700); + +- cmd = g_strdup_printf ("unoconv -f pdf -o %s %s", pdf_path, doc_path); ++ cmd = g_strdup_printf ("unoconv -f pdf -o %s %s", pdf_path, quoted_path); + +- g_free (doc_path); + g_free (tmp_name); + g_free (tmp_path); ++ g_free (quoted_path); + + res = g_shell_parse_argv (cmd, &argc, &argv, &error); + g_free (cmd); diff --git a/sushi.changes b/sushi.changes index 20165f4..d6386b5 100644 --- a/sushi.changes +++ b/sushi.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Oct 19 14:10:57 UTC 2011 - vuntz@opensuse.org + +- Add sushi-quote-unoconv.patch: quote the file path before passing + it to unoconv, to avoid issues when there is a space in the path. + ------------------------------------------------------------------- Mon Oct 17 20:15:29 CEST 2011 - dimstar@opensuse.org diff --git a/sushi.spec b/sushi.spec index 87325d7..fa0e5dc 100644 --- a/sushi.spec +++ b/sushi.spec @@ -25,6 +25,8 @@ Summary: Quick Previewer for Nautilus Url: http://www.gnome.org Group: Productivity/File utilities Source0: http://download.gnome.org/sources/sushi/0.2/%{name}-%{version}.tar.bz2 +# PATCH-FIX-UPSTREAM sushi-quote-unoconv.patch bgo#662197 vuntz@opensuse.org -- quote the file path before passing it to unoconv +Patch0: sushi-quote-unoconv.patch BuildRequires: gobject-introspection-devel BuildRequires: intltool BuildRequires: unoconv @@ -64,6 +66,7 @@ Sushi is a quick previewer for Nautilus, the GNOME desktop file manager. %lang_package %prep %setup -q +%patch0 -p1 %build %configure