From 3e0dbbc13f6a491bdec3968937cb983d103c5b81 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA
Date: Fri, 3 Jan 2020 14:09:02 +0900
Subject: [PATCH 01/55] WIP: port to 0.7.4 ng
---
...andria-0.6.8-always-require-rubygems.patch | 10 -----
alexandria-0.6.8-ascii-fix.patch | 16 -------
alexandria-0.6.8-evalfix.patch | 25 -----------
alexandria-0.6.8-nogst-support.patch | 38 ----------------
alexandria-0.6.8-rdoc.patch | 13 ------
alexandria-0.6.9-rbconfig.patch | 30 -------------
alexandria-0.7.4-ascii-fix.patch | 15 +++++++
..._use_thread_when_adding_file_by_isdn.patch | 14 +++---
alexandria.spec | 44 +++++--------------
9 files changed, 33 insertions(+), 172 deletions(-)
delete mode 100644 alexandria-0.6.8-always-require-rubygems.patch
delete mode 100644 alexandria-0.6.8-ascii-fix.patch
delete mode 100644 alexandria-0.6.8-evalfix.patch
delete mode 100644 alexandria-0.6.8-nogst-support.patch
delete mode 100644 alexandria-0.6.8-rdoc.patch
delete mode 100644 alexandria-0.6.9-rbconfig.patch
create mode 100644 alexandria-0.7.4-ascii-fix.patch
rename alexandria-0.6.6-dont_use_thread_when_adding_file_by_isdn.patch => alexandria-0.7.4-dont_use_thread_when_adding_file_by_isdn.patch (57%)
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-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.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.7.4-ascii-fix.patch b/alexandria-0.7.4-ascii-fix.patch
new file mode 100644
index 0000000..abda240
--- /dev/null
+++ b/alexandria-0.7.4-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 = 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.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.spec b/alexandria.spec
index 8d6f50d..00449ae 100644
--- a/alexandria.spec
+++ b/alexandria.spec
@@ -1,26 +1,20 @@
-%if 0%{?fedora} <= 19
-%define rubyabi 1.9.1
-%endif
-
-%define repoid 76353
-
-%define majorver 0.6.9
+%define majorver 0.7.4
%undefine minorver
%undefine ifpre
-%define fedorarel 11
+%define fedorarel 0.100
%define rel %{?ifpre:0.}%{fedorarel}%{?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
+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,31 +23,19 @@ 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.4-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
+#Patch15: alexandria-0.6.8-kcodefix.patch
# With working zoom and ruby19, z3950 provider aborts
# with syntax error about next
Patch17: alexandria-0.6.8-z3950-next.patch
@@ -165,18 +147,14 @@ 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
+#%%patch15 -p1 -b .kcodefix
%patch17 -p1 -b .z3950_next
%patch18 -p1 -b .ruby19_utf8
%patch19 -p1 -b .export_html
From 5cccbb515f0e89f7c1e0961c1df28851862985c1 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA
Date: Fri, 3 Jan 2020 17:46:02 +0900
Subject: [PATCH 02/55] once porting till patch22 is done
---
...6.8-export-to-CSV-bintex-with-ruby19.patch | 34 ------------
...ria-0.6.8-export-to-HTML-with-ruby19.patch | 45 ----------------
alexandria-0.6.8-utf8-convert.patch | 28 ----------
alexandria-0.6.8-yaml-unescape.patch | 53 -------------------
alexandria-0.6.8-z3950-next.patch | 11 ----
...7.4-export-to-CSV-bintex-with-ruby19.patch | 30 +++++++++++
...ria-0.7.4-export-to-HTML-with-ruby19.patch | 45 ++++++++++++++++
... alexandria-0.7.4-iconview-multibyte.patch | 6 +--
alexandria-0.7.4-utf8-convert.patch | 28 ++++++++++
alexandria-0.7.4-yaml-unescape.patch | 44 +++++++++++++++
alexandria.spec | 14 ++---
11 files changed, 155 insertions(+), 183 deletions(-)
delete mode 100644 alexandria-0.6.8-export-to-CSV-bintex-with-ruby19.patch
delete mode 100644 alexandria-0.6.8-export-to-HTML-with-ruby19.patch
delete mode 100644 alexandria-0.6.8-utf8-convert.patch
delete mode 100644 alexandria-0.6.8-yaml-unescape.patch
delete mode 100644 alexandria-0.6.8-z3950-next.patch
create mode 100644 alexandria-0.7.4-export-to-CSV-bintex-with-ruby19.patch
create mode 100644 alexandria-0.7.4-export-to-HTML-with-ruby19.patch
rename alexandria-0.6.8-iconview-multibyte.patch => alexandria-0.7.4-iconview-multibyte.patch (65%)
create mode 100644 alexandria-0.7.4-utf8-convert.patch
create mode 100644 alexandria-0.7.4-yaml-unescape.patch
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 << ""
- book.authors.each do |author|
- xhtml << <#{xhtml_escape(author)}
-+- #{xhtml_escape(author).force_encoding("UTF-8")}
- EOS
- end
- 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-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.7.4-export-to-CSV-bintex-with-ruby19.patch b/alexandria-0.7.4-export-to-CSV-bintex-with-ruby19.patch
new file mode 100644
index 0000000..21318a4
--- /dev/null
+++ b/alexandria-0.7.4-export-to-CSV-bintex-with-ruby19.patch
@@ -0,0 +1,30 @@
+--- alexandria-book-collection-manager-0.7.4/lib/alexandria/export_library.rb.csv 2020-01-03 16:24:11.989122168 +0900
++++ alexandria-book-collection-manager-0.7.4/lib/alexandria/export_library.rb 2020-01-03 16:37:23.739363736 +0900
+@@ -110,12 +110,12 @@
+ 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
+ io.close
+@@ -379,8 +379,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"
+ bibtex << "OPTnote = \"#{latex_escape(book.notes)}\",\n" if book.notes && !book.notes.empty?
+ # year is a required field in bibtex @BOOK
+ bibtex << "year = " + (book.publishing_year || '"n/a"').to_s + "\n"
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
+
+ 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.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-utf8-convert.patch b/alexandria-0.7.4-utf8-convert.patch
new file mode 100644
index 0000000..694f555
--- /dev/null
+++ b/alexandria-0.7.4-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.map!{|str| str.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.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.4-yaml-unescape.patch b/alexandria-0.7.4-yaml-unescape.patch
new file mode 100644
index 0000000..94f825e
--- /dev/null
+++ b/alexandria-0.7.4-yaml-unescape.patch
@@ -0,0 +1,44 @@
+--- alexandria-book-collection-manager-0.7.4/lib/alexandria/library_store.rb.broken_yaml 2019-10-25 01:20:07.000000000 +0900
++++ alexandria-book-collection-manager-0.7.4/lib/alexandria/library_store.rb 2020-01-03 17:38:07.340338529 +0900
+@@ -48,8 +48,23 @@ module Alexandria
+ Dir["*" + Library::EXT[:book]].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 = 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})#{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
+@@ -193,6 +208,8 @@ module Alexandria
+
+ # TODO: Ensure book loading passes through Book#initialize
+ book = YAML.safe_load(text, permitted_classes: [Book, Time])
++ # TODO: Need check if this can be removed
++ # book = YAML.load(Syck::unescape(text))
+
+ unless book.isbn.class == String
+ # HACK
diff --git a/alexandria.spec b/alexandria.spec
index 00449ae..60b605b 100644
--- a/alexandria.spec
+++ b/alexandria.spec
@@ -36,27 +36,24 @@ Patch14: alexandria-0.7.4-ascii-fix.patch
# Well, with the original fix, some strange failure on startup
# happens on ja_JP.utf8...
#Patch15: alexandria-0.6.8-kcodefix.patch
-# With working zoom and ruby19, z3950 provider aborts
-# with syntax error about next
-Patch17: alexandria-0.6.8-z3950-next.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.4-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.4-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.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
@@ -155,7 +152,6 @@ Alexandria is a GNOME application to help you manage your book collection.
#%%patch4 -p0 -b .up29479.search
%patch14 -p1 -b .ascii
#%%patch15 -p1 -b .kcodefix
-%patch17 -p1 -b .z3950_next
%patch18 -p1 -b .ruby19_utf8
%patch19 -p1 -b .export_html
%patch20 -p1 -b .export_csv
From 20bd21f3ef90a4956f13f573aa5b632d1224ae13 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA
Date: Fri, 3 Jan 2020 17:46:59 +0900
Subject: [PATCH 03/55] WIP: mark this as WIP explicitly
---
alexandria.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/alexandria.spec b/alexandria.spec
index 60b605b..964601f 100644
--- a/alexandria.spec
+++ b/alexandria.spec
@@ -2,7 +2,7 @@
%undefine minorver
%undefine ifpre
-%define fedorarel 0.100
+%define fedorarel 0.100.WIP
%define rel %{?ifpre:0.}%{fedorarel}%{?minorver:.%minorver}
From 408d3fdd3e67a362d970f999f708d572ea350e37 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA
Date: Sat, 4 Jan 2020 14:24:18 +0900
Subject: [PATCH 04/55] WIP: porting till patch28 is done, once save
---
alexandria-0.6.9-goocanvas-version.patch | 11 ---------
alexandria-0.6.9-iconv.patch | 23 -------------------
alexandria-0.6.9-negative-value.patch | 11 ---------
alexandria-0.6.9-newbook-nothread.patch | 22 ------------------
alexandria-0.6.9-z3950-zoom-count.patch | 13 -----------
... alexandria-0.7.4-delete-broken-yaml.patch | 18 +++++++--------
alexandria-0.7.4-negative-value.patch | 11 +++++++++
alexandria-0.7.4-newbook-nothread.patch | 22 ++++++++++++++++++
alexandria-0.7.4-z3950-zoom-count.patch | 15 ++++++++++++
alexandria.spec | 15 +++++-------
10 files changed, 63 insertions(+), 98 deletions(-)
delete mode 100644 alexandria-0.6.9-goocanvas-version.patch
delete mode 100644 alexandria-0.6.9-iconv.patch
delete mode 100644 alexandria-0.6.9-negative-value.patch
delete mode 100644 alexandria-0.6.9-newbook-nothread.patch
delete mode 100644 alexandria-0.6.9-z3950-zoom-count.patch
rename alexandria-0.6.9-delete-broken-yaml.patch => alexandria-0.7.4-delete-broken-yaml.patch (82%)
create mode 100644 alexandria-0.7.4-negative-value.patch
create mode 100644 alexandria-0.7.4-newbook-nothread.patch
create mode 100644 alexandria-0.7.4-z3950-zoom-count.patch
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.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.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
From b264c3d65ce34284af8da4bf3aed50ba7f47eeeb Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA
Date: Sat, 4 Jan 2020 14:51:28 +0900
Subject: [PATCH 05/55] WIP: importing patch once done
---
alexandria-0.6.9-gdk_pixbuf2-3.0.9.patch | 139 -----------------------
alexandria-0.6.9-glade-gettext.patch | 10 --
alexandria-0.7.4-glade-gettext.patch | 10 ++
alexandria.spec | 5 +-
4 files changed, 11 insertions(+), 153 deletions(-)
delete mode 100644 alexandria-0.6.9-gdk_pixbuf2-3.0.9.patch
delete mode 100644 alexandria-0.6.9-glade-gettext.patch
create mode 100644 alexandria-0.7.4-glade-gettext.patch
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.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.spec b/alexandria.spec
index ad016cf..8b56c8d 100644
--- a/alexandria.spec
+++ b/alexandria.spec
@@ -68,9 +68,7 @@ Patch27: alexandria-0.7.4-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)
-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
BuildArch: noarch
@@ -161,7 +159,6 @@ Alexandria is a GNOME application to help you manage your book collection.
%patch26 -p1 -b .z3950_count
%patch27 -p1 -b .negative
%patch29 -p1 -b .gettext
-%patch30 -p1 -b .rg309
# Embed Fedora EVR
%{__sed} -i.evr \
From 3c4989d0f481c005966dcb371c288ee540941db1 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA
Date: Sat, 4 Jan 2020 15:34:23 +0900
Subject: [PATCH 06/55] WIP: spec file change once push
---
alexandria.spec | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/alexandria.spec b/alexandria.spec
index 8b56c8d..f26fdc7 100644
--- a/alexandria.spec
+++ b/alexandria.spec
@@ -170,6 +170,9 @@ 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
+
%build
rake build --trace
@@ -207,8 +210,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 <