diff --git a/.gitignore b/.gitignore index 7596002..52ef19e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1 @@ -alexandria-0.6.6.tar.gz -/alexandria-0.6.6-svn1154_trunk.tar.gz -/alexandria-0.6.7.tar.gz -/alexandria-0.6.8.tar.gz -/alexandria-0.6.9.tar.gz +/alexandria-*.tar.gz diff --git a/alexandria-0.6.8-always-require-rubygems.patch b/alexandria-0.6.8-always-require-rubygems.patch deleted file mode 100644 index 9ae8525..0000000 --- a/alexandria-0.6.8-always-require-rubygems.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- alexandria-0.6.8/bin/alexandria.gem 2009-12-13 05:58:08.000000000 +0900 -+++ alexandria-0.6.8/bin/alexandria 2011-12-25 02:37:12.000000000 +0900 -@@ -2,6 +2,7 @@ - - $KCODE = 'U' - -+require 'rubygems' - begin - require 'gettext' - rescue LoadError diff --git a/alexandria-0.6.8-ascii-fix.patch b/alexandria-0.6.8-ascii-fix.patch deleted file mode 100644 index 5c43ebf..0000000 --- a/alexandria-0.6.8-ascii-fix.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -up alexandria-0.6.8/util/rake/omfgenerate.rb.ascii alexandria-0.6.8/util/rake/omfgenerate.rb ---- alexandria-0.6.8/util/rake/omfgenerate.rb.ascii 2012-03-23 15:31:31.766631433 -0400 -+++ alexandria-0.6.8/util/rake/omfgenerate.rb 2012-03-23 15:31:50.460456351 -0400 -@@ -73,10 +73,10 @@ class OmfGenerateTask < Rake::TaskLib - rule '.omf' => ['.omf.in'] do |t| - path = File.join(@gnome_helpfiles_dir, @projectname, - locale_for(t.name), "#{@projectname}.xml") -- data = IO.read(t.source) -+ data = IO.read(t.source, :encoding => "BINARY") - data.sub!(/PATH_TO_DOC_FILE/, path) - puts "Generating #{t.name}..." -- File.open(t.name, 'w') { |io| io.puts data } -+ File.open(t.name, 'w', :encoding => "BINARY") { |io| io.puts data } - end - omf_files.each {|o| @generated_files << o } - end diff --git a/alexandria-0.6.8-evalfix.patch b/alexandria-0.6.8-evalfix.patch deleted file mode 100644 index 487ab16..0000000 --- a/alexandria-0.6.8-evalfix.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -up alexandria-0.6.8/lib/alexandria/book_providers.rb.evalfix alexandria-0.6.8/lib/alexandria/book_providers.rb ---- alexandria-0.6.8/lib/alexandria/book_providers.rb.evalfix 2011-11-15 07:43:04.000000000 -0500 -+++ alexandria-0.6.8/lib/alexandria/book_providers.rb 2012-03-23 16:25:22.415869366 -0400 -@@ -375,7 +375,7 @@ module Alexandria - providers = {} - self.class.constants.each do |constant| - next unless md = /(.+)Provider$/.match(constant) -- klass = self.class.module_eval(constant) -+ klass = self.class.module_eval(constant.to_s) - if klass.ancestors.include?(AbstractProvider) and - klass != GenericProvider and - klass != WebsiteBasedProvider and -diff -up alexandria-0.6.8/lib/alexandria/smart_library.rb.evalfix alexandria-0.6.8/lib/alexandria/smart_library.rb ---- alexandria-0.6.8/lib/alexandria/smart_library.rb.evalfix 2009-03-25 19:09:32.000000000 -0400 -+++ alexandria-0.6.8/lib/alexandria/smart_library.rb 2012-03-23 16:24:11.833511912 -0400 -@@ -471,8 +471,7 @@ begin - - }) - -- ALL = self.constants.map \ -- { |x| self.module_eval(x) }.select \ -+ ALL = self.constants.map { |x| self.module_eval(x.to_s) }.select \ - { |x| x.is_a?(Operator) } - end - diff --git a/alexandria-0.6.8-export-to-CSV-bintex-with-ruby19.patch b/alexandria-0.6.8-export-to-CSV-bintex-with-ruby19.patch deleted file mode 100644 index ee53db3..0000000 --- a/alexandria-0.6.8-export-to-CSV-bintex-with-ruby19.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- alexandria-0.6.8/lib/alexandria/export_library.rb.ruby19_csv 2012-05-30 10:04:18.167329943 +0900 -+++ alexandria-0.6.8/lib/alexandria/export_library.rb 2012-05-30 10:07:52.230277906 +0900 -@@ -241,7 +241,14 @@ - File.open(filename, 'w') do |io| - io.puts "Title" + ';' + "Authors" + ';' + "Publisher" + ';' + "Edition" + ';' + "ISBN" + ';' + "Year Published" + ';' + "Rating" + "(0 to #{UI::MainApp::MAX_RATING_STARS.to_s})" + ';' + "Notes" + ';' + "Want?" + ';' + "Read?" + ';' + "Own?" + ';' + "Tags" - each do |book| -- io.puts book.title + ';' + book.authors.join(', ') + ';' + (book.publisher or "") + ';' + (book.edition or "") + ';' + (book.isbn or "") + ';' + (book.publishing_year.to_s or "") + ';' + (book.rating.to_s or "0") + ';' + (book.notes or "") + ';' + ( book.want ? "1" : "0") + ';' + ( book.redd ? "1" : "0") + ';' + ( book.own ? "1" : "0") + ';' + (book.tags ? book.tags.join(', ') : "") -+ io.puts book.title.force_encoding('UTF-8') + ';' + -+ book.authors.join(', ').force_encoding('UTF-8') + ';' + -+ (book.publisher or "").force_encoding('UTF-8') + ';' + -+ (book.edition or "").force_encoding('UTF-8') + ';' + (book.isbn or "") + ';' + -+ (book.publishing_year.to_s or "") + ';' + (book.rating.to_s or "0") + ';' + -+ (book.notes or "") + ';' + ( book.want ? "1" : "0") + ';' + -+ ( book.redd ? "1" : "0") + ';' + ( book.own ? "1" : "0") + -+ ';' + (book.tags ? book.tags.join(', ') : "") - end - end - end -@@ -499,12 +506,12 @@ - if book.authors != [] - bibtex << book.authors[0] - book.authors[1..-1].each do |author| -- bibtex << " and #{latex_escape(author)}" -+ bibtex << " and #{latex_escape(author.force_encoding('UTF-8'))}" - end - end - bibtex << "\",\n" -- bibtex << "title = \"#{latex_escape(book.title)}\",\n" -- bibtex << "publisher = \"#{latex_escape(book.publisher)}\",\n" -+ bibtex << "title = \"#{latex_escape(book.title.force_encoding('UTF-8'))}\",\n" -+ bibtex << "publisher = \"#{latex_escape(book.publisher.force_encoding('UTF-8'))}\",\n" - if book.notes and not book.notes.empty? - bibtex << "OPTnote = \"#{latex_escape(book.notes)}\",\n" - end diff --git a/alexandria-0.6.8-export-to-HTML-with-ruby19.patch b/alexandria-0.6.8-export-to-HTML-with-ruby19.patch deleted file mode 100644 index dec5c0b..0000000 --- a/alexandria-0.6.8-export-to-HTML-with-ruby19.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- alexandria-0.6.8/lib/alexandria/export_library.rb.export 2009-03-26 08:09:32.000000000 +0900 -+++ alexandria-0.6.8/lib/alexandria/export_library.rb 2012-05-06 01:22:03.000000000 +0900 -@@ -420,7 +420,7 @@ - xhtml << <#{xhtml_escape(book.title)}

-+

#{xhtml_escape(book.title).force_encoding("UTF-8")}

- EOS - end - -@@ -447,7 +447,7 @@ - xhtml << "" -@@ -455,13 +455,13 @@ - - unless book.edition == nil - xhtml << <#{xhtml_escape(book.edition)}

-+

#{xhtml_escape(book.edition).force_encoding("UTF-8")}

- EOS - end - - unless book.publisher == nil - xhtml << <#{xhtml_escape(book.publisher)}

-+

#{xhtml_escape(book.publisher).force_encoding("UTF-8")}

- EOS - end - diff --git a/alexandria-0.6.8-nogst-support.patch b/alexandria-0.6.8-nogst-support.patch deleted file mode 100644 index 49104b4..0000000 --- a/alexandria-0.6.8-nogst-support.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- alexandria-0.6.8/lib/alexandria/ui/dialogs/acquire_dialog.rb.nogst 2011-11-16 02:37:09.000000000 +0900 -+++ alexandria-0.6.8/lib/alexandria/ui/dialogs/acquire_dialog.rb 2011-12-25 02:22:12.000000000 +0900 -@@ -20,7 +20,18 @@ - require 'alexandria/scanners/cuecat' - require 'alexandria/scanners/keyboard' - --require 'alexandria/ui/sound' -+support_sound = true -+begin -+ require 'gst' -+rescue LoadError => e -+ Alexandria::log.warn { e.message } -+ Alexandria::log.warn { "Sound support is disabled" } -+ support_sound = false -+end -+ -+if support_sound -+ require 'alexandria/ui/sound' -+end - require 'alexandria/ui/dialogs/barcode_animation' - - module Alexandria -@@ -556,6 +567,7 @@ - end - end - -+ return unless support_sound - # @sound_player = SoundEffectsPlayer.new - @sound_players = {} - @sound_players["scanning"] = SoundEffectsPlayer.new -@@ -565,6 +577,7 @@ - end - - def play_sound(effect) -+ return unless support_sound - # HACK, do some thread waiting, if possible - puts "scanning sound : #{@prefs.play_scanning_sound}" - puts "scan sound: #{ @prefs.play_scan_sound}" diff --git a/alexandria-0.6.8-rdoc.patch b/alexandria-0.6.8-rdoc.patch deleted file mode 100644 index a6d2417..0000000 --- a/alexandria-0.6.8-rdoc.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up alexandria-0.6.8/doc/cuecat_support.rdoc alexandria-0.6.8/doc/cuecat_support -diff -up alexandria-0.6.8/Rakefile.rdoc alexandria-0.6.8/Rakefile ---- alexandria-0.6.8/Rakefile.rdoc 2012-03-23 12:19:23.151041440 -0400 -+++ alexandria-0.6.8/Rakefile 2012-03-23 12:19:32.967945925 -0400 -@@ -32,7 +32,7 @@ rescue LoadError - end - - require 'rake/clean' --require 'rake/rdoctask' -+require 'rdoc/task' - require 'rake/packagetask' - - $:.unshift(File.join(File.dirname(__FILE__), 'util/rake')) diff --git a/alexandria-0.6.8-utf8-convert.patch b/alexandria-0.6.8-utf8-convert.patch deleted file mode 100644 index 8db1fbc..0000000 --- a/alexandria-0.6.8-utf8-convert.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- alexandria-0.6.8/lib/alexandria/ui/dialogs/misc_dialogs.rb.ruby19_utf8 2009-03-26 08:09:32.000000000 +0900 -+++ alexandria-0.6.8/lib/alexandria/ui/dialogs/misc_dialogs.rb 2012-04-13 12:38:05.065369194 +0900 -@@ -22,9 +22,11 @@ - GetText.bindtextdomain(Alexandria::TEXTDOMAIN, :charset => "UTF-8") - - def initialize(parent, library, book) -+ # Don't know why, however force_encoding seems needed here to -+ # prevent crash... - super(parent, - _("The book '%s' already exists in '%s'. Would you like " + -- "to replace it?") % [ book.title, library.name ], -+ "to replace it?") % [ book.title, library.name ].dup.map!{|str| str.force_encoding("UTF-8")}, - Gtk::Stock::DIALOG_QUESTION, - [[_("_Skip"), Gtk::Dialog::RESPONSE_CANCEL], - [_("_Replace"), Gtk::Dialog::RESPONSE_OK]], ---- alexandria-0.6.8/lib/alexandria/ui/ui_manager.rb.ruby19_utf8 2011-11-15 22:09:19.000000000 +0900 -+++ alexandria-0.6.8/lib/alexandria/ui/ui_manager.rb 2012-04-13 12:38:05.066369229 +0900 -@@ -825,7 +825,9 @@ - iter[Columns::TITLE] = book.title - title = book.title.sub(REDUCE_TITLE_REGEX, '\1...') - iter[Columns::TITLE_REDUCED] = title -- iter[Columns::AUTHORS] = book.authors.join(', ') -+ # Don't know why, however force_encoding seems needed here to -+ # prevent crash... -+ iter[Columns::AUTHORS] = book.authors.dup.map!{|str| str.force_encoding("UTF-8")}.join(', ') - iter[Columns::ISBN] = book.isbn.to_s - iter[Columns::PUBLISHER] = book.publisher - iter[Columns::PUBLISH_DATE] = (book.publishing_year.to_s rescue "") diff --git a/alexandria-0.6.8-yaml-unescape.patch b/alexandria-0.6.8-yaml-unescape.patch deleted file mode 100644 index c1a166a..0000000 --- a/alexandria-0.6.8-yaml-unescape.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- alexandria-0.6.8/lib/alexandria/models/library.rb.broken_yaml 2009-12-07 05:16:57.000000000 +0900 -+++ alexandria-0.6.8/lib/alexandria/models/library.rb 2012-10-13 03:25:24.000000000 +0900 -@@ -78,8 +78,23 @@ - - test[1] = filename if test[0] == 0 - -+ book_valid_p = true -+ - if not File.size? test[1] - log.warn { "Book file #{test[1]} was empty"} -+ book_valid_p = false -+ end -+ -+ if book_valid_p -+ begin -+ book = self.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})#{EXT[:book]}/.match(filename) - if md - file_isbn = md[1] -@@ -90,7 +105,7 @@ - end - next - end -- book = self.regularize_book_from_yaml(test[1]) -+ - old_isbn = book.isbn - old_pub_year = book.publishing_year - begin -@@ -178,6 +193,8 @@ - end - - def self.regularize_book_from_yaml(name) -+ require 'syck/encoding' -+ - text = IO.read(name) - - #Code to remove the mystery string in books imported from Amazon -@@ -198,7 +215,7 @@ - new_yaml.sub!(/^\s*\-+\s*/, '') - text.sub!(md[0], "loaned_since: #{new_yaml}\n") - end -- book = YAML.load(text) -+ book = YAML.load(Syck::unescape(text)) - unless book.isbn.class == String - # HACK - md = /isbn: (.+)/.match(text) diff --git a/alexandria-0.6.8-z3950-next.patch b/alexandria-0.6.8-z3950-next.patch deleted file mode 100644 index 665f5e5..0000000 --- a/alexandria-0.6.8-z3950-next.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- alexandria-0.6.8/./lib/alexandria/book_providers/z3950.rb.next 2009-12-22 06:13:29.000000000 +0900 -+++ alexandria-0.6.8/./lib/alexandria/book_providers/z3950.rb 2012-04-10 23:40:53.000000000 +0900 -@@ -100,7 +100,7 @@ - msg - } - -- next if marc.title.nil? # or marc.authors.empty? -+ raise if marc.title.nil? # or marc.authors.empty? - - isbn = isbn or marc.isbn - isbn = Library.canonicalise_ean(isbn) diff --git a/alexandria-0.6.9-gdk_pixbuf2-3.0.9.patch b/alexandria-0.6.9-gdk_pixbuf2-3.0.9.patch deleted file mode 100644 index 2797d05..0000000 --- a/alexandria-0.6.9-gdk_pixbuf2-3.0.9.patch +++ /dev/null @@ -1,139 +0,0 @@ ---- alexandria-0.6.9/lib/alexandria/ui/icons.rb.rg309 2009-08-29 21:27:15.000000000 +0900 -+++ alexandria-0.6.9/lib/alexandria/ui/icons.rb 2016-08-15 17:32:58.220820991 +0900 -@@ -15,18 +15,26 @@ - # write to the Free Software Foundation, Inc., 51 Franklin Street, - # Fifth Floor, Boston, MA 02110-1301 USA. - --class Gdk::Pixbuf -+if !defined?(GDK_PIXBUF) -+ if defined?(GdkPixbuf) -+ GDK_PIXBUF = GdkPixbuf::Pixbuf -+ else -+ GDK_PIXBUF = Gdk::Pixbuf -+ end -+end -+ -+class GDK_PIXBUF - def tag(tag_pixbuf) - # Computes some tweaks. - tweak_x = tag_pixbuf.width / 3 - tweak_y = tag_pixbuf.height / 3 - - # Creates the destination pixbuf. -- new_pixbuf = Gdk::Pixbuf.new(Gdk::Pixbuf::COLORSPACE_RGB, -- true, -- 8, -- self.width + tweak_x, -- self.height + tweak_y) -+ new_pixbuf = GDK_PIXBUF.new(:colorspace => :rgb, -+ :has_alpha => true, -+ :bits_per_sample => 8, -+ :width => self.width + tweak_x, -+ :height => self.height + tweak_y) - - # Fills with blank. - new_pixbuf.fill!(0) -@@ -39,13 +47,24 @@ - - # Copies the tag pixbuf there (north-est). - tag_pixbuf_x = self.width - (tweak_x * 2) -- new_pixbuf.composite!(tag_pixbuf, -+ if defined?(GdkPixbuf) -+ new_pixbuf.composite!(tag_pixbuf, -+ :dest_x =>0, :dest_y => 0, -+ :dest_width => tag_pixbuf.width + tag_pixbuf_x, -+ :dest_height => tag_pixbuf.height, -+ :offset_x => tag_pixbuf_x, :offset_y => 0, -+ :scale_x => 1, :scale_y => 1, -+ :interpolation_type => :hyper, :overall_alpha => 255 -+ ) -+ else -+ new_pixbuf.composite!(tag_pixbuf, - 0, 0, - tag_pixbuf.width + tag_pixbuf_x, - tag_pixbuf.height, - tag_pixbuf_x, 0, - 1, 1, - Gdk::Pixbuf::INTERP_HYPER, 255) -+ end - return new_pixbuf - end - end -@@ -66,7 +85,7 @@ - # Don't use upcase and use tr instead - # For example in Turkish the upper case of 'i' is still 'i'. - name = File.basename(file, ".png").tr('a-z', 'A-Z') -- const_set(name, Gdk::Pixbuf.new(File.join(ICONS_DIR, file))) -+ const_set(name, GDK_PIXBUF.new(:file => File.join(ICONS_DIR, file))) - end - end - -@@ -75,7 +94,7 @@ - return BOOK_ICON if library.nil? - filename = library.cover(book) - if File.exists?(filename) -- return Gdk::Pixbuf.new(filename) -+ return GDK_PIXBUF.new(:file => filename) - end - rescue Exception => err - # report load error; FIX should go to a Logger... -@@ -88,7 +107,7 @@ - - def self.blank?(filename) - begin -- pixbuf = Gdk::Pixbuf.new(filename) -+ pixbuf = GdkPixbuf::Pixbuf.new(:file => filename) - pixbuf.width == 1 and pixbuf.height == 1 - rescue Exception => err - puts err.message ---- alexandria-0.6.9/lib/alexandria/ui/sidepane.rb.rg309 2009-03-26 08:09:32.000000000 +0900 -+++ alexandria-0.6.9/lib/alexandria/ui/sidepane.rb 2016-08-15 17:13:47.764552444 +0900 -@@ -1,3 +1,11 @@ -+if !defined?(GDK_PIXBUF) -+ if defined?(GdkPixbuf) -+ GDK_PIXBUF = GdkPixbuf::Pixbuf -+ else -+ GDK_PIXBUF = Gdk::Pixbuf -+ end -+end -+ - module Alexandria - module UI - class SidePaneManager -@@ -80,7 +88,7 @@ - end - - def setup_sidepane -- @library_listview.model = Gtk::ListStore.new(Gdk::Pixbuf, -+ @library_listview.model = Gtk::ListStore.new(GDK_PIXBUF, - String, - TrueClass, - TrueClass) ---- alexandria-0.6.9/lib/alexandria/ui/ui_manager.rb.rg309 2016-08-15 21:32:21.259657750 +0900 -+++ alexandria-0.6.9/lib/alexandria/ui/ui_manager.rb 2016-08-15 17:12:04.362982918 +0900 -@@ -16,6 +16,14 @@ - # write to the Free Software Foundation, Inc., 51 Franklin Street, - # Fifth Floor, Boston, MA 02110-1301 USA. - -+if !defined?(GDK_PIXBUF) -+ if defined?(GdkPixbuf) -+ GDK_PIXBUF = GdkPixbuf::Pixbuf -+ else -+ GDK_PIXBUF = Gdk::Pixbuf -+ end -+end -+ - module Alexandria - module UI - MAX_RATING_STARS = 5 -@@ -263,8 +271,8 @@ - log.debug { "setting up active model" } - # The active model. - -- list = [Gdk::Pixbuf, # COVER_LIST -- Gdk::Pixbuf, # COVER_ICON -+ list = [GDK_PIXBUF, # COVER_LIST -+ GDK_PIXBUF, # COVER_ICON - String, # TITLE - String, # TITLE_REDUCED - String, # AUTHORS diff --git a/alexandria-0.6.9-glade-gettext.patch b/alexandria-0.6.9-glade-gettext.patch deleted file mode 100644 index f4636f9..0000000 --- a/alexandria-0.6.9-glade-gettext.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- alexandria-0.6.9/lib/alexandria/ui/builder_base.rb.gettext 2011-11-19 23:07:23.000000000 +0900 -+++ alexandria-0.6.9/lib/alexandria/ui/builder_base.rb 2014-02-12 12:25:09.695018378 +0900 -@@ -22,6 +22,7 @@ module Alexandria - def initialize(filename, widget_names) - file = File.join(Alexandria::Config::DATA_DIR, 'glade', filename) - builder = Gtk::Builder.new -+ builder.set_translation_domain(Alexandria::TEXTDOMAIN) - builder.add_from_file(file) - builder.connect_signals do |handler| - begin 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-rbconfig.patch b/alexandria-0.6.9-rbconfig.patch deleted file mode 100644 index f8288b1..0000000 --- a/alexandria-0.6.9-rbconfig.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -up alexandria-0.6.8/util/rake/fileinstall.rb.fix alexandria-0.6.8/util/rake/fileinstall.rb ---- alexandria-0.6.8/util/rake/fileinstall.rb.fix 2012-03-23 12:15:39.827228029 -0400 -+++ alexandria-0.6.8/util/rake/fileinstall.rb 2012-03-23 12:16:01.774011895 -0400 -@@ -185,12 +185,12 @@ class FileInstallTask < Rake::TaskLib - private - - def calculate_ruby_dir -- ruby_prefix = Config::CONFIG['prefix'] -+ ruby_prefix = RbConfig::CONFIG['prefix'] - - if @install_to_rubylibdir -- ruby_libdir = Config::CONFIG['rubylibdir'] -+ ruby_libdir = RbConfig::CONFIG['rubylibdir'] - else -- ruby_libdir = Config::CONFIG['sitelibdir'] -+ ruby_libdir = RbConfig::CONFIG['sitelibdir'] - end - if ENV.has_key?('RUBYLIBDIR') - ruby_libdir = ENV['RUBYLIBDIR'] ---- alexandria-0.6.9/lib/alexandria/ui/iconview_tooltips.rb.rbconfig 2011-11-19 23:47:12.000000000 +0900 -+++ alexandria-0.6.9/lib/alexandria/ui/iconview_tooltips.rb 2015-01-19 13:58:03.414409764 +0900 -@@ -68,7 +68,7 @@ - def workaround_safe_from_tooltip_crashes - begin - require 'rbconfig' -- arch_is_x86_64 = Config::CONFIG['arch'] =~ /x86_64/i -+ arch_is_x86_64 = RbConfig::CONFIG['arch'] =~ /x86_64/i - ruby_gnome2_atleast017 = false - if Gtk::BINDING_VERSION and Gtk::BINDING_VERSION.instance_of? Array - major, minor, micro = Gtk::BINDING_VERSION 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.6.9-delete-broken-yaml.patch b/alexandria-0.7.4-delete-broken-yaml.patch similarity index 82% rename from alexandria-0.6.9-delete-broken-yaml.patch rename to alexandria-0.7.4-delete-broken-yaml.patch index 8141ef6..c5409c6 100644 --- a/alexandria-0.6.9-delete-broken-yaml.patch +++ b/alexandria-0.7.4-delete-broken-yaml.patch @@ -1,17 +1,17 @@ ---- 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) +--- 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-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 @@ + 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 diff --git a/alexandria-0.6.6-dont_use_thread_when_adding_file_by_isdn.patch b/alexandria-0.7.4-dont_use_thread_when_adding_file_by_isdn.patch similarity index 57% rename from alexandria-0.6.6-dont_use_thread_when_adding_file_by_isdn.patch rename to alexandria-0.7.4-dont_use_thread_when_adding_file_by_isdn.patch index b8635d2..3a83798 100644 --- a/alexandria-0.6.6-dont_use_thread_when_adding_file_by_isdn.patch +++ b/alexandria-0.7.4-dont_use_thread_when_adding_file_by_isdn.patch @@ -1,9 +1,9 @@ ---- alexandria-0.6.6/./lib/alexandria/ui/dialogs/new_book_dialog.rb.up28263 2010-06-19 10:36:21.000000000 +0900 -+++ alexandria-0.6.6/./lib/alexandria/ui/dialogs/new_book_dialog.rb 2010-06-22 16:51:25.000000000 +0900 -@@ -389,8 +389,8 @@ +--- alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/new_book_dialog.rb.up28263 2019-10-25 01:20:07.000000000 +0900 ++++ alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/new_book_dialog.rb 2020-01-03 12:36:21.720395196 +0900 +@@ -345,8 +345,8 @@ module Alexandria + @button_add.sensitive = false notify_start_add_by_isbn - Gtk.idle_add do - + GLib::Idle.add do - @find_thread = Thread.new do - log.info { "New @find_thread #{Thread.current}" } + #@find_thread = Thread.new do @@ -11,10 +11,10 @@ begin # MAJOR HACK, add this again... Alexandria::BookProviders.instance.add_observer(self) -@@ -423,7 +423,7 @@ +@@ -372,7 +372,7 @@ module Alexandria Alexandria::BookProviders.instance.delete_observer(self) notify_end_add_by_isbn - end + end - end + #end diff --git a/alexandria-0.7.4-export-to-HTML-with-ruby19.patch b/alexandria-0.7.4-export-to-HTML-with-ruby19.patch new file mode 100644 index 0000000..70cf52f --- /dev/null +++ b/alexandria-0.7.4-export-to-HTML-with-ruby19.patch @@ -0,0 +1,45 @@ +--- alexandria-book-collection-manager-0.7.4/lib/alexandria/export_library.rb.export_html 2020-01-03 16:17:05.053552865 +0900 ++++ alexandria-book-collection-manager-0.7.4/lib/alexandria/export_library.rb 2020-01-03 16:24:11.989122168 +0900 +@@ -302,7 +302,7 @@ + xhtml << <<~EOS + Cover file for '#{xhtml_escape(book.title)}' + EOS +@@ -314,7 +314,7 @@ + + unless book.title.nil? + xhtml << <<~EOS +-

#{xhtml_escape(book.title)}

++

#{xhtml_escape(book.title).force_encoding("UTF-8")}

+ EOS + end + +@@ -322,7 +322,7 @@ + xhtml << '
    ' + book.authors.each do |author| + xhtml << <<~EOS +-
  • #{xhtml_escape(author)}
  • ++
  • #{xhtml_escape(author).force_encoding("UTF-8")}
  • + EOS + end + xhtml << "
" +@@ -330,13 +330,13 @@ + + unless book.edition.nil? + xhtml << <<~EOS +-

#{xhtml_escape(book.edition)}

++

#{xhtml_escape(book.edition).force_encoding("UTF-8")}

+ EOS + end + + unless book.publisher.nil? + xhtml << <<~EOS +-

#{xhtml_escape(book.publisher)}

++

#{xhtml_escape(book.publisher).force_encoding("UTF-8")}

+ EOS + end + diff --git a/alexandria-0.7.4-glade-gettext.patch b/alexandria-0.7.4-glade-gettext.patch new file mode 100644 index 0000000..a55685c --- /dev/null +++ b/alexandria-0.7.4-glade-gettext.patch @@ -0,0 +1,10 @@ +--- alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/builder_base.rb.gettext 2019-10-25 01:20:07.000000000 +0900 ++++ alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/builder_base.rb 2020-01-04 14:41:27.424900676 +0900 +@@ -10,6 +10,7 @@ module Alexandria + def initialize(filename, widget_names) + file = File.join(Alexandria::Config::DATA_DIR, "glade", filename) + builder = Gtk::Builder.new ++ builder.set_translation_domain(Alexandria::TEXTDOMAIN) + # TODO: This emits the warning 'GtkDialog mapped without a transient + # parent. This is discouraged.' + builder.add_from_file(file) diff --git a/alexandria-0.6.8-iconview-multibyte.patch b/alexandria-0.7.4-iconview-multibyte.patch similarity index 65% rename from alexandria-0.6.8-iconview-multibyte.patch rename to alexandria-0.7.4-iconview-multibyte.patch index 30bfef0..65db51f 100644 --- a/alexandria-0.6.8-iconview-multibyte.patch +++ b/alexandria-0.7.4-iconview-multibyte.patch @@ -1,6 +1,6 @@ ---- alexandria-0.6.8/lib/alexandria/ui/ui_manager.rb.icon_multibyte 2012-05-30 10:04:18.132330198 +0900 -+++ alexandria-0.6.8/lib/alexandria/ui/ui_manager.rb 2012-05-29 18:29:54.430690741 +0900 -@@ -824,6 +824,9 @@ +--- alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/ui_manager.rb.icon_multibyte 2020-01-03 16:17:05.051552867 +0900 ++++ alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/ui_manager.rb 2020-01-03 16:41:08.841182941 +0900 +@@ -713,6 +713,9 @@ iter[Columns::IDENT] = book.ident.to_s iter[Columns::TITLE] = book.title title = book.title.sub(REDUCE_TITLE_REGEX, '\1...') diff --git a/alexandria-0.7.4-remove-undefined-method.patch b/alexandria-0.7.4-remove-undefined-method.patch new file mode 100644 index 0000000..d03435a --- /dev/null +++ b/alexandria-0.7.4-remove-undefined-method.patch @@ -0,0 +1,12 @@ +diff -urp alexandria-book-collection-manager-0.7.4.old.2/lib/alexandria/ui/book_properties_dialog_base.rb alexandria-book-collection-manager-0.7.4.new/lib/alexandria/ui/book_properties_dialog_base.rb +--- alexandria-book-collection-manager-0.7.4.old.2/lib/alexandria/ui/book_properties_dialog_base.rb 2020-01-15 14:38:34.849856129 +0900 ++++ alexandria-book-collection-manager-0.7.4.new/lib/alexandria/ui/book_properties_dialog_base.rb 2020-01-15 14:39:05.733196547 +0900 +@@ -303,7 +303,7 @@ module Alexandria + def on_destroy + @book_properties_dialog.hide + # Stop notebook trying to set tab labels at this time +- @notebook.show_tabs = false ++ #@notebook.show_tabs = false + end + + def on_loaned diff --git a/alexandria-0.7.4-title-force-encoding.patch b/alexandria-0.7.4-title-force-encoding.patch new file mode 100644 index 0000000..23be90e --- /dev/null +++ b/alexandria-0.7.4-title-force-encoding.patch @@ -0,0 +1,37 @@ +diff -urp alexandria-book-collection-manager-0.7.4.old/lib/alexandria/ui/book_properties_dialog.rb alexandria-book-collection-manager-0.7.4.new/lib/alexandria/ui/book_properties_dialog.rb +--- alexandria-book-collection-manager-0.7.4.old/lib/alexandria/ui/book_properties_dialog.rb 2019-10-25 01:20:07.000000000 +0900 ++++ alexandria-book-collection-manager-0.7.4.new/lib/alexandria/ui/book_properties_dialog.rb 2020-01-15 14:34:40.160543409 +0900 +@@ -34,9 +34,10 @@ module Alexandria + @button_box << help_button + @button_box.set_child_secondary(help_button, true) + +- @entry_title.text = @book_properties_dialog.title = book.title ++ book_title = book.title.dup.force_encoding('UTF-8') ++ @entry_title.text = @book_properties_dialog.title = book_title + @entry_isbn.text = (book.isbn || "") +- @entry_publisher.text = book.publisher ++ @entry_publisher.text = book.publisher.dup.force_encoding('UTF-8') + @entry_publish_date.text = book.publishing_year.to_s + @entry_publish_date.signal_connect("focus-out-event") do + text = @entry_publish_date.text +@@ -54,7 +55,7 @@ module Alexandria + end + end + end +- @entry_edition.text = book.edition ++ @entry_edition.text = book.edition ? book.edition.dup.force_encoding('UTF-8') : "" + if book.tags + @entry_tags.text = book.tags.join(",") # tags are comma-separated + end +diff -urp alexandria-book-collection-manager-0.7.4.old/lib/alexandria/ui/ui_manager.rb alexandria-book-collection-manager-0.7.4.new/lib/alexandria/ui/ui_manager.rb +--- alexandria-book-collection-manager-0.7.4.old/lib/alexandria/ui/ui_manager.rb 2020-01-14 16:14:43.703190269 +0900 ++++ alexandria-book-collection-manager-0.7.4.new/lib/alexandria/ui/ui_manager.rb 2020-01-15 14:30:29.284927911 +0900 +@@ -427,7 +427,7 @@ module Alexandria + end + + def set_status_label(txt) +- @status_label.text = txt ++ @status_label.text = txt.force_encoding('UTF-8') + end + + def on_books_selection_changed diff --git a/alexandria-0.7.5-export-to-CSV-bintex-with-ruby19.patch b/alexandria-0.7.5-export-to-CSV-bintex-with-ruby19.patch new file mode 100644 index 0000000..95c0ac7 --- /dev/null +++ b/alexandria-0.7.5-export-to-CSV-bintex-with-ruby19.patch @@ -0,0 +1,30 @@ +--- alexandria-book-collection-manager-0.7.5/lib/alexandria/export_library.rb.export_csv 2020-10-17 15:49:16.241200513 +0900 ++++ alexandria-book-collection-manager-0.7.5/lib/alexandria/export_library.rb 2020-10-17 16:01:18.184960155 +0900 +@@ -108,12 +108,12 @@ module Alexandria + io.puts "#{book.title} " + # put a link to the book's cover. only works on iPod 5G and above(?). + if File.exist?(cover(book)) +- io.puts '' + book.title + "" ++ io.puts '' + book.title.force_encoding('UTF-8') + "" + else +- io.puts book.title ++ io.puts book.title.force_encoding('UTF-8') + end +- io.puts book.authors.join(", ") +- io.puts book.edition ++ io.puts book.authors.join(", ").force_encoding('UTF-8') ++ io.puts book.edition.force_encoding('UTF-8') + io.puts((book.isbn || "")) + # we need to close the files so the iPod can be ejected/unmounted + # without us closing Alexandria +@@ -380,8 +380,8 @@ module Alexandria + end + end + bibtex << "\",\n" +- bibtex << "title = \"#{latex_escape(book.title)}\",\n" +- bibtex << "publisher = \"#{latex_escape(book.publisher)}\",\n" ++ bibtex << "title = \"#{latex_escape(book.title.force_encoding('UTF-8'))}\",\n" ++ bibtex << "publisher = \"#{latex_escape(book.publisher.force_encoding('UTF-8'))}\",\n" + if book.notes && !book.notes.empty? + bibtex << "OPTnote = \"#{latex_escape(book.notes)}\",\n" + end 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.8-explicitly-specify_gem_image_size.patch b/alexandria-0.7.8-explicitly-specify_gem_image_size.patch new file mode 100644 index 0000000..9230b9a --- /dev/null +++ b/alexandria-0.7.8-explicitly-specify_gem_image_size.patch @@ -0,0 +1,10 @@ +--- alexandria-book-collection-manager-0.7.8/lib/alexandria/export_library.rb.image_size 2020-11-29 20:50:34.000000000 +0900 ++++ alexandria-book-collection-manager-0.7.8/lib/alexandria/export_library.rb 2021-08-27 11:09:49.794917238 +0900 +@@ -5,6 +5,7 @@ + # See the file README.md for authorship and licensing information. + + require "csv" ++gem "image_size" + require "image_size" + require "tmpdir" + diff --git a/alexandria-0.7.8-reset-search-when-adding-new-book.patch b/alexandria-0.7.8-reset-search-when-adding-new-book.patch new file mode 100644 index 0000000..2c93ebc --- /dev/null +++ b/alexandria-0.7.8-reset-search-when-adding-new-book.patch @@ -0,0 +1,15 @@ +diff -urp '--exclude=*~' alexandria-book-collection-manager-0.7.8/lib/alexandria/ui/ui_manager.rb alexandria-book-collection-manager-0.7.8.new/lib/alexandria/ui/ui_manager.rb +--- alexandria-book-collection-manager-0.7.8/lib/alexandria/ui/ui_manager.rb 2021-03-05 00:06:46.604012398 +0900 ++++ alexandria-book-collection-manager-0.7.8.new/lib/alexandria/ui/ui_manager.rb 2021-03-04 23:53:11.560895622 +0900 +@@ -569,7 +569,10 @@ module Alexandria + end + @iconview.unfreeze + @listview.unfreeze # NEW +- select_a_book(book) if [Library::BOOK_ADDED, Library::BOOK_UPDATED].include? kind ++ if [Library::BOOK_ADDED, Library::BOOK_UPDATED].include? kind ++ on_clear_search_results ++ select_a_book(book) ++ end + elsif selected_library.is_a?(SmartLibrary) + refresh_books + end diff --git a/alexandria-0.7.9-ascii-fix.patch b/alexandria-0.7.9-ascii-fix.patch new file mode 100644 index 0000000..4c9082a --- /dev/null +++ b/alexandria-0.7.9-ascii-fix.patch @@ -0,0 +1,15 @@ +--- alexandria-book-collection-manager-0.7.4/util/rake/omfgenerate.rb.ascii 2020-01-03 12:47:58.335653134 +0900 ++++ alexandria-book-collection-manager-0.7.4/util/rake/omfgenerate.rb 2020-01-03 12:50:29.657487059 +0900 +@@ -67,10 +67,10 @@ class OmfGenerateTask < Rake::TaskLib + rule ".omf" => [".omf.in"] do |t| + path = File.join(@gnome_helpfiles_dir, @projectname, + locale_for(t.name), "#{@projectname}.xml") +- data = File.read(t.source) ++ data = File.read(t.source, :encoding => "BINARY") + data.sub!(/PATH_TO_DOC_FILE/, path) + puts "Generating #{t.name}..." +- File.open(t.name, "w") { |io| io.puts data } ++ File.open(t.name, "w", :encoding => "BINARY") { |io| io.puts data } + end + omf_files.each { |o| @generated_files << o } + end diff --git a/alexandria-0.7.9-utf8-convert.patch b/alexandria-0.7.9-utf8-convert.patch new file mode 100644 index 0000000..b6b4249 --- /dev/null +++ b/alexandria-0.7.9-utf8-convert.patch @@ -0,0 +1,28 @@ +--- alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/conflict_while_copying_dialog.rb.utf8 2019-10-25 01:20:07.000000000 +0900 ++++ alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/conflict_while_copying_dialog.rb 2020-01-03 16:11:41.543997217 +0900 +@@ -13,9 +13,11 @@ module Alexandria + GetText.bindtextdomain(Alexandria::TEXTDOMAIN, charset: "UTF-8") + + def initialize(parent, library, book) ++ # Don't know why, however force_encoding seems needed here to ++ # prevent crash... + super(parent, + format(_("The book '%s' already exists in '%s'. Would you like " \ +- "to replace it?"), book.title, library.name), ++ "to replace it?"), book.title, library.name).dup.force_encoding("UTF-8"), + Gtk::Stock::DIALOG_QUESTION, + [[_("_Skip"), Gtk::ResponseType::CANCEL], + [_("_Replace"), Gtk::ResponseType::OK]], +--- alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/ui_manager.rb.utf8 2019-10-25 01:20:07.000000000 +0900 ++++ alexandria-book-collection-manager-0.7.4/lib/alexandria/ui/ui_manager.rb 2020-01-03 16:14:53.165730869 +0900 +@@ -714,7 +714,9 @@ module Alexandria + iter[Columns::TITLE] = book.title + title = book.title.sub(REDUCE_TITLE_REGEX, '\1...') + iter[Columns::TITLE_REDUCED] = title +- iter[Columns::AUTHORS] = book.authors.join(", ") ++ # Don't know why, however force_encoding seems needed here to ++ # prevent crash... ++ iter[Columns::AUTHORS] = book.authors.dup.map!{|str| str.dup.force_encoding("UTF-8")}.join(", ") + iter[Columns::ISBN] = book.isbn.to_s + iter[Columns::PUBLISHER] = book.publisher + iter[Columns::PUBLISH_DATE] = book.publishing_year.to_s diff --git a/alexandria-0.7.9-yaml-unescape.patch b/alexandria-0.7.9-yaml-unescape.patch new file mode 100644 index 0000000..0b2c42a --- /dev/null +++ b/alexandria-0.7.9-yaml-unescape.patch @@ -0,0 +1,54 @@ +--- 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,9 @@ module Alexandria + private + + def regularize_book_from_yaml(name) ++ require 'syck/constants' ++ require 'syck/encoding' ++ + text = File.read(name) + + # Code to remove the mystery string in books imported from Amazon +@@ -203,7 +221,7 @@ module Alexandria + end + +- book = Book.from_yaml(text) ++ book = Book.from_yaml(Syck::unescape(text)) + + unless book.isbn.instance_of? String + # HACK + md = /isbn: (.+)/.match(text) diff --git a/alexandria-0.7.9-z3950-zoom-count.patch b/alexandria-0.7.9-z3950-zoom-count.patch new file mode 100644 index 0000000..8bba797 --- /dev/null +++ b/alexandria-0.7.9-z3950-zoom-count.patch @@ -0,0 +1,15 @@ +--- alexandria-book-collection-manager-0.7.4/lib/alexandria/book_providers/z3950_provider.rb.zoom_count 2019-10-25 01:20:07.000000000 +0900 ++++ alexandria-book-collection-manager-0.7.4/lib/alexandria/book_providers/z3950_provider.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 8d6f50d..38aa9f4 100644 --- a/alexandria.spec +++ b/alexandria.spec @@ -1,26 +1,28 @@ -%if 0%{?fedora} <= 19 -%define rubyabi 1.9.1 -%endif +%define BothRequires() \ +Requires: %{*} \ +BuildRequires: %{*} \ +%{nil} -%define repoid 76353 - -%define majorver 0.6.9 +%define majorver 0.7.9 %undefine minorver %undefine ifpre -%define fedorarel 11 -%define rel %{?ifpre:0.}%{fedorarel}%{?minorver:.%minorver} +%define baserelease 12 +%define rel %{?ifpre:0.}%{baserelease}%{?minorver:.%minorver} Name: alexandria Version: %{majorver} -Release: %{rel}%{?dist}.7 +Release: %{rel}%{?dist} Summary: Book collection manager -License: GPLv2+ -URL: http://alexandria.rubyforge.org/ -Source0: http://rubyforge.org/frs/download.php/%{repoid}/%{name}-%{version}%{?minorver:-%{minorver}}.tar.gz +# Overall GPL-2.0-or-later +# share/gnome/help/alexandria/C/alexandria.xml GFDL-1.2-or-later +# SPDX confirmed +License: GPL-2.0-or-later AND GPL-2.0-or-later +URL: https://github.com/mvz/alexandria-book-collection-manager/ +Source0: %{url}/archive/v%{version}/%{name}-%{version}%{?minorver:-%{minorver}}.tar.gz # Patches discussing with the upstream # Trial fix for hang up when importing list containing invalid isdn # ref: alexandria-Bugs-25348 @@ -29,83 +31,68 @@ Source0: http://rubyforge.org/frs/download.php/%{repoid}/%{name}-%{version}%{?mi # Trial fix for crash when importing a book with isdn # With alexandria-0.6.6, the fix for this issue is still incomplete # ref: alexandria-BUgs-28263 -Patch3: alexandria-0.6.6-dont_use_thread_when_adding_file_by_isdn.patch +Patch3: alexandria-0.7.4-dont_use_thread_when_adding_file_by_isdn.patch # Fix crash when searching book # ref: alexandria-Bugs-29479 Patch by Tomoh K. # Applied in 0.6.9 # Patch4: alexandria-0.6.8-set_status_label.patch # Upstream patches # Patches not submitted to the upstream -# Support when rubygem(gst) (gstreamer) is not installed -# Note that rubygem-gstreamer is not yet in Fedora -#Patch10: alexandria-0.6.8-nogst-support.patch -# Always require rubygems -Patch11: alexandria-0.6.8-always-require-rubygems.patch -# Use RbConfig -Patch12: alexandria-0.6.9-rbconfig.patch -# Use rdoc -# Well, seems not needed on 0.6.9 -# Patch13: alexandria-0.6.8-rdoc.patch # Force encoding type to make rake happy -Patch14: alexandria-0.6.8-ascii-fix.patch +Patch14: alexandria-0.7.9-ascii-fix.patch # Fix kcode issues with 1.9 # Well, with the original fix, some strange failure on startup # happens on ja_JP.utf8... -Patch15: alexandria-0.6.8-kcodefix.patch -# eval fix -Patch16: alexandria-0.6.8-evalfix.patch -# With working zoom and ruby19, z3950 provider aborts -# with syntax error about next -Patch17: alexandria-0.6.8-z3950-next.patch +#Patch15: alexandria-0.6.8-kcodefix.patch # Two fixes: # a. loading yaml file generated by ruby 18x will show garbage characters # b. moving book entry to another library which also contains the # same book will cause crash.. -Patch18: alexandria-0.6.8-utf8-convert.patch +Patch18: alexandria-0.7.9-utf8-convert.patch # More UTF-8 fix on ruby 1.9, when exporting library to HTML # (bug 819188) -Patch19: alexandria-0.6.8-export-to-HTML-with-ruby19.patch +Patch19: alexandria-0.7.4-export-to-HTML-with-ruby19.patch # More UTF-8 fix on ruby 1.9, when exporting library to csv # or bibtex -Patch20: alexandria-0.6.8-export-to-CSV-bintex-with-ruby19.patch +Patch20: alexandria-0.7.5-export-to-CSV-bintex-with-ruby19.patch # Remove garbage character with icon view on multibyte locate -Patch21: alexandria-0.6.8-iconview-multibyte.patch +Patch21: alexandria-0.7.4-iconview-multibyte.patch # Split Patch18 into two patches, one for lib/alexandria/models/library.rb # (this file) and other. Also handle broken yaml file correctly and let # user redownload it # (bug 861740) -Patch22: alexandria-0.6.8-yaml-unescape.patch +Patch22: alexandria-0.7.9-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.6-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.9-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 +# https://github.com/mvz/alexandria-book-collection-manager/issues/135 +# Applied in 0.7.9 +#Patch27: alexandria-0.7.6-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 -Patch30: alexandria-0.6.9-gdk_pixbuf2-3.0.9.patch +Patch29: alexandria-0.7.4-glade-gettext.patch +# Workaround: more force_encoding for title, etc for loading old yaml +Patch30: alexandria-0.7.4-title-force-encoding.patch +# Remove undefined / unneeded method +Patch31: alexandria-0.7.4-remove-undefined-method.patch +# Once reset search text when adding new book (bug 1909500) +# https://github.com/mvz/alexandria-book-collection-manager/issues/106 +Patch32: alexandria-0.7.8-reset-search-when-adding-new-book.patch +# Explicitly specify image_size gem +Patch33: alexandria-0.7.8-explicitly-specify_gem_image_size.patch BuildArch: noarch -%if 0%{?fedora} >= 19 Requires: ruby(release) BuildRequires: ruby(release) -%else -Requires: ruby(abi) = %{rubyabi} -Requires: ruby -BuildRequires: ruby(abi) = %{rubyabi} -BuildRequires: ruby -%endif # For ruby macros BuildRequires: ruby-devel @@ -115,47 +102,56 @@ BuildRequires: desktop-file-utils BuildRequires: GConf2 BuildRequires: gettext BuildRequires: intltool +# From 0.7.4 +BuildRequires: rubygem(rspec) +# Needed since Ruby 3.0. +# https://github.com/mvz/alexandria-book-collection-manager/issues/124 +%BothRequires rubygem(rexml) +# rspec test +BuildRequires: %{_bindir}/xvfb-run +BuildRequires: %{_bindir}/ping +BuildRequires: rubygem(webmock) +BuildRequires: rubygem(json) +BuildRequires: rubygem(pry) +BuildRequires: gstreamer1-plugins-base +# autoaudiosink +BuildRequires: gstreamer1-plugins-good -# Amazon AWS v3 -> v4 switch -# AWS v4 is supported by alexandria itself -# But hpricot is still needed +# 0.7.9 uses nokogiri instead of hpricot #Requires: ruby(amazon) -Requires: rubygem(gettext) -Requires: rubygem(hpricot) -Requires: rubygem(htmlentities) -Requires: ruby(imagesize) +%BothRequires rubygem(gettext) +%BothRequires rubygem(htmlentities) +%BothRequires rubygem(image_size) +%BothRequires rubygem(nokogiri) # Dependency removed on 0.6.4b1 #Requires: ruby(mechanize) # Kill ruby(revolution) dependency #Requires: ruby(revolution) +%BothRequires rubygem(psych) # ruby(zoom) -> rubygem(zoom) switch #Requires: ruby(zoom) -Requires: rubygem(zoom) >= 0.3.0 -Requires: rubygem(marc) +%BothRequires rubygem(zoom) >= 0.3.0 +%BothRequires rubygem(marc) # Killed on 0.6.8 #Requires: ruby(gconf2) # Explicitly Requires: GConf2 -Requires: rubygem(gdk_pixbuf2) -Requires: rubygem(glib2) +%BothRequires rubygem(gdk_pixbuf2) +%BothRequires rubygem(glib2) # Killed on 0.6.8 #Requires: ruby(gnome2) #Requires: ruby(libglade2) # Added from 0.6.8 # Requires: rubygem(goocanvas) # The above needs more explicit -%if 0%{?fedora} >= 20 -Requires: rubygem-goocanvas1 -%else -Requires: rubygem-goocanvas -%endif -Requires: rubygem(gstreamer) +# With 0.7.4 this dependency changed, goocanvas2 + introspection +%BothRequires rubygem(goocanvas) >= 2 +%BothRequires rubygem(gstreamer) +%BothRequires rubygem(gtk3) # Uses syck (bug 922217) -%if 0%{?fedora} >= 19 -Requires: rubygem(syck) -%endif +%BothRequires rubygem(syck) Requires(pre): GConf2 Requires(post): GConf2 @@ -165,32 +161,32 @@ Requires(preun): GConf2 Alexandria is a GNOME application to help you manage your book collection. %prep -%setup -q -n %{name}-%{majorver}%{?minorver:-%{?minorver}} +%setup -q -n %{name}-book-collection-manager-%{majorver}%{?minorver:-%{?minorver}} + # Check if patch2 issue is fixed in rev 1154 -#%%patch2 -p0 -b .up25348 -%patch3 -p1 -b .up28263.isdn -#%%patch4 -p0 -b .up29479.search -#%%patch10 -p1 -b .nogst -%patch11 -p1 -b .gem -%patch12 -p1 -b .rbconfig -#%%patch13 -p1 -b .rdoc -%patch14 -p1 -b .ascii -%patch15 -p1 -b .kcodefix -%patch16 -p1 -b .evalfix -%patch17 -p1 -b .z3950_next -%patch18 -p1 -b .ruby19_utf8 -%patch19 -p1 -b .export_html -%patch20 -p1 -b .export_csv -%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 +#%%patch -P2 -p0 -b .up25348 +%patch -P3 -p1 -b .up28263.isdn +#%%patch -P4 -p0 -b .up29479.search +%patch -P14 -p1 -b .ascii -Z +#%%patch -P15 -p1 -b .kcodefix +%patch -P18 -p1 -b .ruby19_utf8 -Z +%patch -P19 -p1 -b .export_html -Z +%patch -P20 -p1 -b .export_csv -Z +%patch -P21 -p1 -b .icon_kanji -Z +%patch -P22 -p1 -b .broken_yaml -Z +%patch -P23 -p1 -b .delete_yaml -Z +%patch -P25 -p1 -b .nothread -Z +%patch -P26 -p1 -b .z3950_count -Z +#%%patch -P27 -p1 -b .negative -Z +%patch -P29 -p1 -b .gettext -Z +%patch -P30 -p1 -b .utf8_2 -Z +%patch -P31 -p1 -b .undefined_method -Z +%patch -P32 -p1 -b .reset_search -Z +%patch -P33 -p1 -b .image_size -Z + +# Part of https://github.com/mvz/alexandria-book-collection-manager/commit/d9116e99242c209129bf09c3c1ad9a4ff6fdcf44 +# Needed for ruby3.2 - removes File.exists? +sed -i util/rake/gettextgenerate.rb -e 's|unless FileTest.exists.*$||' # Embed Fedora EVR %{__sed} -i.evr \ @@ -202,6 +198,13 @@ Alexandria is a GNOME application to help you manage your book collection. -e '/system/s|msgfmt |msgfmt --statistics |' \ util/rake/gettextgenerate.rb +# Workaround for directory hierarchy +ln -sf share data + +# Use system wide directory for datadir +sed -i lib/alexandria/config.rb \ + -e "\@^[ \t]*SHARE_DIR@s|SHARE_DIR[ \t]*=.*|SHARE_DIR = '/usr/share'|" + %build rake build --trace @@ -211,9 +214,6 @@ rake install_package_staging \ RUBYLIBDIR=%{ruby_vendorlibdir} desktop-file-install \ -%if 0%{?fedora} < 19 - --vendor fedora \ -%endif --dir $RPM_BUILD_ROOT%{_datadir}/applications/ \ --delete-original \ $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop @@ -239,8 +239,8 @@ desktop-file-install \ # # See http://www.freedesktop.org/software/appstream/docs/ for more details. # -mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata -cat > $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml < $RPM_BUILD_ROOT%{_datadir}/metainfo/%{name}.appdata.xml <