aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-03-13 22:02:20 -0400
committerRalph Amissah <ralph@amissah.com>2013-03-13 22:02:20 -0400
commit0e87ea14e6dcccf4e63755e128e0ddff0d80fb79 (patch)
tree4daaa0250d208c0a494253b47918b5f48673a044
parentv4: hub, sysenv, remote, work on rsync of document/site build (diff)
v4: hub, sql db, fix for actions not requiring files, create, drop, etc.
-rw-r--r--data/doc/sisu/CHANGELOG_v42
-rw-r--r--lib/sisu/v4/hub.rb51
2 files changed, 24 insertions, 29 deletions
diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4
index 813f4d83..3f8b0c4d 100644
--- a/data/doc/sisu/CHANGELOG_v4
+++ b/data/doc/sisu/CHANGELOG_v4
@@ -36,6 +36,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.13.orig.tar.xz
* v4: hub, sysenv, remote, work on rsync of document/site build
+* v4: hub, sql db, fix for actions not requiring files, create, drop, etc.
+
%% 4.0.12.orig.tar.xz (2013-03-08:09/5)
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.0.12
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.0.12-1
diff --git a/lib/sisu/v4/hub.rb b/lib/sisu/v4/hub.rb
index cf821246..f7cdb1e2 100644
--- a/lib/sisu/v4/hub.rb
+++ b/lib/sisu/v4/hub.rb
@@ -457,42 +457,22 @@ module SiSU
end
if @opt.act[:psql][:set]==:on #% --pg, -D DB postgresql
require_relative 'dbi'
- if @opt.files.length > 0 #switch test to actual commands
- OptionLoopFiles.new(@opt).loop_files_on_given_option do
- SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb
- end
- else
- SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb
+ OptionLoopFiles.new(@opt).loop_files_on_given_option do
+ SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb
end
end
if @opt.act[:sqlite][:set]==:on #% --sqlite, -d DB sqlite
require_relative 'dbi'
- if @opt.files.length > 0 #switch test to actual commands
- OptionLoopFiles.new(@opt).loop_files_on_given_option do
- SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb
- end
- else
- SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb
+ OptionLoopFiles.new(@opt).loop_files_on_given_option do
+ SiSU_DBI::SQL.new(@opt).connect # -D -d dbi.rb
end
end
- if @opt.act[:dal][:set]==:on #% --dal, -m embedded content
- # OptionLoopFiles.new(@opt).loop_files_on_given_option do
- # require_relative 'embedded'
- # SiSU_Embedded::Source.new(@opt).read # -m embedded.rb (image and other content) #check
- # end
- end
if @opt.act[:zap][:set]==:on #% --zap, -Z
# OptionLoopFiles.new(@opt).loop_files_on_given_option do
# require_relative 'zap'
# SiSU_Zap::Source.new(@opt).read # -Z zap.rb
# end
end
- if @opt.act[:sisupod][:set]==:on #% --sisupod, -S make sisupod
- # OptionLoopFiles.new(@opt).loop_files_on_given_option do
- # require_relative 'sisupod_make'
- # SiSU_Doc::Source.new(@opt).read # -S sisupod_make.rb
- # end
- end
if @opt.act[:manifest][:set]==:on #% --manifest, -y
require_relative 'manifest'
OptionLoopFiles.new(@opt).manifest_on_files_translated do
@@ -635,15 +615,17 @@ module SiSU
require 'profile'
end
action_on_file_ =if @opt.act[:rsync][:set]==:on \
- && @opt.act[:site_init][:set]==:on #\
- #|| @opt.act[:harvest][:set]==:on)
+ && @opt.act[:site_init][:set]==:on
:false
elsif @opt.act[:rsync][:set]==:on \
- && @opt.act[:site_init][:set] !=:on #\
- #&& @opt.act[:harvest][:set] !=:on
+ && @opt.act[:site_init][:set] !=:on
:true
+ elsif ((@opt.act[:psql][:set]==:on \
+ or @opt.act[:sqlite][:set]==:on) \
+ and @opt.mod.join(';') =~/--(?:createdb|init(?:ialize)?|create(?:all)?|createtables|recreate|drop(?:all))/)
+ :false
else
- action_on_file_ =(@opt.act[:dal][:set]==:on \
+ (@opt.act[:dal][:set]==:on \
|| @opt.act[:manpage][:set]==:on \
|| @opt.act[:texinfo][:set]==:on \
|| @opt.act[:txt][:set]==:on \
@@ -678,6 +660,17 @@ module SiSU
SiSU_Harvest::Source.new(@opt).read # -h -H html.rb
elsif @opt.mod.inspect =~/--convert|--to|--from/
require_relative 'sst_convert_markup' # sst_convert_markup.rb
+ elsif action_on_file_ == :false \
+ and (@opt.act[:psql][:set]==:on \
+ or @opt.act[:sqlite][:set]==:on)
+ if @opt.act[:psql][:set]==:on
+ require_relative 'dbi'
+ SiSU_DBI::SQL.new(@opt).connect
+ end
+ if @opt.act[:sqlite][:set]==:on
+ require_relative 'dbi'
+ SiSU_DBI::SQL.new(@opt).connect
+ end
elsif action_on_file_ == :true \
or (
@opt.cmd =~/^-/ \