diff --git a/alexandria-0.7.4-negative-value.patch b/alexandria-0.7.4-negative-value.patch deleted file mode 100644 index 88ce42c..0000000 --- a/alexandria-0.7.4-negative-value.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- alexandria-book-collection-manager-0.7.4/lib/alexandria/preferences.rb.negative 2019-10-25 01:20:07.000000000 +0900 -+++ alexandria-book-collection-manager-0.7.4/lib/alexandria/preferences.rb 2020-01-04 14:09:13.773911633 +0900 -@@ -239,7 +239,7 @@ module Alexandria - true - elsif value == "false" # bool - false -- elsif /^[0-9]+$/.match?(value) # int -+ elsif /^-?[0-9]+$/.match?(value) # int - value.to_i - elsif value =~ /^\[(.*)\]$/ # list (assume of type String) - Regexp.last_match[1].split(",") diff --git a/alexandria-0.7.4-newbook-nothread.patch b/alexandria-0.7.4-newbook-nothread.patch deleted file mode 100644 index b0eb648..0000000 --- a/alexandria-0.7.4-newbook-nothread.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/new_book_dialog.rb.nothread 2020-01-03 17:37:42.394366241 +0900 -+++ alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/new_book_dialog.rb 2020-01-04 13:24:08.240415691 +0900 -@@ -279,15 +279,17 @@ module Alexandria - get_images_async - false # continue == false if you get to here. Stop timeout. - end -- else -+ elsif @find_thread - # Stop if the book find thread has stopped. - @find_thread.alive? -+ else -+ true - end - # continue == false if @find_error OR if results are returned - # timeout ends if continue is false! - - unless continue -- unless @find_thread.alive? # This happens after find_thread is done -+ unless (@find_thread && @find_thread.alive?) # This happens after find_thread is done - unless @destroyed - # GLib::Source.remove(progress_pulsing) - # @progressbar.hide diff --git a/alexandria-0.7.4-set_initial_visibility-to-false.patch b/alexandria-0.7.4-set_initial_visibility-to-false.patch deleted file mode 100644 index 6cff3b2..0000000 --- a/alexandria-0.7.4-set_initial_visibility-to-false.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 18bb7b253ae1fa87baa85f52dc090f8ab95f34c7 Mon Sep 17 00:00:00 2001 -From: Matijs van Zuijlen -Date: Wed, 30 Oct 2019 09:59:26 +0100 -Subject: [PATCH] Set initial visibility for dialogs to False - -This should silence warnings about "GtkDialog mapped without a transient -parent. This is discouraged." ---- - share/alexandria/glade/acquire_dialog__builder.glade | 2 +- - share/alexandria/glade/book_properties_dialog__builder.glade | 2 +- - share/alexandria/glade/new_book_dialog__builder.glade | 2 +- - share/alexandria/glade/preferences_dialog__builder.glade | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/share/alexandria/glade/acquire_dialog__builder.glade b/share/alexandria/glade/acquire_dialog__builder.glade -index 0eed895e..a4909db0 100644 ---- a/share/alexandria/glade/acquire_dialog__builder.glade -+++ b/share/alexandria/glade/acquire_dialog__builder.glade -@@ -3,7 +3,7 @@ - - - -- True -+ False - False - 6 - Acquire from Scanner -diff --git a/share/alexandria/glade/book_properties_dialog__builder.glade b/share/alexandria/glade/book_properties_dialog__builder.glade -index c181797c..187b68c6 100644 ---- a/share/alexandria/glade/book_properties_dialog__builder.glade -+++ b/share/alexandria/glade/book_properties_dialog__builder.glade -@@ -3,7 +3,7 @@ - - - -- True -+ False - False - True - dialog -diff --git a/share/alexandria/glade/new_book_dialog__builder.glade b/share/alexandria/glade/new_book_dialog__builder.glade -index 9ac23685..5dbaccf6 100644 ---- a/share/alexandria/glade/new_book_dialog__builder.glade -+++ b/share/alexandria/glade/new_book_dialog__builder.glade -@@ -26,7 +26,7 @@ - - - -- True -+ False - False - 8 - Adding a Book -diff --git a/share/alexandria/glade/preferences_dialog__builder.glade b/share/alexandria/glade/preferences_dialog__builder.glade -index 8fa8c39a..80243c9a 100644 ---- a/share/alexandria/glade/preferences_dialog__builder.glade -+++ b/share/alexandria/glade/preferences_dialog__builder.glade -@@ -3,7 +3,7 @@ - - - -- True -+ False - False - Preferences - dialog diff --git a/alexandria-0.7.4-title-force-encoding.patch b/alexandria-0.7.4-title-force-encoding.patch index 1dd41a1..7774dbf 100644 --- a/alexandria-0.7.4-title-force-encoding.patch +++ b/alexandria-0.7.4-title-force-encoding.patch @@ -19,7 +19,7 @@ diff -urp alexandria-book-collection-manager-0.7.4.old/lib/alexandria/ui/book_pr end end - @entry_edition.text = book.edition -+ @entry_edition.text = book.edition.force_encoding('UTF-8') ++ @entry_edition.text = book.edition ? book.edition.force_encoding('UTF-8') : "" if book.tags @entry_tags.text = book.tags.join(",") # tags are comma-separated end diff --git a/alexandria-0.7.5-yaml-unescape.patch b/alexandria-0.7.5-yaml-unescape.patch deleted file mode 100644 index 905f105..0000000 --- a/alexandria-0.7.5-yaml-unescape.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- alexandria-book-collection-manager-0.7.5/lib/alexandria/library_store.rb.broken_yaml 2020-05-11 16:39:20.000000000 +0900 -+++ alexandria-book-collection-manager-0.7.5/lib/alexandria/library_store.rb 2020-10-17 16:07:44.600805994 +0900 -@@ -48,8 +48,23 @@ module Alexandria - Dir["*" + Library::EXT[:book]].sort.each do |filename| - test[1] = filename if (test[0]).zero? - -+ book_valid_p = true -+ - unless File.size? test[1] - log.warn { "Book file #{test[1]} was empty" } -+ book_valid_p = false -+ end -+ -+ if book_valid_p -+ begin -+ book = regularize_book_from_yaml(test[1]) -+ rescue Psych::SyntaxError => e -+ log.warn "Book file #{test[1]} could not be parsed" -+ book_valid_p = false -+ end -+ end -+ -+ if not book_valid_p - md = /([\dxX]{10,13})#{Library::EXT[:book]}/.match(filename) - if md - file_isbn = md[1] -@@ -60,7 +75,7 @@ module Alexandria - end - next - end -- book = regularize_book_from_yaml(test[1]) -+ - old_isbn = book.isbn - old_pub_year = book.publishing_year - begin -@@ -181,6 +196,8 @@ module Alexandria - private - - def regularize_book_from_yaml(name) -+ require 'syck/encoding' -+ - text = IO.read(name) - - # Code to remove the mystery string in books imported from Amazon -@@ -203,7 +220,7 @@ module Alexandria - end - - # TODO: Ensure book loading passes through Book#initialize -- book = YAML.safe_load(text, permitted_classes: [Book, Time]) -+ book = YAML.safe_load(Syck::unescape(text), permitted_classes: [Book, Time]) - - unless book.isbn.class == String - # HACK diff --git a/alexandria-0.7.6-negative-value.patch b/alexandria-0.7.6-negative-value.patch new file mode 100644 index 0000000..378bf54 --- /dev/null +++ b/alexandria-0.7.6-negative-value.patch @@ -0,0 +1,11 @@ +--- alexandria-book-collection-manager-0.7.6/lib/alexandria/preferences.rb.negative 2020-11-03 00:35:57.573343839 +0900 ++++ alexandria-book-collection-manager-0.7.6/lib/alexandria/preferences.rb 2020-11-03 00:37:21.996312604 +0900 +@@ -242,7 +242,7 @@ module Alexandria + true + when "false" # bool + false +- when /^[0-9]+$/ # int ++ when /^-?[0-9]+$/ # int + value.to_i + when /^\[(.*)\]$/ # list (assume of type String) + Regexp.last_match[1].split(",") diff --git a/alexandria-0.7.6-newbook-nothread.patch b/alexandria-0.7.6-newbook-nothread.patch new file mode 100644 index 0000000..9811969 --- /dev/null +++ b/alexandria-0.7.6-newbook-nothread.patch @@ -0,0 +1,22 @@ +--- alexandria-book-collection-manager-0.7.6/lib/alexandria/ui/new_book_dialog.rb.nothread 2020-11-03 00:29:34.194485720 +0900 ++++ alexandria-book-collection-manager-0.7.6/lib/alexandria/ui/new_book_dialog.rb 2020-11-03 00:34:01.426386821 +0900 +@@ -281,15 +281,17 @@ module Alexandria + get_images_async + false # continue == false if you get to here. Stop timeout. + end +- else ++ elsif @find_thread + # Stop if the book find thread has stopped. + @find_thread.alive? ++ else ++ true + end + # continue == false if @find_error OR if results are returned + # timeout ends if continue is false! + + # @find_thread.alive? happens after find_thread is done +- unless continue || @find_thread.alive? || @destroyed ++ unless continue || (@find_thread && @find_thread.alive?) || @destroyed + notify_end_add_by_isbn + @button_add.sensitive = false + end diff --git a/alexandria-0.7.6-yaml-unescape.patch b/alexandria-0.7.6-yaml-unescape.patch new file mode 100644 index 0000000..d2a0a36 --- /dev/null +++ b/alexandria-0.7.6-yaml-unescape.patch @@ -0,0 +1,53 @@ +--- alexandria-book-collection-manager-0.7.6/lib/alexandria/library_store.rb.broken_yaml 2020-11-01 21:35:07.000000000 +0900 ++++ alexandria-book-collection-manager-0.7.6/lib/alexandria/library_store.rb 2020-11-03 00:26:24.240552377 +0900 +@@ -48,8 +48,23 @@ module Alexandria + Dir["*" + Library::EXT[:book]].sort.each do |filename| + test[1] = filename if (test[0]).zero? + ++ book_valid_p = true ++ + unless File.size? test[1] + log.warn { "Book file #{test[1]} was empty" } ++ book_valid_p = false ++ end ++ ++ if book_valid_p ++ begin ++ book = regularize_book_from_yaml(test[1]) ++ rescue Psych::SyntaxError => e ++ log.warn "Book file #{test[1]} could not be parsed" ++ book_valid_p = false ++ end ++ end ++ ++ if not book_valid_p + md = /([\dxX]{10,13})#{Library::EXT[:book]}/.match(filename) + if md + file_isbn = md[1] +@@ -60,7 +75,7 @@ module Alexandria + end + next + end +- book = regularize_book_from_yaml(test[1]) ++ + old_isbn = book.isbn + old_pub_year = book.publishing_year + begin +@@ -181,6 +196,8 @@ module Alexandria + private + + def regularize_book_from_yaml(name) ++ require 'syck/encoding' ++ + text = IO.read(name) + + # Code to remove the mystery string in books imported from Amazon +@@ -203,7 +220,7 @@ module Alexandria + end + + # TODO: Ensure book loading passes through Book#initialize +- book = YAML.safe_load(text, permitted_classes: [Book, Time]) ++ book = YAML.safe_load(Syck::unescape(text), permitted_classes: [Book, Time]) + + unless book.isbn.instance_of? String + # HACK diff --git a/alexandria.spec b/alexandria.spec index be3f704..03d3612 100644 --- a/alexandria.spec +++ b/alexandria.spec @@ -1,4 +1,4 @@ -%define majorver 0.7.5 +%define majorver 0.7.6 %undefine minorver %undefine ifpre @@ -53,18 +53,18 @@ Patch21: alexandria-0.7.4-iconview-multibyte.patch # (this file) and other. Also handle broken yaml file correctly and let # user redownload it # (bug 861740) -Patch22: alexandria-0.7.5-yaml-unescape.patch +Patch22: alexandria-0.7.6-yaml-unescape.patch # Add a feature to remove broken yaml files at startup when requested # (bug 869556) Patch23: alexandria-0.7.4-delete-broken-yaml.patch # Handle the case thread was not created with adding new book -Patch25: alexandria-0.7.4-newbook-nothread.patch +Patch25: alexandria-0.7.6-newbook-nothread.patch # Make z3950 provider work # ZOOM::Connection.count must be string Patch26: alexandria-0.7.4-z3950-zoom-count.patch # Read negative value as integer in case position has such value # (bug 1014295) -Patch27: alexandria-0.7.4-negative-value.patch +Patch27: alexandria-0.7.6-negative-value.patch # Specify goocanvas version (bug 1024931) # This is obsolete with 0.7.4. 0.7.4 uses goocanvas2 with introspection # Make glade2 translatable text actually translated (i10ned) @@ -74,11 +74,6 @@ Patch30: alexandria-0.7.4-title-force-encoding.patch # Remove undefined / unneeded method Patch31: alexandria-0.7.4-remove-undefined-method.patch -# https://github.com/mvz/alexandria-book-collection-manager/issues/86 -# Revert the following change: -# https://github.com/mvz/alexandria-book-collection-manager/commit/18bb7b253ae1fa87baa85f52dc090f8ab95f34c7 -Patch1001: alexandria-0.7.4-set_initial_visibility-to-false.patch - BuildArch: noarch Requires: ruby(release) @@ -161,8 +156,6 @@ Alexandria is a GNOME application to help you manage your book collection. %patch30 -p1 -b .utf8_2 %patch31 -p1 -b .undefined_method -%patch1001 -p1 -b .visibility -R - # Embed Fedora EVR %{__sed} -i.evr \ -e "s|\(DISPLAY_VERSION = \).*$|\1'%{version}-%{release}'|" \ @@ -290,6 +283,9 @@ EOF %{_datadir}/icons/hicolor/*/apps/%{name}.* %changelog +* Mon Nov 2 2020 Mamoru TASAKA - 0.7.6-1 +- 0.7.6 + * Fri Oct 30 2020 Mamoru TASAKA - 0.7.5-1 - 0.7.5 - Once revert upstream change about setting initial visibility to false