diff --git a/alexandria-0.6.9-delete-broken-yaml.patch b/alexandria-0.6.9-delete-broken-yaml.patch deleted file mode 100644 index 8141ef6..0000000 --- a/alexandria-0.6.9-delete-broken-yaml.patch +++ /dev/null @@ -1,87 +0,0 @@ ---- alexandria-0.6.9/lib/alexandria/models/library.rb.delbroken 2012-10-25 14:39:40.029847934 +0900 -+++ alexandria-0.6.9/lib/alexandria/models/library.rb 2012-10-24 13:58:38.445172696 +0900 -@@ -98,7 +98,7 @@ - md = /([\dxX]{10,13})#{EXT[:book]}/.match(filename) - if md - file_isbn = md[1] -- ruined_books << [nil, file_isbn, library] -+ ruined_books << [nil, file_isbn, library, filename, library.path] - else - log.warn { "Filename #{filename} does not contain an ISBN"} - #TODO delete this file... ---- alexandria-0.6.9/lib/alexandria/ui/ui_manager.rb.delbroken 2012-10-25 14:39:40.026847577 +0900 -+++ alexandria-0.6.9/lib/alexandria/ui/ui_manager.rb 2012-10-24 14:03:49.811462773 +0900 -@@ -805,6 +805,73 @@ - false - end - end -+ else ## if response_type == Gtk::Dialog::RESPONSE_OK -+ handle_and_delete_ruined_books -+ end -+ end -+ end -+ -+ def handle_and_delete_ruined_books -+ title = _("Delete Book Data") -+ new_message = _("Or do you wish to delete the data files for the following books are malformed or empty?\n") -+ -+ @libraries.ruined_books.each { |bi| -+ new_message += "\n#{bi[1] or bi[1].inspect}" -+ } -+ recovery_dialog = Gtk::MessageDialog.new(@main_app, Gtk::Dialog::MODAL, -+ Gtk::MessageDialog::WARNING, -+ Gtk::MessageDialog::BUTTONS_OK_CANCEL, -+ new_message ).show -+ recovery_dialog.signal_connect('response') do |dialog, response_type| -+ recovery_dialog.destroy -+ if response_type == Gtk::Dialog::RESPONSE_OK -+ books_to_add = [] -+ -+ # progress indicator... -+ @progressbar.fraction = 0 -+ @appbar.children.first.visible = true # show the progress bar -+ -+ total_book_count = @libraries.ruined_books.size -+ fraction_per_book = 1.0 / total_book_count -+ prog_percentage = 0 -+ -+ @libraries.ruined_books.reverse! -+ Gtk.idle_add do -+ ruined_book = @libraries.ruined_books.pop -+ if ruined_book -+ book, isbn, library, filename, path = ruined_book -+ filename_path = File.join(path, filename) -+ begin -+ File.delete(filename_path) -+ set_status_label(_("The file '%s' removed") % filename) -+ log.debug {"The maybe-malformed file #{filename} removed"} -+ -+ rescue Exception => ex -+ log.error { "Could not delete #{filename_path}: #{ex}" } -+ log.error { ex.backtrace.join("\n") } -+ end -+ -+ prog_percentage += fraction_per_book -+ @progressbar.fraction = prog_percentage -+ -+ true -+ else -+ ## Totally copied and pasted from refresh_books... -+ ## call this the second strike... (CathalMagus) -+ -+ # @iconview.unfreeze -+ # @filtered_model.refilter -+ # @listview.columns_autosize -+ -+ @progressbar.fraction = 1 -+ ## Hide the progress bar. -+ @appbar.children.first.visible = false -+ ## Refresh the status bar. -+ set_status_label('') -+ # on_books_selection_changed -+ false -+ end -+ end - end - end - end diff --git a/alexandria-0.6.9-goocanvas-version.patch b/alexandria-0.6.9-goocanvas-version.patch deleted file mode 100644 index e016840..0000000 --- a/alexandria-0.6.9-goocanvas-version.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- alexandria-0.6.9/lib/alexandria/ui/dialogs/barcode_animation.rb.goocanvasver 2011-11-19 23:49:44.000000000 +0900 -+++ alexandria-0.6.9/lib/alexandria/ui/dialogs/barcode_animation.rb 2013-11-01 19:29:54.745495052 +0900 -@@ -20,6 +20,8 @@ - # Boston, MA 02110-1301 USA. - #++ - -+require 'rubygems' -+gem 'goocanvas', '~> 1.0' - require 'goocanvas' - - module Alexandria diff --git a/alexandria-0.6.9-iconv.patch b/alexandria-0.6.9-iconv.patch deleted file mode 100644 index 97c20a5..0000000 --- a/alexandria-0.6.9-iconv.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- alexandria-0.6.9/lib/alexandria/book_providers/adlibris.rb.iconv 2009-12-22 06:49:50.000000000 +0900 -+++ alexandria-0.6.9/lib/alexandria/book_providers/adlibris.rb 2013-02-16 09:52:51.000000000 +0900 -@@ -26,7 +26,7 @@ - - require 'cgi' - require 'alexandria/net' --require 'iconv' -+#require 'iconv' - - module Alexandria - class BookProviders ---- alexandria-0.6.9/lib/alexandria/book_providers/web.rb.iconv 2010-08-03 05:40:36.000000000 +0900 -+++ alexandria-0.6.9/lib/alexandria/book_providers/web.rb 2013-02-16 09:55:55.000000000 +0900 -@@ -17,7 +17,8 @@ - if source_data_charset == "UTF-8" - utf8_html = html - else -- utf8_html = Iconv.conv("UTF-8", source_data_charset, html) -+ #utf8_html = Iconv.conv("UTF-8", source_data_charset, html) -+ utf8_html = html.encode("UTF-8", source_data_charset, :invalid => :replace, :replace => '') - end - normalized_html = @htmlentities.decode(utf8_html) - Hpricot(normalized_html) diff --git a/alexandria-0.6.9-negative-value.patch b/alexandria-0.6.9-negative-value.patch deleted file mode 100644 index 07e53cf..0000000 --- a/alexandria-0.6.9-negative-value.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- alexandria-0.6.9/lib/alexandria/preferences.rb.negative 2011-11-19 23:48:14.000000000 +0900 -+++ alexandria-0.6.9/lib/alexandria/preferences.rb 2013-10-07 11:56:16.598198605 +0900 -@@ -326,7 +326,7 @@ - return true - elsif value == "false" # bool - return false -- elsif value =~ /^[0-9]+$/ # int -+ elsif value =~ /^-?[0-9]+$/ # int - return value.to_i - elsif value =~ /^\[(.*)\]$/ # list (assume of type String) - return $1.split(",") diff --git a/alexandria-0.6.9-newbook-nothread.patch b/alexandria-0.6.9-newbook-nothread.patch deleted file mode 100644 index a564486..0000000 --- a/alexandria-0.6.9-newbook-nothread.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- alexandria-0.6.9/lib/alexandria/ui/dialogs/new_book_dialog.rb.nothread 2013-02-16 09:59:08.000000000 +0900 -+++ alexandria-0.6.9/lib/alexandria/ui/dialogs/new_book_dialog.rb 2013-02-16 10:41:58.000000000 +0900 -@@ -345,15 +345,17 @@ - get_images_async - false #continue == false if you get to here. Stop timeout_add. - 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_add 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 - # Gtk.timeout_remove(progress_pulsing) - # @progressbar.hide diff --git a/alexandria-0.6.9-z3950-zoom-count.patch b/alexandria-0.6.9-z3950-zoom-count.patch deleted file mode 100644 index 03311e3..0000000 --- a/alexandria-0.6.9-z3950-zoom-count.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- alexandria-0.6.9/lib/alexandria/book_providers/z3950.rb.zoom_count 2013-08-21 17:23:31.427078416 +0900 -+++ alexandria-0.6.9/lib/alexandria/book_providers/z3950.rb 2013-08-21 16:08:23.424525528 +0900 -@@ -169,7 +169,9 @@ - - conn.preferred_record_syntax = prefs['record_syntax'] - conn.element_set_name = 'F' -- conn.count = conn_count -+ #conn.count = conn_count -+ #conn.count must be string, later ZOOM_options_get_int() changes this into int -+ conn.count = conn_count.to_s - attr = case type - when SEARCH_BY_ISBN then [7] - when SEARCH_BY_TITLE then [4] diff --git a/alexandria-0.7.4-delete-broken-yaml.patch b/alexandria-0.7.4-delete-broken-yaml.patch new file mode 100644 index 0000000..c5409c6 --- /dev/null +++ b/alexandria-0.7.4-delete-broken-yaml.patch @@ -0,0 +1,87 @@ +--- alexandria-book-collection-manager-0.7.4/lib/alexandria/library_store.rb.delbroken 2020-01-03 17:38:07.340338529 +0900 ++++ alexandria-book-collection-manager-0.7.4/lib/alexandria/library_store.rb 2020-01-04 13:04:55.467319713 +0900 +@@ -68,7 +68,7 @@ module Alexandria + md = /([\dxX]{10,13})#{Library::EXT[:book]}/.match(filename) + if md + file_isbn = md[1] +- ruined_books << [nil, file_isbn, library] ++ ruined_books << [nil, file_isbn, library, filename, library.path] + else + log.warn { "Filename #{filename} does not contain an ISBN" } + # TODO: delete this file... +--- alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/ui_manager.rb.delbroken 2020-01-03 17:37:42.404366230 +0900 ++++ alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/ui_manager.rb 2020-01-04 13:09:04.588530827 +0900 +@@ -694,6 +694,73 @@ module Alexandria + false + end + end ++ else ## if response_type == Gtk::Dialog::RESPONSE_OK ++ handle_and_delete_ruined_books ++ end ++ end ++ end ++ ++ def handle_and_delete_ruined_books ++ title = _("Delete Book Data") ++ new_message = _("Or do you wish to delete the data files for the following books are malformed or empty?\n") ++ ++ @libraries.ruined_books.each { |bi| ++ new_message += "\n#{bi[1] or bi[1].inspect}" ++ } ++ recovery_dialog = Gtk::MessageDialog.new(@main_app, Gtk::Dialog::MODAL, ++ Gtk::MessageDialog::WARNING, ++ Gtk::MessageDialog::BUTTONS_OK_CANCEL, ++ new_message ).show ++ recovery_dialog.signal_connect('response') do |dialog, response_type| ++ recovery_dialog.destroy ++ if response_type == Gtk::Dialog::RESPONSE_OK ++ books_to_add = [] ++ ++ # progress indicator... ++ @progressbar.fraction = 0 ++ @appbar.children.first.visible = true # show the progress bar ++ ++ total_book_count = @libraries.ruined_books.size ++ fraction_per_book = 1.0 / total_book_count ++ prog_percentage = 0 ++ ++ @libraries.ruined_books.reverse! ++ Gtk.idle_add do ++ ruined_book = @libraries.ruined_books.pop ++ if ruined_book ++ book, isbn, library, filename, path = ruined_book ++ filename_path = File.join(path, filename) ++ begin ++ File.delete(filename_path) ++ set_status_label(_("The file '%s' removed") % filename) ++ log.debug {"The maybe-malformed file #{filename} removed"} ++ ++ rescue Exception => ex ++ log.error { "Could not delete #{filename_path}: #{ex}" } ++ log.error { ex.backtrace.join("\n") } ++ end ++ ++ prog_percentage += fraction_per_book ++ @progressbar.fraction = prog_percentage ++ ++ true ++ else ++ ## Totally copied and pasted from refresh_books... ++ ## call this the second strike... (CathalMagus) ++ ++ # @iconview.unfreeze ++ # @filtered_model.refilter ++ # @listview.columns_autosize ++ ++ @progressbar.fraction = 1 ++ ## Hide the progress bar. ++ @appbar.children.first.visible = false ++ ## Refresh the status bar. ++ set_status_label('') ++ # on_books_selection_changed ++ false ++ end ++ end + end + end + end diff --git a/alexandria-0.7.4-negative-value.patch b/alexandria-0.7.4-negative-value.patch new file mode 100644 index 0000000..88ce42c --- /dev/null +++ b/alexandria-0.7.4-negative-value.patch @@ -0,0 +1,11 @@ +--- 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 new file mode 100644 index 0000000..b0eb648 --- /dev/null +++ b/alexandria-0.7.4-newbook-nothread.patch @@ -0,0 +1,22 @@ +--- 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-z3950-zoom-count.patch b/alexandria-0.7.4-z3950-zoom-count.patch new file mode 100644 index 0000000..ec82c15 --- /dev/null +++ b/alexandria-0.7.4-z3950-zoom-count.patch @@ -0,0 +1,15 @@ +--- alexandria-book-collection-manager-0.7.4/lib/alexandria/book_providers/z3950.rb.zoom_count 2019-10-25 01:20:07.000000000 +0900 ++++ alexandria-book-collection-manager-0.7.4/lib/alexandria/book_providers/z3950.rb 2020-01-04 13:59:39.224201295 +0900 +@@ -149,7 +149,11 @@ module Alexandria + + conn.preferred_record_syntax = prefs["record_syntax"] + conn.element_set_name = "F" +- conn.count = conn_count ++ #conn.count = conn_count ++ #conn.count must be string, ZOOM's "define_zoom_option" calls rbz_connection_get_option, ++ #conn.count must be string, ZOOM's "define_zoom_option" calls rbz_connection_get_option, ++ #which calls ZOOM_connection_option_get, and it expects that conn.count is string. ++ conn.count = conn_count.to_s + attr = case type + when SEARCH_BY_ISBN then [7] + when SEARCH_BY_TITLE then [4] diff --git a/alexandria.spec b/alexandria.spec index 964601f..ad016cf 100644 --- a/alexandria.spec +++ b/alexandria.spec @@ -56,19 +56,17 @@ Patch21: alexandria-0.7.4-iconview-multibyte.patch Patch22: alexandria-0.7.4-yaml-unescape.patch # Add a feature to remove broken yaml files at startup when requested # (bug 869556) -Patch23: alexandria-0.6.9-delete-broken-yaml.patch -# Kill iconv -Patch24: alexandria-0.6.9-iconv.patch +Patch23: alexandria-0.7.4-delete-broken-yaml.patch # Handle the case thread was not created with adding new book -Patch25: alexandria-0.6.9-newbook-nothread.patch +Patch25: alexandria-0.7.4-newbook-nothread.patch # Make z3950 provider work # ZOOM::Connection.count must be string -Patch26: alexandria-0.6.9-z3950-zoom-count.patch +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.6.9-negative-value.patch +Patch27: alexandria-0.7.4-negative-value.patch # Specify goocanvas version (bug 1024931) -Patch28: alexandria-0.6.9-goocanvas-version.patch +# This is obsolete with 0.7.4. 0.7.4 uses goocanvas2 with introspection # Make glade2 translatable text actually translated (i10ned) Patch29: alexandria-0.6.9-glade-gettext.patch # Make this compatible with rubygem-gdk_pixbuf2 3.0.9 @@ -125,6 +123,7 @@ Requires: rubygem(glib2) # Added from 0.6.8 # Requires: rubygem(goocanvas) # The above needs more explicit +# With 0.7.4 this dependency changed, goocanvas2 + introspection %if 0%{?fedora} >= 20 Requires: rubygem-goocanvas1 %else @@ -158,11 +157,9 @@ Alexandria is a GNOME application to help you manage your book collection. %patch21 -p1 -b .icon_kanji %patch22 -p1 -b .broken_yaml %patch23 -p1 -b .delete_yaml -%patch24 -p1 -b .iconv %patch25 -p1 -b .nothread %patch26 -p1 -b .z3950_count %patch27 -p1 -b .negative -%patch28 -p1 -b .goocanvasver %patch29 -p1 -b .gettext %patch30 -p1 -b .rg309