From 64e0783902db45e4db95ed76e99f1f7f98090ca1 Mon Sep 17 00:00:00 2001 From: Yanko Kaneti Date: Mon, 24 Mar 2014 00:09:00 +0200 Subject: [PATCH] Update to 1.4. Drop upstream patches --- .gitignore | 1 + ...to-fix-crash-with-trash-recent-files.patch | 73 ------------------- ...-error-when-the-cover-can-t-be-found.patch | 27 ------- ...i-Don-t-bail-on-encrypted-mobi-files.patch | 33 --------- ...bi-Fix-parsing-garbage-with-no-cover.patch | 27 ------- gnome-epub-thumbnailer.spec | 19 ++--- sources | 2 +- 7 files changed, 8 insertions(+), 174 deletions(-) delete mode 100644 0001-Update-skeleton-to-fix-crash-with-trash-recent-files.patch delete mode 100644 0001-epub-Set-an-error-when-the-cover-can-t-be-found.patch delete mode 100644 0001-mobi-Don-t-bail-on-encrypted-mobi-files.patch delete mode 100644 0001-mobi-Fix-parsing-garbage-with-no-cover.patch diff --git a/.gitignore b/.gitignore index 645c4ed..0df979e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /gnome-epub-thumbnailer-1.1.tar.xz /gnome-epub-thumbnailer-1.2.tar.xz /gnome-epub-thumbnailer-1.3.tar.xz +/gnome-epub-thumbnailer-1.4.tar.xz diff --git a/0001-Update-skeleton-to-fix-crash-with-trash-recent-files.patch b/0001-Update-skeleton-to-fix-crash-with-trash-recent-files.patch deleted file mode 100644 index 20da236..0000000 --- a/0001-Update-skeleton-to-fix-crash-with-trash-recent-files.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 53d83c1a4a7f140149fec7f2aecf91034dbb3546 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Mon, 6 Jan 2014 12:45:24 +0100 -Subject: [PATCH] Update skeleton to fix crash with trash/recent files - ---- - gnome-thumbnailer-skeleton.c | 41 ++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 40 insertions(+), 1 deletion(-) - -diff --git a/gnome-thumbnailer-skeleton.c b/gnome-thumbnailer-skeleton.c -index b7ec3ec..e4c11a6 100644 ---- a/gnome-thumbnailer-skeleton.c -+++ b/gnome-thumbnailer-skeleton.c -@@ -34,6 +34,40 @@ static int output_size = 256; - static gboolean g_fatal_warnings = FALSE; - static char **filenames = NULL; - -+static char * -+get_target_uri (GFile *file) -+{ -+ GFileInfo *info; -+ char *target; -+ -+ info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI, G_FILE_QUERY_INFO_NONE, NULL, NULL); -+ if (info == NULL) -+ return NULL; -+ target = g_strdup (g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI)); -+ g_object_unref (info); -+ -+ return target; -+} -+ -+static char * -+get_target_path (GFile *input) -+{ -+ if (g_file_has_uri_scheme (input, "trash") != FALSE || -+ g_file_has_uri_scheme (input, "recent") != FALSE) { -+ GFile *file; -+ char *input_uri; -+ char *input_path; -+ -+ input_uri = get_target_uri (input); -+ file = g_file_new_for_uri (input_uri); -+ g_free (input_uri); -+ input_path = g_file_get_path (file); -+ g_object_unref (file); -+ return input_path; -+ } -+ return g_file_get_path (input); -+} -+ - static const GOptionEntry entries[] = { - { "size", 's', 0, G_OPTION_ARG_INT, &output_size, "Size of the thumbnail in pixels", NULL }, - {"g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &g_fatal_warnings, "Make all warnings fatal", NULL}, -@@ -84,9 +118,14 @@ int main (int argc, char **argv) - } - - input = g_file_new_for_commandline_arg (filenames[0]); -- input_filename = g_file_get_path (input); -+ input_filename = get_target_path (input); - g_object_unref (input); - -+ if (input_filename == NULL) { -+ g_warning ("Could not get file path for %s", filenames[0]); -+ return 1; -+ } -+ - output = filenames[1]; - - #ifdef THUMBNAILER_RETURNS_PIXBUF --- -1.8.5.2 - diff --git a/0001-epub-Set-an-error-when-the-cover-can-t-be-found.patch b/0001-epub-Set-an-error-when-the-cover-can-t-be-found.patch deleted file mode 100644 index 251ccb1..0000000 --- a/0001-epub-Set-an-error-when-the-cover-can-t-be-found.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 68841e9a7658b6bafd4d94f4199ea047d303f1d3 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Sun, 1 Sep 2013 17:26:13 +0200 -Subject: [PATCH] epub: Set an error when the cover can't be found - -This stops a crash in the thumbnailer if the cover cannot -be found. ---- - gnome-epub-thumbnailer.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gnome-epub-thumbnailer.c b/gnome-epub-thumbnailer.c -index e2a3615..1cb8149 100644 ---- a/gnome-epub-thumbnailer.c -+++ b/gnome-epub-thumbnailer.c -@@ -283,7 +283,7 @@ file_to_data (const char *path, - } - - if (cover_data == NULL) { -- g_warning ("Could not find cover file in '%s'", path); -+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Could not find cover file"); - return NULL; - } - --- -1.8.3.1 - diff --git a/0001-mobi-Don-t-bail-on-encrypted-mobi-files.patch b/0001-mobi-Don-t-bail-on-encrypted-mobi-files.patch deleted file mode 100644 index 709a161..0000000 --- a/0001-mobi-Don-t-bail-on-encrypted-mobi-files.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 675c4efafbfc1ecc9982ffcdb917fd4f73ca6a71 Mon Sep 17 00:00:00 2001 -From: Chris Lee -Date: Wed, 13 Nov 2013 01:58:30 -0800 -Subject: [PATCH] mobi: Don't bail on encrypted mobi files - -The image data isn't encrypted, so we can still generate thumbnails. - -http://wiki.mobileread.com/wiki/MOBI#MOBI_DRM ---- - gnome-mobi-thumbnailer.c | 7 ------- - 1 file changed, 7 deletions(-) - -diff --git a/gnome-mobi-thumbnailer.c b/gnome-mobi-thumbnailer.c -index f7c4081..67c04bf 100644 ---- a/gnome-mobi-thumbnailer.c -+++ b/gnome-mobi-thumbnailer.c -@@ -166,13 +166,6 @@ get_image_section (GInputStream *stream, - - header = get_section_data (G_INPUT_STREAM (stream), sections, 0, &len); - -- /* Checking crypto type */ -- if (get_guint16 (header + 0xC) != 0) { -- g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, "File is encrypted"); -- g_free (header); -- return -1; -- } -- - /* Checking metadata availability */ - if (!(get_guint32 (header + 0x80) & 0x40)) { - g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, "File has no metadata"); --- -1.8.5.2 - diff --git a/0001-mobi-Fix-parsing-garbage-with-no-cover.patch b/0001-mobi-Fix-parsing-garbage-with-no-cover.patch deleted file mode 100644 index 5e05ba2..0000000 --- a/0001-mobi-Fix-parsing-garbage-with-no-cover.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 3358deaeb0a2025d0bfa8458e697f0e911e2f363 Mon Sep 17 00:00:00 2001 -From: Bastien Nocera -Date: Wed, 13 Nov 2013 18:21:19 +0100 -Subject: [PATCH] mobi: Fix parsing garbage with no cover - -We were never checking the retval of get_cover_img_num() so if -no covers were found, we'd try to read index-of-first-img minus 1. ---- - gnome-mobi-thumbnailer.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/gnome-mobi-thumbnailer.c b/gnome-mobi-thumbnailer.c -index 67c04bf..797192a 100644 ---- a/gnome-mobi-thumbnailer.c -+++ b/gnome-mobi-thumbnailer.c -@@ -183,6 +183,8 @@ get_image_section (GInputStream *stream, - } - - image_num = get_cover_img_num (header); -+ if (image_num < 0) -+ return image_num; - - return first_img + image_num; - } --- -1.8.5.2 - diff --git a/gnome-epub-thumbnailer.spec b/gnome-epub-thumbnailer.spec index 3f0f181..20f65ff 100644 --- a/gnome-epub-thumbnailer.spec +++ b/gnome-epub-thumbnailer.spec @@ -1,20 +1,11 @@ Name: gnome-epub-thumbnailer -Version: 1.3 -Release: 4%{?dist} +Version: 1.4 +Release: 1%{?dist} Summary: Thumbnailers for EPub and MOBI books License: GPLv2+ URL: https://git.gnome.org/browse/gnome-epub-thumbnailer -Source0: http://download.gnome.org/sources/%{name}/1.3/%{name}-%{version}.tar.xz - -# Upstream commit 68841e9a7658b6bafd4d94f4199ea047d303f1d3 -Patch1: 0001-epub-Set-an-error-when-the-cover-can-t-be-found.patch -# Upstream 675c4efafbfc1ecc9982ffcdb917fd4f73ca6a71 -Patch2: 0001-mobi-Don-t-bail-on-encrypted-mobi-files.patch -# Upstream commit 53d83c1a4a7f140149fec7f2aecf91034dbb3546 -Patch3: 0001-Update-skeleton-to-fix-crash-with-trash-recent-files.patch -# Upstream commit 3358deaeb0a2025d0bfa8458e697f0e911e2f363 -Patch4: 0001-mobi-Fix-parsing-garbage-with-no-cover.patch +Source0: http://download.gnome.org/sources/%{name}/1.4/%{name}-%{version}.tar.xz BuildRequires: pkgconfig(gdk-pixbuf-2.0) BuildRequires: pkgconfig(gio-2.0) @@ -27,7 +18,6 @@ Thumbnailers for EPub and MOBI books %prep %setup -q -%autopatch %build @@ -50,6 +40,9 @@ make DESTDIR=$RPM_BUILD_ROOT install %changelog +* Sun Mar 23 2014 Yanko Kaneti - 1.4-1 +- Update to 1.4. Drop upstream patches. + * Thu Jan 16 2014 Yanko Kaneti - 1.3-4 - Yet another crash fix from upstream diff --git a/sources b/sources index 1197917..bdcc2fd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -01d078d260639c1232fb6541f33b24f4 gnome-epub-thumbnailer-1.3.tar.xz +6327d406264c0af1b1ee6a66f14edc94 gnome-epub-thumbnailer-1.4.tar.xz