From 8c67d466ead2096d713515c88fcee17c473ecde5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 19 Oct 2007 20:28:48 +0100 Subject: mostly paths for shared markup source (txt and pod), also... also current Debian/Sid ruby1.9 upgrade removes a bug, so a related test/warning in options.rb removed --- CHANGELOG | 45 +++++++++++++++++++++++------------- lib/sisu/v0/dal.rb | 16 +++++++------ lib/sisu/v0/embedded.rb | 45 ------------------------------------ lib/sisu/v0/help.rb | 2 +- lib/sisu/v0/manifest.rb | 26 ++++++++++++++------- lib/sisu/v0/options.rb | 9 +------- lib/sisu/v0/sisupod_make.rb | 6 ++--- lib/sisu/v0/sysenv.rb | 55 +++++++++++++++++++++++++++++++------------- lib/sisu/v0/texpdf_format.rb | 6 ++--- lib/sisu/v0/urls.rb | 12 +++++++--- 10 files changed, 112 insertions(+), 110 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index aa90dcdf..8cbe7540 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,17 +15,21 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.0.orig.tar.gz sisu_0.62.0-1.dsc sisu_0.62.0-1.diff.gz - [NOTE/WARNING: some directories moved, as overwrites are not automatic, will - need manual adjustment of output locations (moving of a couple of - directories, and possible creation of another) for images and shared source - markup if any, see notes below (on directory shunting)] + [NOTE/WARNING: some directories moved, for existing sites will need manual + adjustment of output locations, (moving of a couple of image directories, and + if sharing text source the creation of shared source directories src and + pod), see notes below (on directory shunting)] * directory shunting ... [some resulting re-setting/configuration up necessary] - * markup source directory (src), all shared markup source placed in a - common directory (instead of being in output files generated - sub-directory) [NOTE: New src directory for shared markup source output - required at [output path]/src ] + + * markup source and source pod directory (src and pod), all shared markup + source placed in common directories src for text source, and pod for + binary (instead of being in output files generated sub-directory) [NOTE: + New src and new pod directory for shared markup source output required at + [output path]/src and [output path]/pod ] [if nothing else makes repo of + online submissions easier] + * images, output images used by html moved, now in image directory instead of image_local; system images moved from image to image_sys (to make sure they are always available, i.e. not written over (by subsequent images @@ -34,6 +38,11 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.0.orig.tar.gz path]/_sisu/image_local is moved to [output path]/_sisu/image (and old _sisu/image is now _sisu/image_sys) ] + * pwd directory stub name exception, regexs in sysenv and elsewhere, when + determining the pwd stub, take stub from parent of a directory named src + (todo with directory shunting, and placing of output source markup files + where shared in a directory named src) + * remote, (put, get) placed in single file (consider separating later) * conf, remote, work on rsync building of basic remote site structure @@ -60,21 +69,25 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.62.0.orig.tar.gz * conditionals rearranged, (scope for breakage) - * debian/control, added depends on rsync, used extensively (now also - internally) - - * fictionbook, (-f) first pass at output, develop or drop? - fictionbook is interesting, links: + * fictionbook, (-f) first pass at output, look into further and develop or + drop? fictionbook is interesting, links: http://www.fictionbook.org/index.php/Eng:FictionBook http://www.fictionbook.org/index.php/Eng:FictionBook_description http://en.wikipedia.org/wiki/FictionBook - * NOTE: there appears to be a bug with String.strip in ruby 1.9.0 (2007-09-10 - patchlevel 0) [i486-linux] ? [behaviour (current in Debian Sid) noted in - 2007-09-18:38/2, confirmed again in irb1.9 today] (else is with my setup!) + * debian/control added depends on rsync, used extensively (now also + internally) + + NOTE: fixed today in Debian Sid, bug with String.strip in ruby 1.9.0 + (2007-09-10 patchlevel 0) [i486-linux] ? [behaviour noted in + 2007-09-18:38/2, existed till 2007-10-18:42/5]: ' apples, oranges'.strip #==> "apples," # expected "apples, oranges" ' apples, oranges '.strip #does as expected + ruby 1.9, for present time retain restriction on running and testing sisu + with ruby 1.9, there are still issues with 1.9 (at the C stack level, and + probably some in sisu compatibility/updating as well) + %% sisu_0.61.0.orig.tar.gz (2007-10-12:41/5) http://www.jus.uio.no/sisu/pkg/src/sisu_0.61.0.orig.tar.gz 3a2329726d49945247b1f4340482c895 1474630 sisu_0.61.0.orig.tar.gz diff --git a/lib/sisu/v0/dal.rb b/lib/sisu/v0/dal.rb index 0b445832..47d3750d 100644 --- a/lib/sisu/v0/dal.rb +++ b/lib/sisu/v0/dal.rb @@ -364,15 +364,14 @@ module SiSU_DAL if para !~/^%+\s/ and para =~/\{(?:~\^\s+)?(.+?)\s\[(?:\d(?:[sS]*))\]\}(?:\.\.\/\S+?\/|\S+?\.ss[tm]\b)/ txt,cmd,source,url_dir,note,manifest=nil,nil,nil,nil,nil,nil - url_and_stub=SiSU_Env::Info_env.new.url - if defined? url_and_stub.remote - @output_url="#{url_and_stub.remote}" + @u=SiSU_Env::Info_env.new.url + if defined? @u.remote if para =~/(.+?)\{(.+?)\s\[(\d[sS]*)\]\}((\S+?)\.ss[tm]\b)(.*)/m pre,txt,cmd,source,url_dir,note="#{$1.strip} ",$2,$3,$4,$5,$6 elsif para =~/\{(.+?)\s\[(\d[sS]*)\]\}((\S+?)\.ss[tm]\b)(.*)/ pre,txt,cmd,source,url_dir,note='',$1,$2,$3,$4,$5 end - manifest="#{pre}{#{txt} }#@output_url/#{url_dir}/toc.html#{note}\n\n" + manifest="#{pre}{#{txt} }#{@u.remote}/#{url_dir}/toc.html#{note}\n\n" else puts "error, does currently support relative paths (reltive paths were removed, as had problems for citation, and was not suited to all output types should possibly reconsider) #{__FILE__} #{__LINE__}" if para =~/\{(?:~\^\s+)?(.+?)\s\[(\d[sS]*)\]\}\.\.\/(\S+?)\/(\s+~\{.+?\}~)?/ @@ -402,20 +401,23 @@ module SiSU_DAL end if describe tuned_file_tmp << if @output_url #to double space <:br> at beginning of entry - "     {#{describe} }#@output_url/#{url_dir}/#{o_f}" if describe + "     {#{describe} }#{@u.remote}/#{url_dir}/#{o_f}" else "     { #{describe} }../#{url_dir}/#{o_f}" end end end output_filetypes[:src].each do |o_f| - describe = case o_f + describe=case o_f when /#{source}\.zip/; ' markup source (zipped) pod' when /#{source}/; ' markup source text' else nil end if describe tuned_file_tmp << if @output_url - "     {#{describe} }#@output_url/src/#{o_f}" if describe + x=if describe =~/\.zip/ + "     {#{describe} }#{@u.src_pod}/#{o_f}" + else "     {#{describe} }#{@u.src_txt}/#{o_f}" + end else "     { #{describe} }../#{url_dir}/#{o_f}" end end diff --git a/lib/sisu/v0/embedded.rb b/lib/sisu/v0/embedded.rb index b5d33ac2..f03f0aab 100644 --- a/lib/sisu/v0/embedded.rb +++ b/lib/sisu/v0/embedded.rb @@ -133,48 +133,3 @@ module SiSU_Embedded end end __END__ -def images # alternative may be preferable as source taken from local destination, and not sent remotely unless found there - src="#{Dir.pwd}/_sisu/image" - ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image" - rdest="#@rhost/#{@env.path.stub_pwd}/_sisu/image" - if @md.cmd.inspect =~/[vVMR]/ and FileTest.directory?(src) - File.mkpath(ldest) unless FileTest.directory?(ldest) - @md.ec[:image].each do |i| - SiSU_Env::System_call.new("#{src}/#{i}","#{ldest}/.",'q').rsync - #cp("#{src}/#{i}","#{ldest}/.") #use rysnc - if @md.cmd.inspect =~/R/ #rsync to remote image directory #ldest used as source, if not in local repo, don't share - SiSU_Env::System_call.new("#{ldest}/#{i}","#{rdest}/.",'q').rsync - end - end - end -end -def audio - #p @md.ec[:audio] - src="#{Dir.pwd}/_sisu/mm/audio" - ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/mm/audio" - if @md.cmd.inspect =~/[vVMR]/ and FileTest.directory?(src) - File.mkpath(ldest) unless FileTest.directory?(ldest) - @md.ec[:audio].each do |i| - SiSU_Env::System_call.new("#{src}/#{i}","#{ldest}/.",'q').rsync - #cp("#{src}/#{i}","#{ldest}/.") #use rysnc - if @md.cmd.inspect =~/R/ - #rsync to remote audio directory - end - end - end -end -def multimedia - #p @md.ec[:multimedia] - src="#{Dir.pwd}/_sisu/mm/video" - ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/mm/video" - if @md.cmd.inspect =~/[vVMR]/ and FileTest.directory?(src) - File.mkpath(ldest) unless FileTest.directory?(ldest) - @md.ec[:multimedia].each do |i| - SiSU_Env::System_call.new("#{src}/#{i}","#{ldest}/.",'q').rsync - #cp("#{src}/#{i}","#{ldest}/.") #use rysnc - if @md.cmd.inspect =~/R/ - #rsync to remote multimedia directory - end - end - end -end diff --git a/lib/sisu/v0/help.rb b/lib/sisu/v0/help.rb index b5077fa1..84a7391d 100644 --- a/lib/sisu/v0/help.rb +++ b/lib/sisu/v0/help.rb @@ -67,7 +67,7 @@ module SiSU_Help fns='help_example_dummy_file_name.sst' @env=SiSU_Env::Info_env.new(fns) @db=SiSU_Env::Info_db.new - m=/.+\/(\S+)/m + m=/.+\/(?:src\/)?(\S+)/im # m=/.+?\/(?:src\/)?([^\/]+)$/im # m=/.+\/(\S+)/m @output_stub=Dir.pwd[m,1] end def help_request diff --git a/lib/sisu/v0/manifest.rb b/lib/sisu/v0/manifest.rb index e0617fec..891d6f41 100644 --- a/lib/sisu/v0/manifest.rb +++ b/lib/sisu/v0/manifest.rb @@ -91,11 +91,8 @@ module SiSU_Manifest @md,@fns=md @env=SiSU_Env::Info_env.new(@md.fns) @fnb=@md.fnb - out=@env.path.output - @base_url="#{@env.url.root}/#@fnb" - @base_url_src="#{@env.url.root}/src" - @base_path="#{out}/#@fnb" - @base_path_src="#{out}/src" + @base_url,@base_url_src,@base_url_pod="#{@env.url.root}/#@fnb","#{@env.url.src_txt}","#{@env.url.src_pod}" + @base_path,@base_path_src,@base_path_pod="#{@env.path.output}/#@fnb","#{@env.path.output_src}","#{@env.path.output_pod}" @@dg ||=SiSU_Env::Info_env.new.digest.type @dg=@@dg l=SiSU_Env::Standardise_language.new.file_to_language(@md.fns) @@ -129,6 +126,19 @@ module SiSU_Manifest @manifest[:html] << %{

#{id}

#{file}   #{dgst[1]}
#{@url_brace.xml_open}#@base_url_src/#{file}#{@url_brace.xml_close}

#{kb}

\n} if kb and kb =~/\d+/ end + def summarize_pod(id,file) + sys=SiSU_Env::System_call.new + dgst =if @dg =~/^sha(?:2|256)$/; sys.sha256("#{@base_path_pod}/#{file}") + else sys.md5("#{@base_path_pod}/#{file}") + end + tell=SiSU_Screen::Ansi.new(@md.cmd,"#{dgst[1]} #{file}") + tell.warn if @md.cmd =~/[vVM]/ + size=(File.size("#{@base_path_pod}/#{file}")/1024.00).to_s + kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1] + @manifest[:txt] << "#{file} #{id} #{kb}\n" + @manifest[:html] << %{

#{id}

#{file}   #{dgst[1]}
#{@url_brace.xml_open}#@base_url_pod/#{file}#{@url_brace.xml_close}

#{kb}

+ \n} if kb and kb =~/\d+/ + end def languages(id,file) flv=@env.published_manifests?(@base_path) @manifest[:html] << %{