From 3535397c41976bb298825c2ed2d5ded81cc0c924 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 20 Dec 2007 00:21:53 +0000 Subject: sisupod, bugfixes for rsync placement and for download and processing --- CHANGELOG | 9 +++- .../sisu_manual/sisu_download.ssi | 24 +++++------ .../sisu_manual/sisu_manual.ssm | 4 +- lib/sisu/v0/hub.rb | 49 ++++------------------ lib/sisu/v0/options.rb | 2 +- lib/sisu/v0/remote.rb | 36 +++++++++++++++- lib/sisu/v0/sysenv.rb | 15 ++++--- 7 files changed, 73 insertions(+), 66 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d977ce1a..9743aa8f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,7 +9,7 @@ Reverse Chronological: %% STABLE MANIFEST -%% sisu_0.63.0.orig.tar.gz (2007-12-17:51/1) +%% sisu_0.63.0.orig.tar.gz (2007-12-20:51/4) http://www.jus.uio.no/sisu/pkg/src/sisu_0.63.0.orig.tar.gz sisu_0.63.0.orig.tar.gz sisu_0.63.0-1.dsc @@ -26,7 +26,12 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.63.0.orig.tar.gz default, image dimension adjustments not yet made (for different orientation)] - * rsync sisupod, bugfix + * sisupod, bugfixes for rsync placement and for download and processing + [(if made available) once downloaded may be converted when needed to the + output format desired, outputs may also be generated by executing commands + directly against pod at remote location, e.g. + sisu -3 http://www.jus.uio.no/sisu/pod/free_culture.lawrence_lessig.sst.zip + ] %% sisu_0.62.4.orig.tar.gz (2007-12-14:50/5) http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.4.orig.tar.gz diff --git a/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_download.ssi b/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_download.ssi index cf6f55ef..88a5e69a 100644 --- a/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_download.ssi +++ b/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_download.ssi @@ -18,9 +18,9 @@ @date.available: 2007-08-28 -@date.modified: 2007-12-05 +@date.modified: 2007-12-20 -@date: 2007-12-05 +@date: 2007-12-20 @level: new=C; break=1; num_top=1 @@ -55,7 +55,7 @@ Download the latest version of SiSU (and SiSU markup samples):~{ Breakage and Fixes Report
http://www.jus.uio.no/sisu/SiSU/breakage_and_fixes.html }~ -_* {~^ sisu_0.62.4.orig.tar.gz (of 2007-12-14:50/5) }http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.4.orig.tar.gz +_* {~^ sisu_0.63.0.orig.tar.gz (of 2007-12-20:51/4) }http://www.jus.uio.no/sisu/pkg/src/sisu_0.63.0.orig.tar.gz _* {~^ sisu-markup-samples_1.0.8.orig.tar.gz (of 2007-08-19:33/7 ) }http://www.jus.uio.no/sisu/pkg/src/sisu-markup-samples_1.0.8.orig.tar.gz *~sisu-markup-samples @@ -90,23 +90,23 @@ deb-src http://www.jus.uio.no/sisu/archive unstable main non-free !_ Source -_* {~^ sisu_0.62.4.orig.tar.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.4.orig.tar.gz +_* {~^ sisu_0.63.0.orig.tar.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_0.63.0.orig.tar.gz -_* {~^ sisu_0.62.4-1.diff.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.4-1.diff.gz +_* {~^ sisu_0.63.0-1.diff.gz }http://www.jus.uio.no/sisu/pkg/src/sisu_0.63.0-1.diff.gz -_* {~^ sisu_0.62.4-1.dsc }http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.4-1.dsc +_* {~^ sisu_0.63.0-1.dsc }http://www.jus.uio.no/sisu/pkg/src/sisu_0.63.0-1.dsc !_ Debs -_* {~^ sisu_0.62.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu_0.62.4-1_all.deb ~{
sisu, the base code, (the main package on which the others depend), without any dependencies other than ruby (and for convenience the ruby webrick web server), this generates a number of types of output on its own, other packages provide additional functionality, and have their dependencies
Depends: ruby (>=1.8.2), libwebrick-ruby
Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, sisu-examples, vim-sisu, librmagick-ruby, trang, tidy, libtidy, librexml-ruby, zip, unzip, openssl }~ +_* {~^ sisu_0.63.0-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu_0.63.0-1_all.deb ~{
sisu, the base code, (the main package on which the others depend), without any dependencies other than ruby (and for convenience the ruby webrick web server), this generates a number of types of output on its own, other packages provide additional functionality, and have their dependencies
Depends: ruby (>=1.8.2), libwebrick-ruby
Recommends: sisu-pdf, sisu-sqlite, sisu-postgresql, sisu-examples, vim-sisu, librmagick-ruby, trang, tidy, libtidy, librexml-ruby, zip, unzip, openssl }~ -_* {~^ sisu-complete_0.62.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-complete_0.62.4-1_all.deb ~{
a package that pulls in other packages to build the whole of sisu (excluding sisu-examples)
Depends: ruby (>=1.8.2), sisu, sisu-pdf, sisu-postgresql, sisu-remote, sisu-sqlite, vim-sisu
Recommends: sisu-examples }~ +_* {~^ sisu-complete_0.63.0-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-complete_0.63.0-1_all.deb ~{
a package that pulls in other packages to build the whole of sisu (excluding sisu-examples)
Depends: ruby (>=1.8.2), sisu, sisu-pdf, sisu-postgresql, sisu-remote, sisu-sqlite, vim-sisu
Recommends: sisu-examples }~ -_* {~^ sisu-pdf_0.62.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-pdf_0.62.4-1_all.deb ~{
dependencies used by sisu to produce pdf from LaTeX generated
Depends: sisu, tetex-bin, tetex-extra, latex-ucs
Suggests: evince, xpdf }~ +_* {~^ sisu-pdf_0.63.0-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-pdf_0.63.0-1_all.deb ~{
dependencies used by sisu to produce pdf from LaTeX generated
Depends: sisu, tetex-bin, tetex-extra, latex-ucs
Suggests: evince, xpdf }~ -_* {~^ sisu-postgresql_0.62.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-postgresql_0.62.4-1_all.deb ~{
dependencies used by sisu to populate postgresql database (further configuration is necessary)
Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby
Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1 }~ +_* {~^ sisu-postgresql_0.63.0-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-postgresql_0.63.0-1_all.deb ~{
dependencies used by sisu to populate postgresql database (further configuration is necessary)
Depends: sisu, postgresql-8.1, libdbi-ruby, libdbm-ruby, libdbd-pg-ruby
Suggests: pgaccess, libdbd-pgsql, postgresql-contrib-8.1 }~ -_* {~^ sisu-sqlite_0.62.4-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-sqlite_0.62.4-1_all.deb ~{
dependencies used by sisu to populate sqlite database
Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby
Suggests: libdbd-sqlite }~ +_* {~^ sisu-sqlite_0.63.0-1_all.deb }http://www.jus.uio.no/sisu/archive/pool/main/s/sisu/sisu-sqlite_0.63.0-1_all.deb ~{
dependencies used by sisu to populate sqlite database
Depends: sisu, sqlite, libdbi-ruby, libdbm-ruby, libdbd-sqlite-ruby
Suggests: libdbd-sqlite }~ For changelogs see: @@ -132,7 +132,7 @@ _1 http://www.jus.uio.no/sisu/sisu_markup_samples_changelog/changelog_markup_sam The RPM is generated Alien~{ http://www.kitenet.net/programs/alien/ }~ from two deb packages (sisu and sisu-doc). Dependencies are not handled, not even that of the essential Ruby. -_* {~^ sisu-0.62.4-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-0.62.4-2.noarch.rpm ~{ untested, created using: alien -r sisu_0.62.4-1_all.deb }~ +_* {~^ sisu-0.63.0-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-0.63.0-2.noarch.rpm ~{ untested, created using: alien -r sisu_0.63.0-1_all.deb }~ _* {~^ sisu-markup-samples_1.0.8.orig-2.noarch.rpm }http://www.jus.uio.no/sisu/pkg/rpm/sisu-markup-samples_1.0.6.orig-2.noarch.rpm ~{
untested, created using alien }~ diff --git a/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_manual.ssm b/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_manual.ssm index e0c94c78..4bc8651e 100644 --- a/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_manual.ssm +++ b/data/doc/sisu/sisu_markup_samples/sisu_manual/sisu_manual.ssm @@ -18,9 +18,9 @@ @date.available: 2002-08-28 -@date.modified: 2007-11-03 +@date.modified: 2007-12-20 -@date: 2007-11-03 +@date: 2007-12-20 @level: new=C; break=1; num_top=1 diff --git a/lib/sisu/v0/hub.rb b/lib/sisu/v0/hub.rb index 418f096f..475d626a 100644 --- a/lib/sisu/v0/hub.rb +++ b/lib/sisu/v0/hub.rb @@ -62,40 +62,6 @@ module SiSU require "#{SiSU_lib}/sysenv" include SiSU_Screen @@pwd=Dir.pwd - class Remote_download - def initialize(requested_file) - @requested_file=requested_file - end - def pod - re_p_div=/http:\/\/([^\/]+)(\/\S+?)\/(sisupod(?:\.zip)?|[^\/]+?\.ssp)$/ - re_p=/(sisupod(?:\.zip)?|[^\/]+?\.ssp)$/ - if @requested_file =~ re_p_div - @site,@pth,@pod= re_p_div.match(@requested_file).captures - elsif @requested_file =~ re_p - @pod= re_p.match(@requested_file).captures - end - def site - @site - end - def path - @pth - end - def dir_stub - re_p_stub=/.+?([^\/]+)$/ - pod_stub= re_p_stub.match(path).captures.join if path - end - def name_source - @pod - end - def name - pod_download_as=if name_source=~/(?:sisupod\.(?:zip|ssp))/ - dir_stub + '.ssp' - else name_source - end - end - self - end - end class Op @@env=SiSU_Env::Info_env.new def initialize(opt,req,message) @@ -126,8 +92,9 @@ module SiSU if not @opt.files.empty? @opt.files.each do |fns| env=SiSU_Env::Info_env.new(fns) - if fns =~ /(?:sisupod(?:\.zip)?|\.ssp)$/ - pod_name=Remote_download.new(fns).pod.name + if fns =~ /sisupod(?:\.zip)?|\S+?(?:\.ss[mt]\.zip|\.ssp)$/ + require "#{SiSU_lib}/remote" #check + pod_name=SiSU_Remote::Remote_download.new(fns).pod.name tell=SiSU_Screen::Ansi.new(@opt.cmd,pod_name) tell.puts_blue unless @opt.cmd =~/q/ @opt.files.shift @@ -360,7 +327,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ path[:xsd]=path[:xml] + '/rnc' path[:xsd]=path[:xml] + '/rng' #path_dtd="#{@@env.path.output}/_sisu/xml/dtd" - re_p=/(sisupod(?:\.zip)?|[^\/]+?\.ssp)$/ + re_p=/(sisupod(?:\.zip)?|\S+?\.ss[mt]\.zip|[^\/]+?\.ssp)$/ unless @opt.files.join(',') =~ re_p #do not mix pods with source markup files in command line unless ( FileTest.directory?(path[:css]) \ and FileTest.directory?(path[:xsd]) ) @@ -409,8 +376,8 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ path_image='./_sisu/processing/external_document/image' path_skin='./_sisu/processing/external_document/skin/doc' @get_s,@get_p=[],[] - re_s=/((?:https?|file):\/\/\S+?\.sst)/ - re_p=/((?:https?|file):\/\/\S+?(?:\/sisupod(?:\.zip)?|\.ssp))/ + re_s=/((?:https?|file):\/\/\S+?\.sst)$/ + re_p=/((?:https?|file):\/\/\S+?(?:\/\S+?\.ss[mt]\.zip|sisupod(?:\.zip)?|\.ssp))/ @opt.files.each do |fns| if fns =~re_s @get_s << re_s.match(fns)[1] if re_s @@ -434,7 +401,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ retry unless @retry_count > 1 ensure end - @opt.files=@opt.files.collect {|x| x=x.gsub(/(?:https?|file):\/\/\S+\/(\S+)\.sst/,'\1.-sst') } + @opt.files=@opt.files.collect {|x| x=x.gsub(/(?:https?|file):\/\/\S+\/(\S+)\.sst$/,'\1.-sst') } end if @opt.cmd=~/m/ #% -m dal op('dal','dal') @@ -557,7 +524,7 @@ p "here #{__FILE__} #{__LINE__}" if @opt =~/M/ @opt.files.each do |fns| if FileTest.file?(fns) @opt.fns=fns - unless @opt.fns =~ /(?:\.(?:(?:-|ssm\.)?sst|ssm|ssp|sx[sdn]\.xml|termsheet.rb)|sisupod(?:\.zip)?)$/ + unless @opt.fns =~ /(?:\.(?:(?:-|ssm\.)?sst|ssm|ssp|sx[sdn]\.xml|termsheet.rb)|\S+?\.ss[mt]\.zip|sisupod(?:\.zip)?|\S+?\.ssp)$/ if @opt.fns=~/\.kdi$/ \ and @opt.mod.inspect =~/--(?:convert(?:-from)?|from)[=-]kdi/ elsif @opt.fns=~/\.sx[sdn]\.xml$/ \ diff --git a/lib/sisu/v0/options.rb b/lib/sisu/v0/options.rb index d2fa3c73..2332cebb 100644 --- a/lib/sisu/v0/options.rb +++ b/lib/sisu/v0/options.rb @@ -106,7 +106,7 @@ module SiSU_commandline end if x =~/^--\S+/; m << x end - elsif x =~ /(?:\.(?:(?:-|ssm\.)?sst(?:\.xml)?|ssm|ssi|sx[sdn]\.xml|s[1-3]|kdi|ssp)|sisupod(?:\.zip)?)$/ + elsif x =~ /(?:\.(?:(?:-|ssm\.)?sst(?:\.xml)?|ssm|ssi|sx[sdn]\.xml|s[1-3]|kdi|ssp)|\S+?\.ss[mt]\.zip|sisupod(\.zip)?)$/ if x =~/^(?:https?|file):\/\/\S+/; f << x elsif FileTest.file?(x); f << x else puts "file not found: #{x}" diff --git a/lib/sisu/v0/remote.rb b/lib/sisu/v0/remote.rb index aa7799ad..4197d62d 100644 --- a/lib/sisu/v0/remote.rb +++ b/lib/sisu/v0/remote.rb @@ -165,9 +165,10 @@ module SiSU_Remote threads.each {|thr| thr.join} if threads #and threads.length > 0 end def sisupod - if @get_p.length > 0 #% remote sisupod + get_p=@get_s + if get_p.length > 0 #% remote sisupod require 'net/http' - for requested_pod in @get_p + for requested_pod in get_p pod_info=Remote_download.new(requested_pod) @opt.fns=pod_info.pod.name Net::HTTP.start(pod_info.pod.site) do |http| @@ -180,5 +181,36 @@ module SiSU_Remote end end end + class Remote_download + def initialize(requested_file) + @requested_file=requested_file + end + def pod + re_p_div=/http:\/\/([^\/]+)(\/\S+)\/(sisupod(?:\.zip)?|\S+?(?:\.ss[mt]\.zip)?|[^\/]+?\.ssp)$/ + re_p=/(sisupod(?:\.zip)?|\S+?\.ss[mt](?:\.zip)?|[^\/]+?\.ssp)$/ + if @requested_file =~ re_p_div + @site,@pth,@pod= re_p_div.match(@requested_file).captures + elsif @requested_file =~ re_p + @pod= re_p.match(@requested_file).captures + end + def site + @site + end + def path + @pth + end + def dir_stub + re_p_stub=/.+?([^\/]+)$/ + pod_stub= re_p_stub.match(path).captures.join if path + end + def name_source + @pod + end + def name + name_source + end + self + end + end end __END__ diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb index a78bec85..fa6be6cb 100644 --- a/lib/sisu/v0/sysenv.rb +++ b/lib/sisu/v0/sysenv.rb @@ -375,15 +375,19 @@ module SiSU_Env @@fnb ||=@fns[m,2] @@fnt ||=@fns[m,3] @@flv ||=document_language_versions_found[:f] - @@fnz ||=if @@fns =~/(?:\~\S{2,3})?\.(?:ssm\.sst|ssm)$/; @@fnb + '.ssm.zip' - else @@fnb + '.sst.zip' + unless @@fns =~/\S+?\.zip/ + @@fnz ||=if @@fns =~/(?:\~\S{2,3})?\.(?:ssm\.sst|ssm)$/; @@fnb + '.ssm.zip' + else @@fnb + '.sst.zip' + end end else m=/(.+?)\.((?:-|ssm\.)?sst|ssm)$/ @@fnb ||=@fns[m,1] @@fnm ||=@fns[m,1] @@fnt ||=@fns[m,2] - @@fnz ||=if @@fns =~/(?:\~\S{2,3})?\.(?:ssm\.sst|ssm)$/; @@fnb + '.ssm.zip' - else @@fnb + '.sst.zip' + unless @@fns =~/\S+?\.zip/ + @@fnz ||=if @@fns =~/(?:\~\S{2,3})?\.(?:ssm\.sst|ssm)$/; @@fnb + '.ssm.zip' + else @@fnb + '.sst.zip' + end end end end @@ -786,7 +790,7 @@ module SiSU_Env @@image_flag,@@local_image=true,true #warning on @@image_flag @@fb=@@man_path=nil,nil def initialize(fns='',md=nil) - super() #you may not want to re-execute this tatic info so frequently! + super() #you may not want to re-execute this static info so frequently! @fns,@md=fns,md @env=Env_call.new(fns) if fns fnb=if @md \ @@ -2179,7 +2183,6 @@ WOK @env=SiSU_Env::Info_env.new end def zap -p @zap if @zap !~/\/\//; rm_rf(@zap) if FileTest.directory?(@zap) else puts 'suspect zap request, ignored' end -- cgit v1.2.3