From 617b72c5e1da4efa85e6077a7bcb64c588b5cb7f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 28 Aug 2009 16:43:29 -0400 Subject: sha256 for 0.71.3 --- CHANGELOG | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 82c5ba59..fe3d6dfa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,9 +11,9 @@ Reverse Chronological: %% sisu_0.71.3.orig.tar.gz (2009-08-28:34/5) http://www.jus.uio.no/sisu/pkg/src/sisu_0.71.3.orig.tar.gz - sisu_0.71.3.orig.tar.gz - sisu_0.71.3-1.dsc - sisu_0.71.3-1.diff.gz + edeb7b5e4ea192a193f95dcbcf468102839cf3b9a18ee0e700e58eea37e739dd 1549708 sisu_0.71.3.orig.tar.gz + 5688f8fe14ba77f236a8bd4cb11bffa72d6e0f12b4474852ed54b6256c223eb3 1151 sisu_0.71.3-1.dsc + 98754efd995c57995ff2962dbdc391cfe1c6050468da73bb45fcbf3fea08628a 151405 sisu_0.71.3-1.diff.gz * fix to use imagemagick directly (when imagemagick is available and rmagick declares versions not in sync) -- cgit v1.2.3 From 1c07669d3798c1313612360719b8ca1cb559be62 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 29 Aug 2009 23:55:44 -0400 Subject: sql, fix, different solutions for postgresql and sqlite to populate database using ruby-dbi --- CHANGELOG | 9 +++++++++ conf/sisu/version1.yml | 6 +++--- data/doc/sisu/CHANGELOG | 24 +++++++++++++++++++++--- lib/sisu/v1/db_drop.rb | 9 +++++++-- lib/sisu/v1/db_import.rb | 46 ++++++++++++++++++++++++++++++++++++++++++---- lib/sisu/v1/db_remove.rb | 2 +- lib/sisu/v1/sysenv.rb | 5 +++++ 7 files changed, 88 insertions(+), 13 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index fe3d6dfa..4f34af69 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,15 @@ Reverse Chronological: %% STABLE MANIFEST +%% sisu_0.71.4.orig.tar.gz (2009-08-29:34/6) +http://www.jus.uio.no/sisu/pkg/src/sisu_0.71.4.orig.tar.gz + sisu_0.71.4.orig.tar.gz + sisu_0.71.4-1.dsc + sisu_0.71.4-1.diff.gz + + * sql, fix, different solutions for postgresql and sqlite to populate + database using ruby-dbi + %% sisu_0.71.3.orig.tar.gz (2009-08-28:34/5) http://www.jus.uio.no/sisu/pkg/src/sisu_0.71.3.orig.tar.gz edeb7b5e4ea192a193f95dcbcf468102839cf3b9a18ee0e700e58eea37e739dd 1549708 sisu_0.71.3.orig.tar.gz diff --git a/conf/sisu/version1.yml b/conf/sisu/version1.yml index b0cb9aee..b310f05a 100644 --- a/conf/sisu/version1.yml +++ b/conf/sisu/version1.yml @@ -1,5 +1,5 @@ --- -:version: 0.71.3 -:date_stamp: 2009w34/5 -:date: "2009-08-28" +:version: 0.71.4 +:date_stamp: 2009w34/6 +:date: "2009-08-29" :project: SiSU diff --git a/data/doc/sisu/CHANGELOG b/data/doc/sisu/CHANGELOG index 34026118..4f34af69 100644 --- a/data/doc/sisu/CHANGELOG +++ b/data/doc/sisu/CHANGELOG @@ -9,11 +9,29 @@ Reverse Chronological: %% STABLE MANIFEST +%% sisu_0.71.4.orig.tar.gz (2009-08-29:34/6) +http://www.jus.uio.no/sisu/pkg/src/sisu_0.71.4.orig.tar.gz + sisu_0.71.4.orig.tar.gz + sisu_0.71.4-1.dsc + sisu_0.71.4-1.diff.gz + + * sql, fix, different solutions for postgresql and sqlite to populate + database using ruby-dbi + +%% sisu_0.71.3.orig.tar.gz (2009-08-28:34/5) +http://www.jus.uio.no/sisu/pkg/src/sisu_0.71.3.orig.tar.gz + edeb7b5e4ea192a193f95dcbcf468102839cf3b9a18ee0e700e58eea37e739dd 1549708 sisu_0.71.3.orig.tar.gz + 5688f8fe14ba77f236a8bd4cb11bffa72d6e0f12b4474852ed54b6256c223eb3 1151 sisu_0.71.3-1.dsc + 98754efd995c57995ff2962dbdc391cfe1c6050468da73bb45fcbf3fea08628a 151405 sisu_0.71.3-1.diff.gz + + * fix to use imagemagick directly (when imagemagick is available and rmagick + declares versions not in sync) + %% sisu_0.71.2.orig.tar.gz (2009-08-02:30/7) http://www.jus.uio.no/sisu/pkg/src/sisu_0.71.2.orig.tar.gz - sisu_0.71.2.orig.tar.gz - sisu_0.71.2-1.dsc - sisu_0.71.2-1.diff.gz + 220199cbc435ec6d246af4ac43a2ef6a3e05f649847c4ee04b831af1e8ad4902 1548875 sisu_0.71.2.orig.tar.gz + ec3fae1599112343d69f2843a09acb583653bc174e65589f4c3bbc52ef66d4fb 1151 sisu_0.71.2-1.dsc + bbc4264049d4e6c147dd77b9b41774bcb421ce5bffeb5801872f5520f9967fba 151350 sisu_0.71.2-1.diff.gz * fixes * html book index, batch processing fix, re-initialize variable after use diff --git a/lib/sisu/v1/db_drop.rb b/lib/sisu/v1/db_drop.rb index bed179b7..258b31c1 100644 --- a/lib/sisu/v1/db_drop.rb +++ b/lib/sisu/v1/db_drop.rb @@ -95,7 +95,9 @@ module SiSU_DB_drop File.unlink(@db_info.sqlite.db) end else - @conn.do(@drop_table.join('')) + @drop_table.each do |d| + @conn.execute(d) + end end rescue case @sql_type @@ -105,7 +107,10 @@ module SiSU_DB_drop if ans and File.exist?(@db_info.sqlite.db); File.unlink(@db_info.sqlite.db) end else - @conn.do(@drop_table.join('')) + @drop_table.each do |d| + @conn.execute(d) + end + #@conn.do(@drop_table.join('')) end ensure #commit diff --git a/lib/sisu/v1/db_import.rb b/lib/sisu/v1/db_import.rb index da564639..7268616b 100644 --- a/lib/sisu/v1/db_import.rb +++ b/lib/sisu/v1/db_import.rb @@ -138,14 +138,52 @@ module SiSU_DB_import puts @conn.driver if defined? @conn.driver end begin - @conn.transaction do |conn| - t_d.each do |sql| - conn.execute(sql) + sql='' + if @sql_type=~/sqlite/ + @conn.transaction do |conn| + t_d.each do |sql| + conn.execute(sql) + end end + #also 'execute' works for sqlite + #@conn.execute("BEGIN") + # t_d.each do |sql| + # @conn.execute(sql) + # end + #@conn.execute("COMMIT") + else + #'do' works for postgresql + @conn.do("BEGIN") + t_d.each do |sql| + @conn.do(sql) + end + @conn.do("COMMIT") + end + rescue DBI::DatabaseError => e + puts "Error code: #{e.err}" + puts "Error message: #{e.errstr}" + puts "Error SQLSTATE: #{e.state}" + SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error + sqlfn="#{@env.path.sql}/#{@md.fnb}.sql" + sql=File.new(sqlfn,'w') + t_d.each {|i| sql.puts i} + p sqlfn + if @opt.cmd =~/M/ + puts sql + p @conn.methods.sort + puts "#{__FILE__}:#{__LINE__}" end rescue SiSU_Errors::Info_error.new($!,$@,@opt.cmd,@opt.fns).error - puts "#{__FILE__}:#{__LINE__}" if @opt.cmd =~/M/ + sqlfn="#{@env.path.sql}/#{@md.fnb}.sql" + sql=File.new(sqlfn,'w') + t_d.each {|i| sql.puts i} + p sqlfn + if @opt.cmd =~/M/ + puts sql + p @conn.methods.sort + puts "#{__FILE__}:#{__LINE__}" + end ensure #@conn.execute("COMMIT") end diff --git a/lib/sisu/v1/db_remove.rb b/lib/sisu/v1/db_remove.rb index bde5c891..e7ed70a8 100644 --- a/lib/sisu/v1/db_remove.rb +++ b/lib/sisu/v1/db_remove.rb @@ -99,7 +99,7 @@ module SiSU_DB_remove end else tell=SiSU_Screen::Ansi.new(@opt.cmd,"no such file in database #{@db.psql.db}::#{@opt.fns}") - tell.puts_grey #if @opt.cmd.include? ?v + tell.puts_grey unless @opt.cmd =~/q/ #if @opt.cmd.include? ?v end end end diff --git a/lib/sisu/v1/sysenv.rb b/lib/sisu/v1/sysenv.rb index 8d4636c1..8b15f957 100644 --- a/lib/sisu/v1/sysenv.rb +++ b/lib/sisu/v1/sysenv.rb @@ -1457,6 +1457,11 @@ WOK end processing end + def sql + pth="#{processing}/sql" + mkdir_p(pth) unless FileTest.directory?(pth) + pth + end def composite_file pth=path.dal #"#{processing}/composite" mkdir_p(pth) unless FileTest.directory?(pth) -- cgit v1.2.3