From 75d9ef8375b0b67d2c9d2783975d8f06d4bebcc7 Mon Sep 17 00:00:00 2001
From: Ralph Amissah <ralph@amissah.com>
Date: Sun, 14 Oct 2007 21:35:56 +0100
Subject: default image directories moved, more convenient/logical [test]

---
 CHANGELOG                 |  2 +-
 lib/sisu/v0/defaults.rb   | 61 +++++++++++++++++++++++++----------------------
 lib/sisu/v0/embedded.rb   |  8 +++----
 lib/sisu/v0/help.rb       |  4 ++--
 lib/sisu/v0/html_promo.rb |  2 +-
 lib/sisu/v0/remote.rb     |  2 +-
 lib/sisu/v0/sysenv.rb     | 20 ++++++++--------
 7 files changed, 51 insertions(+), 48 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 63717427..3e918121 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -15,7 +15,7 @@ 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
 
-  * directory shunting ...
+  * directory shunting ... [some resulting re-initialization necessary]
     * markup source directory (src), all shared markup source placed in a
       common directory [instead of being in output files generated
       sub-directory]
diff --git a/lib/sisu/v0/defaults.rb b/lib/sisu/v0/defaults.rb
index 47fbeec8..46a55775 100644
--- a/lib/sisu/v0/defaults.rb
+++ b/lib/sisu/v0/defaults.rb
@@ -205,6 +205,9 @@ module SiSU_Viz
     def url_path_image #used for html image display
       '../_sisu/image'
     end
+    def url_path_image_sys #used for html image display
+      '../_sisu/image_sys'
+    end
     def url_path_ebook_dir
       './ebook'
     end
@@ -767,61 +770,61 @@ module SiSU_Viz
       png_site
     end
     def png_nav
-      %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_bluebell}" alt="Contents" />}
+      %{<img border="0" height="15" width="15" src="#{url_path_image_sys}/#{icon_bluebell}" alt="Contents" />}
     end
     def png_manifest
-      %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_manifest}" alt="Document Manifest" />}
+      %{<img border="0" height="15" width="15" src="#{url_path_image_sys}/#{icon_manifest}" alt="Document Manifest" />}
     end
     def png_doc
-      %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_doc}" alt="Full Text" />}
+      %{<img border="0" height="15" width="15" src="#{url_path_image_sys}/#{icon_doc}" alt="Full Text" />}
     end
     def png_toc
-      %{<img border="0" height="18" width="15" src="#{url_path_image}/#{icon_toc}" alt="TOC linked" />}
+      %{<img border="0" height="18" width="15" src="#{url_path_image_sys}/#{icon_toc}" alt="TOC linked" />}
     end
     def png_odf
-      %{<img border="0" height="18" width="18" src="#{url_path_image}/#{icon_odf}" alt="ODF/ODT" />}
+      %{<img border="0" height="18" width="18" src="#{url_path_image_sys}/#{icon_odf}" alt="ODF/ODT" />}
     end
     def png_pdf
-      %{<img border="0" height="18" width="15" src="#{url_path_image}/#{icon_pdf}" alt="PDF" />}
+      %{<img border="0" height="18" width="15" src="#{url_path_image_sys}/#{icon_pdf}" alt="PDF" />}
     end
     def png_pdf_portrait
-      %{<img border="0" height="18" width="15" src="#{url_path_image}/#{icon_pdf}" alt="PDF portrait" />}
+      %{<img border="0" height="18" width="15" src="#{url_path_image_sys}/#{icon_pdf}" alt="PDF portrait" />}
     end
     def png_pdf_landscape
-      %{<img border="0" height="15" width="18" src="#{url_path_image}/#{icon_pdf}" alt="PDF landscape" />}
+      %{<img border="0" height="15" width="18" src="#{url_path_image_sys}/#{icon_pdf}" alt="PDF landscape" />}
     end
     def png_wmp
-      %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_wmp}" alt="Concordance" />}
+      %{<img border="0" height="15" width="15" src="#{url_path_image_sys}/#{icon_wmp}" alt="Concordance" />}
     end
     def png_para
-      %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_para}" alt="Segment" />}
+      %{<img border="0" height="15" width="15" src="#{url_path_image_sys}/#{icon_para}" alt="Segment" />}
     end
     def png_status
-      %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_status}" alt="Membership status" />}
+      %{<img border="0" height="15" width="15" src="#{url_path_image_sys}/#{icon_status}" alt="Membership status" />}
     end
     def png_mark
-      %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_rose}" alt="*" />}
+      %{<img border="0" height="15" width="15" src="#{url_path_image_sys}/#{icon_rose}" alt="*" />}
     end
     def png_doc_tiny
-      %{<img border="0" height="8" width="8" src="#{url_path_image}/#{icon_doc}" alt="Doc" />}
+      %{<img border="0" height="8" width="8" src="#{url_path_image_sys}/#{icon_doc}" alt="Doc" />}
     end
     def png_toc_tiny
-      %{<img border="0" height="8" width="8" src="#{url_path_image}/#{icon_toc}" alt="TOC" />}
+      %{<img border="0" height="8" width="8" src="#{url_path_image_sys}/#{icon_toc}" alt="TOC" />}
     end
     def png_status_tiny
-      %{<img border="0" height="8" width="8" src="#{url_path_image}/#{icon_status}" alt="Status, Member States" />}
+      %{<img border="0" height="8" width="8" src="#{url_path_image_sys}/#{icon_status}" alt="Status, Member States" />}
     end
     def png_ftp
-      %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_ftp}" alt="FTP" />}
+      %{<img border="0" height="15" width="15" src="#{url_path_image_sys}/#{icon_ftp}" alt="FTP" />}
     end
     def png_gopher
-      %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_gopher}" alt="Gopher" />}
+      %{<img border="0" height="15" width="15" src="#{url_path_image_sys}/#{icon_gopher}" alt="Gopher" />}
     end
     def png_crosslink
-      %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_crosslink_toc}" alt="lateral hop" />}
+      %{<img border="0" height="15" width="15" src="#{url_path_image_sys}/#{icon_crosslink_toc}" alt="lateral hop" />}
     end
     def png_crosslink_ext
-      %{<img border="0" height="15" width="15" src="#{url_path_image}/#{icon_external_toc}" alt="lateral hop" />}
+      %{<img border="0" height="15" width="15" src="#{url_path_image_sys}/#{icon_external_toc}" alt="lateral hop" />}
     end
     def png_home
       dir=SiSU_Env::Info_env.new #(@fns)
@@ -832,21 +835,21 @@ module SiSU_Viz
       %{<img border="0" src="#{url_path_image_base}/#{icon_home_button}" alt="#{txt_home} --&gt;" />}
     end
     def png_book
-      %{<img border="2" height="15" width="15" src="#{url_path_image}/#{icon_book}" alt="Cameron May Books" />}
+      %{<img border="2" height="15" width="15" src="#{url_path_image_sys}/#{icon_book}" alt="Cameron May Books" />}
     end
     #% png_nav
     def png_nav_home
     end
     def png_nav_toc
-      %{<img border="0" width="22" height="22" src="#{url_path_image}/#{icon_up}" alt="TOC" />}
+      %{<img border="0" width="22" height="22" src="#{url_path_image_sys}/#{icon_up}" alt="TOC" />}
     end
     def png_nav_doc
     end
     def png_nav_previous
-      %{<img border="0" width="22" height="22" src="#{url_path_image}/#{icon_previous}" alt="&lt;&lt;&nbsp;previous" />}
+      %{<img border="0" width="22" height="22" src="#{url_path_image_sys}/#{icon_previous}" alt="&lt;&lt;&nbsp;previous" />}
     end
     def png_nav_next
-      %{<img border="0" width="22" height="22" src="#{url_path_image}/#{icon_next}" alt="next&nbsp;&gt;&gt;" />}
+      %{<img border="0" width="22" height="22" src="#{url_path_image_sys}/#{icon_next}" alt="next&nbsp;&gt;&gt;" />}
     end
     def png_nav_pre
       png_nav_previous
@@ -855,22 +858,22 @@ module SiSU_Viz
       png_nav_next
     end
     def png_nav_pdf
-      %{<img border="0" height="18" width="15" src="#{url_path_image}/#{icon_pdf}" alt="PDF" />}
+      %{<img border="0" height="18" width="15" src="#{url_path_image_sys}/#{icon_pdf}" alt="PDF" />}
     end
     def png_nav_pdf_portrait
-      %{<img border="0" width="15" height="18" src="#{url_path_image}/#{icon_pdf}" alt="pdf portrait" />}
+      %{<img border="0" width="15" height="18" src="#{url_path_image_sys}/#{icon_pdf}" alt="pdf portrait" />}
     end
     def png_nav_pdf_landscape
-      %{<img border="0" width="18" height="15" src="#{url_path_image}/#{icon_pdf}" alt="pdf landscape" />}
+      %{<img border="0" width="18" height="15" src="#{url_path_image_sys}/#{icon_pdf}" alt="pdf landscape" />}
     end
     def png_nav_dot_toc
-      %{<img border="0" width="100%" height="20" src="#{url_path_image}/#{icon_dot}" alt="&#094;" />}
+      %{<img border="0" width="100%" height="20" src="#{url_path_image_sys}/#{icon_dot}" alt="&#094;" />}
     end
     def png_nav_dot_previous
-      %{<img border="0" width="100%" height="20" src="#{url_path_image}/#{icon_dot}" alt="&lt;" />}
+      %{<img border="0" width="100%" height="20" src="#{url_path_image_sys}/#{icon_dot}" alt="&lt;" />}
     end
     def png_nav_dot_next
-      %{<img border="0" width="100%" height="20" src="#{url_path_image}/#{icon_dot}" alt="&gt;" />}
+      %{<img border="0" width="100%" height="20" src="#{url_path_image_sys}/#{icon_dot}" alt="&gt;" />}
     end
     def png_nav_dot_pre
       png_nav_dot_previous
diff --git a/lib/sisu/v0/embedded.rb b/lib/sisu/v0/embedded.rb
index 11a5aa24..22835e8f 100644
--- a/lib/sisu/v0/embedded.rb
+++ b/lib/sisu/v0/embedded.rb
@@ -82,8 +82,8 @@ module SiSU_Embedded
     end
     def images
       src="#{Dir.pwd}/_sisu/image"
-      ldest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_local"
-      rdest="#@rhost/#{@env.path.stub_pwd}/_sisu/image_local"
+      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)
         src_ec="#{src}/" + @md.ec[:image].join(" #{src}/")
@@ -126,8 +126,8 @@ 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_local"
-  rdest="#@rhost/#{@env.path.stub_pwd}/_sisu/image_local"
+  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|
diff --git a/lib/sisu/v0/help.rb b/lib/sisu/v0/help.rb
index 5c568074..7c09da3c 100644
--- a/lib/sisu/v0/help.rb
+++ b/lib/sisu/v0/help.rb
@@ -867,7 +867,7 @@ If you have problems check permissions (and if in home directory ownership).
   images:
     source:                    #{@cX.blue}#{@env.path.image_source}#{@cX.off}
     latex source:              #{@cX.blue}#{@env.path.image_source_tex}#{@cX.off}
-    note images are also sourced from within your pwd - #{@cX.blue}#{Dir.pwd}/_sisu/sisu/image_local#{@cX.off} if it exists
+    note images are also sourced from within your pwd - #{@cX.blue}#{Dir.pwd}/_sisu/image#{@cX.off} if it exists
   #{@cX.grey}[ texinfo:                     #{@env.path.texinfo} - check duplication ]#{@cX.off}
 
  #{@cX.green}resource configuraton files#{@cX.off} to change the paths specified above, are searched for in the following order:
@@ -967,7 +967,7 @@ WOK
 
       images that the author wishes to include within documents,
       these should be placed in a sub-directory
-      within the current document markup directory called #{@cX.green}_sisu/sisu/image_local#{@cX.off}
+      within the current document markup directory called #{@cX.green}_sisu/image#{@cX.off}
 
       if an instruction is given to process a remote document which contains
       downloadable images, they are included in a sub-directory of the current
diff --git a/lib/sisu/v0/html_promo.rb b/lib/sisu/v0/html_promo.rb
index c4e18184..1fc8fb4d 100644
--- a/lib/sisu/v0/html_promo.rb
+++ b/lib/sisu/v0/html_promo.rb
@@ -188,7 +188,7 @@ module SiSU_HTML_promo
         end
       end
       def image
-        @prod['image'] ? %{<img border="0" src="../_sisu/image_local/#{@prod['image']}" /><br />} : ''
+        @prod['image'] ? %{<img border="0" src="../_sisu/image/#{@prod['image']}" /><br />} : ''
       end
       def url_link
         @url_=if @prod['url'] =~/http:/
diff --git a/lib/sisu/v0/remote.rb b/lib/sisu/v0/remote.rb
index b35f2396..7e0205b1 100644
--- a/lib/sisu/v0/remote.rb
+++ b/lib/sisu/v0/remote.rb
@@ -122,7 +122,7 @@ module SiSU_Remote
             raise "#{url} not found" unless f
             re_fnb=/((?:https?|file):\/\/[^\/ ]+?\/[^\/ ]+?)\/\S+?\/([^\/]+?)\.ss(t)/ #revisit and remove DO
             base_uri,fnb,instr=re_fnb.match(url)[1..3] if re_fnb
-            imagedir= base_uri + '/_sisu/image_local' #check on
+            imagedir= base_uri + '/_sisu/image' #check on
             doc_skin_dir = /((?:https?|file):\/\/\S+?)\/[^\/]+?\.sst$/.match(url).captures.join + '/_sisu/skin/doc'
             #"Got file, and ready to process: #{fnb}.t#{instr}"
             downloaded_file=File.new("#{fnb}.-sst",'w+')
diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb
index 1c684052..4252529d 100644
--- a/lib/sisu/v0/sysenv.rb
+++ b/lib/sisu/v0/sysenv.rb
@@ -1543,11 +1543,11 @@ WOK
             require 'ftools'
             images=Dir.glob("#{defaults[:image_local]}/*.{png,jpg,gif}")
             pth="#{path.webserv}/#@stub_pwd"
-            File.mkpath("#{pth}/_sisu/image_local") unless FileTest.directory?("#{pth}/_sisu/image_local")
+            File.mkpath("#{pth}/_sisu/image") unless FileTest.directory?("#{pth}/_sisu/image")
             images.each { |i| File.install(i,"#{pth}/#{i}") } unless images.length > 0
             @@image_flag=false
           end
-          '../_sisu/image_local'
+          '../_sisu/image'
         else
           if @@local_image==true
             cmd=if @cmd; @cmd
@@ -2112,14 +2112,14 @@ WOK
       remote="#{remote_host_base}/#{@env.path.stub_pwd}/."
       if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/
         puts "begin scp_base_all: #{local} -> #{remote}"
+        System_call.new("#{local}/_sisu/image_sys/",remote).scp
         System_call.new("#{local}/_sisu/image/",remote).scp
-        System_call.new("#{local}/_sisu/image_local/",remote).scp
         System_call.new("#{local}/#{@env.path.style}/",remote).scp
       elsif @opt.cmd =~/U/
         puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
         puts "scp_base_all: #{local} -> #{remote}"
+        puts "#{local}/_sisu/image_sys/ -> #{remote}"
         puts "#{local}/_sisu/image/ -> #{remote}"
-        puts "#{local}/_sisu/image_local/ -> #{remote}"
         puts "#{local}/#{@env.path.style}/ -> #{remote}"
       else  puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
       end
@@ -2135,8 +2135,8 @@ WOK
       elsif @opt.cmd =~/U/
         puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
         puts "rsync_base: #{local} -> #{remote}"
+        puts "#{local}/_sisu/image_sys/ -> #{remote}"
         puts "#{local}/_sisu/image/ -> #{remote}"
-        puts "#{local}/_sisu/image_local/ -> #{remote}"
         puts "#{local}/#{@env.path.style}/ -> #{remote}"
       else  puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
       end
@@ -2146,14 +2146,14 @@ WOK
       remote="#{remote_host_base}/#{@env.path.stub_pwd}/."
       if defined? @rc['permission_set']['remote_base_site'] and @rc['permission_set']['remote_base_site'] and @@flag_remote==true and @opt.cmd !~/U/
         puts "begin rsync_base_sync: #{local} -> #{remote}"
+        System_call.new("#{local}/_sisu/image_sys/",remote).rsync('--delete-after')
         System_call.new("#{local}/_sisu/image/",remote).rsync('--delete-after')
-        System_call.new("#{local}/_sisu/image_local/",remote).rsync('--delete-after')
         System_call.new("#{local}/#{@env.path.style}/",remote).rsync('--delete-after')
       elsif @opt.cmd =~/U/
         puts "#{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
         puts "rsync_base_sync: #{local} -> #{remote}"
+        puts "#{local}/_sisu/image_sys/ -> #{remote}"
         puts "#{local}/_sisu/image/ -> #{remote}"
-        puts "#{local}/_sisu/image_local/ -> #{remote}"
         puts "#{local}/#{@env.path.style}/ -> #{remote}"
       else  puts "permission not granted #{__FILE__} #{__LINE__}" if @opt.cmd =~/M/
       end
@@ -2194,7 +2194,7 @@ WOK
     end
     def images
       File.mkpath("#{@env.path.output}/_sisu") unless FileTest.directory?("#{@env.path.output}/_sisu")
-      File.symlink("../../_sisu/image", "#{@env.path.output}/_sisu/image") unless File.exist?("#{@env.path.output}/_sisu/image") or File.symlink?("#{@env.path.output}/_sisu/image")
+      File.symlink("../../_sisu/image_sys", "#{@env.path.output}/_sisu/image_sys") unless File.exist?("#{@env.path.output}/_sisu/image_sys") or File.symlink?("#{@env.path.output}/_sisu/image_sys")
     end
     def man_forms
       #File.symlink("../../man/form", "#{@env.path.output}/man/form") unless File.symlink?("#{@env.path.output}/man/form") == true
@@ -2633,7 +2633,7 @@ WOK
     end
     def cp_local_images
       src="#@pwd/_sisu/image"
-      dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image_local"
+      dest="#{@env.path.webserv}/#{@env.path.stub_pwd}/_sisu/image"
       cp_images(src,dest)
     end
     def cp_external_images
@@ -2648,7 +2648,7 @@ WOK
     end
     def cp_base_images #fix images
       src="#{@env.path.share}/image"
-      dest="#{@env.path.webserv}/_sisu/image"
+      dest="#{@env.path.webserv}/_sisu/image_sys"
       cp_images(src,dest)
     end
     def cp_css
-- 
cgit v1.2.3