From 5331c088fb00a71bc397a0bd7eac78bae62f4ed5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 6 Jun 2013 21:15:34 -0400 Subject: v4 v5: db, population of database (--update), import of master files (.ssm), fix * (Note: for .ssm: @md.fns (is set during runtime & is) != @opt.fns @md.opt.fns, affects construction of unique identifier) --- data/doc/sisu/CHANGELOG_v4 | 4 ++++ data/doc/sisu/CHANGELOG_v5 | 4 ++++ lib/sisu/v4/db_import.rb | 4 ++-- lib/sisu/v4/db_remove.rb | 8 ++++---- lib/sisu/v5/db_import.rb | 4 ++-- lib/sisu/v5/db_remove.rb | 8 ++++---- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index 90c4ed8b..bc458c78 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -30,6 +30,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.1.4.orig.tar.xz sisu_4.1.4.orig.tar.xz sisu_4.1.4-1.dsc +* db, population of database (--update), import of master files (.ssm), fix + (Note: for .ssm: @md.fns (is set during runtime & is) != @opt.fns @md.opt.fns, + affects construction of unique identifier) + %% 4.1.3.orig.tar.xz (2013-05-30:21/4) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.1.3 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.1.3-1 diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 91d81988..e148d9a9 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -30,6 +30,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.0.4.orig.tar.xz sisu_5.0.4.orig.tar.xz sisu_5.0.4-1.dsc +* db, population of database (--update), import of master files (.ssm), fix + (Note: for .ssm: @md.fns (is set during runtime & is) != @opt.fns @md.opt.fns, + affects construction of unique identifier) + %% 5.0.3.orig.tar.xz (2013-05-30:21/4) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.0.3 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.0.3-1 diff --git a/lib/sisu/v4/db_import.rb b/lib/sisu/v4/db_import.rb index 199d4efa..a4251a98 100644 --- a/lib/sisu/v4/db_import.rb +++ b/lib/sisu/v4/db_import.rb @@ -129,9 +129,9 @@ module SiSU_DbImport select_first_match=%{ SELECT metadata_and_text.tid FROM metadata_and_text - WHERE metadata_and_text.src_filename = '#{@opt.fns}' + WHERE metadata_and_text.src_filename = '#{@md.fns}' AND metadata_and_text.language_document_char = '#{@opt.lng}' - ;} + ;} # note, for .ssm: @md.fns (is set during runtime & is) != @opt.fns @md.opt.fns file_exist=@sql_type=~/sqlite/ \ ? @conn.get_first_value(select_first_match) : @conn.select_one(select_first_match) diff --git a/lib/sisu/v4/db_remove.rb b/lib/sisu/v4/db_remove.rb index 740977d0..c402f959 100644 --- a/lib/sisu/v4/db_remove.rb +++ b/lib/sisu/v4/db_remove.rb @@ -78,17 +78,17 @@ module SiSU_DbRemove remove_selected=%{ SELECT tid FROM metadata_and_text - WHERE src_filename = '#{@opt.fns}' + WHERE src_filename = '#{@md.fns}' AND metadata_and_text.language_document_char = '#{@opt.lng}' - ;} + ;} # note, for .ssm: @md.fns (is set during runtime & is) != @opt.fns @md.opt.fns @conn.get_first_value(remove_selected).to_i else remove_selected=%{ SELECT metadata_and_text.tid FROM metadata_and_text - WHERE metadata_and_text.src_filename = '#{@opt.fns}' + WHERE metadata_and_text.src_filename = '#{@md.fns}' AND metadata_and_text.language_document_char = '#{@opt.lng}' - ;} + ;} # note, for .ssm: @md.fns (is set during runtime & is) != @opt.fns @md.opt.fns x=@conn.select_one(remove_selected) x ? (x.join.to_i) : nil end diff --git a/lib/sisu/v5/db_import.rb b/lib/sisu/v5/db_import.rb index a1d332bb..293071ff 100644 --- a/lib/sisu/v5/db_import.rb +++ b/lib/sisu/v5/db_import.rb @@ -129,9 +129,9 @@ module SiSU_DbImport select_first_match=%{ SELECT metadata_and_text.tid FROM metadata_and_text - WHERE metadata_and_text.src_filename = '#{@opt.fns}' + WHERE metadata_and_text.src_filename = '#{@md.fns}' AND metadata_and_text.language_document_char = '#{@opt.lng}' - ;} + ;} # note, for .ssm: @md.fns (is set during runtime & is) != @opt.fns @md.opt.fns file_exist=@sql_type=~/sqlite/ \ ? @conn.get_first_value(select_first_match) : @conn.select_one(select_first_match) diff --git a/lib/sisu/v5/db_remove.rb b/lib/sisu/v5/db_remove.rb index 1fb40e30..2e65d51a 100644 --- a/lib/sisu/v5/db_remove.rb +++ b/lib/sisu/v5/db_remove.rb @@ -78,17 +78,17 @@ module SiSU_DbRemove remove_selected=%{ SELECT tid FROM metadata_and_text - WHERE src_filename = '#{@opt.fns}' + WHERE src_filename = '#{@md.fns}' AND metadata_and_text.language_document_char = '#{@opt.lng}' - ;} + ;} # note, for .ssm: @md.fns (is set during runtime & is) != @opt.fns @md.opt.fns @conn.get_first_value(remove_selected).to_i else remove_selected=%{ SELECT metadata_and_text.tid FROM metadata_and_text - WHERE metadata_and_text.src_filename = '#{@opt.fns}' + WHERE metadata_and_text.src_filename = '#{@md.fns}' AND metadata_and_text.language_document_char = '#{@opt.lng}' - ;} + ;} # note, for .ssm: @md.fns (is set during runtime & is) != @opt.fns @md.opt.fns x=@conn.select_one(remove_selected) x ? (x.join.to_i) : nil end -- cgit v1.2.3