From 69d476386d149117ced7c77f9f383646a33bcd38 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 12 Oct 2014 10:21:03 -0400 Subject: v5 v6: db, --maintenance sql, separated out postgresql & sqlite * could share "maintenance" db import sql file (as done previously), consider --- lib/sisu/v5/db_import.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/sisu/v5/db_import.rb') diff --git a/lib/sisu/v5/db_import.rb b/lib/sisu/v5/db_import.rb index 0ce24831..59cff28a 100644 --- a/lib/sisu/v5/db_import.rb +++ b/lib/sisu/v5/db_import.rb @@ -102,7 +102,9 @@ module SiSU_DbImport ? @conn.execute( sql ).join.to_i : @conn.exec( sql ).getvalue(0,0).to_i rescue - puts "#{__FILE__}:#{__LINE__}" if @opt.act[:maintenance][:set]==:on + if @opt.act[:maintenance][:set]==:on + puts "#{__FILE__}:#{__LINE__}" + end end @col[:lid]=0 if @col[:lid].nil? or @col[:lid].to_s.empty? sql='SELECT MAX(nid) FROM endnotes' @@ -112,7 +114,9 @@ module SiSU_DbImport : @conn.exec( sql ).getvalue(0,0).to_i @id_n ||=0 rescue - puts "#{__FILE__}:#{__LINE__}" if @opt.act[:maintenance][:set]==:on + if @opt.act[:maintenance][:set]==:on + puts "#{__FILE__}:#{__LINE__}" + end end @id_n =0 if @col[:lid].nil? or @col[:lid].to_s.empty? @col[:lv0]=@col[:lv1]=@col[:lv2]=@col[:lv3]=@col[:lv4]=@col[:lv5]=@col[:lv6]=@col[:lv7]=0 @@ -307,7 +311,9 @@ module SiSU_DbImport : @conn.exec( sql ).getvalue(0,0).to_i @@id_t=id_t if id_t rescue - puts "#{__FILE__} #{__LINE__}" if @opt.act[:maintenance][:set]==:on + if @opt.act[:maintenance][:set]==:on + puts "#{__FILE__} #{__LINE__}" + end end @@id_t+=1 #bug related, needs to be performed once at start of file, but consider moving, as, placed here it means program will fail if document header lacks @title: if (@opt.act[:verbose][:set]==:on \ -- cgit v1.2.3