From 35e3bcae6aac45cdbcc1c7f63bbeb1870c171bff Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 3 Jun 2012 22:29:09 -0400 Subject: v3: images, copy (system link removed) --- data/doc/sisu/CHANGELOG_v3 | 1 + lib/sisu/v3/conf.rb | 1 - lib/sisu/v3/dal.rb | 1 - lib/sisu/v3/epub.rb | 5 +--- lib/sisu/v3/html.rb | 5 +--- lib/sisu/v3/shared_images.rb | 7 ++++-- lib/sisu/v3/sst_do_inline_footnotes.rb | 1 - lib/sisu/v3/sysenv.rb | 46 +++++++++++++--------------------- 8 files changed, 25 insertions(+), 42 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index c322e750..8ad2d4c3 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -24,6 +24,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.2.11.orig.tar.xz * v3: images, regular & sisupod * shared_images, --html, --xhtml, --xml* * sisupod images done: --html including skin images; --epub; --odf; --pdf + * copy (system link removed) * v3: manifest, paths, (for command line selection of output type) fix diff --git a/lib/sisu/v3/conf.rb b/lib/sisu/v3/conf.rb index 8a323ac4..8cd3e2ef 100644 --- a/lib/sisu/v3/conf.rb +++ b/lib/sisu/v3/conf.rb @@ -108,7 +108,6 @@ module SiSU_Initialize def cp_webserver_images SiSU_Screen::Ansi.new(@opt.cmd,'invert','Copy webserver/output file images','').colorize unless @opt.cmd =~/q/ SiSU_Env::CreateSite.new(@opt.cmd).cp_webserver_images - SiSU_Env::CreateSystemLink.new.images end def css SiSU_Screen::Ansi.new(@opt.cmd,'invert','Configuring CSSs','').colorize unless @opt.cmd =~/q/ diff --git a/lib/sisu/v3/dal.rb b/lib/sisu/v3/dal.rb index dd1ec494..24f29bd3 100644 --- a/lib/sisu/v3/dal.rb +++ b/lib/sisu/v3/dal.rb @@ -105,7 +105,6 @@ module SiSU_DAL @idx_xhtml=@make_fns.marshal.dal_idx_xhtml @map_nametags=@make_fns.marshal.dal_map_nametags @map_ocn_htmlseg=@make_fns.marshal.dal_map_ocn_htmlseg - SiSU_Env::CreateSystemLink.new.images @env=SiSU_Env::InfoEnv.new end def read #creates dal diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb index a2530cbb..06021574 100644 --- a/lib/sisu/v3/epub.rb +++ b/lib/sisu/v3/epub.rb @@ -133,10 +133,7 @@ module SiSU_EPUB @particulars=particulars @md,@env=particulars.md,particulars.env @vz=SiSU_Env::GetInit.instance.skin - @env,@css,@symlnk=particulars.env,SiSU_Style::CSS.new,SiSU_Env::CreateSystemLink.new #home - end - def link_images - @symlnk.images + @env,@css=particulars.env,SiSU_Style::CSS.new end def directories title=File.basename(@md.fns,'.rb') diff --git a/lib/sisu/v3/html.rb b/lib/sisu/v3/html.rb index 46f051c6..a5c1edb1 100644 --- a/lib/sisu/v3/html.rb +++ b/lib/sisu/v3/html.rb @@ -139,10 +139,7 @@ module SiSU_HTML @particulars=particulars @md,@env=particulars.md,particulars.env @vz=SiSU_Env::GetInit.instance.skin - @env,@css,@symlnk=particulars.env,SiSU_Style::CSS.new,SiSU_Env::CreateSystemLink.new #home - end - def link_images - @symlnk.images + @env,@css=particulars.env,SiSU_Style::CSS.new end def tuned_file_instructions @tell=SiSU_Screen::Ansi.new(@md.opt.cmd) diff --git a/lib/sisu/v3/shared_images.rb b/lib/sisu/v3/shared_images.rb index a5a412b8..03093c6a 100644 --- a/lib/sisu/v3/shared_images.rb +++ b/lib/sisu/v3/shared_images.rb @@ -85,8 +85,11 @@ module SiSU_Images unless images images=Dir.glob("*.{png,jpg,gif,ico}") end - FileUtils::mkdir_p(dest_path) unless FileTest.directory?(dest_path) - FileUtils::chmod(0755,dest_path) + unless FileTest.directory?(dest_path) \ + or FileTest.symlink?(dest_path) + FileUtils::mkdir_p(dest_path) + FileUtils::chmod(0755,dest_path) + end if images.length > 0 images.each do |i| if FileTest.file?(i) diff --git a/lib/sisu/v3/sst_do_inline_footnotes.rb b/lib/sisu/v3/sst_do_inline_footnotes.rb index ab9fbbce..4ceb54fa 100644 --- a/lib/sisu/v3/sst_do_inline_footnotes.rb +++ b/lib/sisu/v3/sst_do_inline_footnotes.rb @@ -85,7 +85,6 @@ module SiSU_ConvertFootnotes @@fns||@opt.fns @my_make=SiSU_Env::CreateFile.new(@opt.fns) @fnm=SiSU_Env::InfoFile.new(@opt.fns).marshal.dal_content - SiSU_Env::CreateSystemLink.new.images end def read #creates dal begin diff --git a/lib/sisu/v3/sysenv.rb b/lib/sisu/v3/sysenv.rb index f57185fc..b8dd37b0 100644 --- a/lib/sisu/v3/sysenv.rb +++ b/lib/sisu/v3/sysenv.rb @@ -3404,28 +3404,6 @@ WOK %x{ruby -v}.strip end end - class CreateSystemLink #revisit problems created 2004w41 - require 'fileutils' - include FileUtils::Verbose - def initialize - @env=SiSU_Env::InfoEnv.new - end - def images - unless FileTest.directory?("#{@env.path.output}/_sisu") - FileUtils::mkdir_p("#{@env.path.output}/_sisu") - end - unless File.exist?("#{@env.path.output}/_sisu/image_sys") \ - or File.symlink?("#{@env.path.output}/_sisu/image_sys") - File.symlink("../../_sisu/image_sys", "#{@env.path.output}/_sisu/image_sys") - end - end - def man_forms - #File.symlink("../../man/form", "#{@env.path.output}/man/form") unless File.symlink?("#{@env.path.output}/man/form")==true - end - def man_pdf - #File.symlink("../../man/form", "#{@env.path.output}/man/pdf") unless File.symlink?("#{@env.path.output}/man/pdf")==true - end - end class InfoFile