aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/db_import.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-10-12 10:21:03 -0400
committerRalph Amissah <ralph@amissah.com>2014-10-12 10:21:03 -0400
commit69d476386d149117ced7c77f9f383646a33bcd38 (patch)
tree68edfd4da7d6e32bd1611d139d712b31363a5e80 /lib/sisu/v6/db_import.rb
parentv5 v6: epub tune, --maintenance, fix (diff)
v5 v6: db, --maintenance sql, separated out postgresql & sqlite
* could share "maintenance" db import sql file (as done previously), consider
Diffstat (limited to 'lib/sisu/v6/db_import.rb')
-rw-r--r--lib/sisu/v6/db_import.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/sisu/v6/db_import.rb b/lib/sisu/v6/db_import.rb
index e61290aa..9473863d 100644
--- a/lib/sisu/v6/db_import.rb
+++ b/lib/sisu/v6/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 \