From 58041f0603b2a6b523db4aa70744c9570695de8f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 5 Feb 2014 00:33:23 -0500 Subject: v5 v6: epub, odt, check availability of zip program --- lib/sisu/v5/sysenv.rb | 8 ++++++++ lib/sisu/v5/xhtml_epub2.rb | 5 ++++- lib/sisu/v5/xml_odf_odt.rb | 5 ++++- lib/sisu/v6/sysenv.rb | 8 ++++++++ lib/sisu/v6/xhtml_epub2.rb | 5 ++++- lib/sisu/v6/xml_odf_odt.rb | 5 ++++- 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/sysenv.rb index 23e15244..60a6053a 100644 --- a/lib/sisu/v5/sysenv.rb +++ b/lib/sisu/v5/sysenv.rb @@ -764,6 +764,14 @@ module SiSU_Env false end end + def zip #zip + program='zip' + program_ref="\n\t\tused to in the making of number of file formats, odf, epub" + if program_found?(program); true + else SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark("*WARN* #{program} is not installed #{program_ref}") + false + end + end def openssl #openssl for digests program='openssl' program_ref="\n\t\tused to generate requested source document identification digest" diff --git a/lib/sisu/v5/xhtml_epub2.rb b/lib/sisu/v5/xhtml_epub2.rb index 2073bb4b..40033101 100644 --- a/lib/sisu/v5/xhtml_epub2.rb +++ b/lib/sisu/v5/xhtml_epub2.rb @@ -748,7 +748,8 @@ module SiSU_XHTML_EPUB2 end def output_zip FileUtils::mkdir_p(@md.file.output_path.epub.dir) unless FileTest.directory?(@md.file.output_path.epub.dir) - if FileTest.directory?(@md.env.processing_path.epub) + if FileTest.directory?(@md.env.processing_path.epub) \ + and SiSU_Env::SystemCall.new.zip pwd=Dir.pwd Dir.chdir(@md.env.processing_path.epub) system(" @@ -759,6 +760,8 @@ module SiSU_XHTML_EPUB2 unless @md.opt.act[:maintenance][:set]==:on FileUtils::rm_r(@md.env.processing_path.epub) end + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark('*EXITED epub* zip program not found') unless SiSU_Env::SystemCall.new.zip end end def make_cover_image diff --git a/lib/sisu/v5/xml_odf_odt.rb b/lib/sisu/v5/xml_odf_odt.rb index 3cb2fbbf..8c3d4a98 100644 --- a/lib/sisu/v5/xml_odf_odt.rb +++ b/lib/sisu/v5/xml_odf_odt.rb @@ -809,7 +809,8 @@ WOK od.close opendoc=@md.file.base_filename.odt #watch where output by language FileUtils::mkdir_p(@md.file.output_path.odt.dir) unless FileTest.directory?(@md.file.output_path.odt.dir) - if FileTest.directory?(@env.processing_path.odt) + if FileTest.directory?(@env.processing_path.odt) \ + and SiSU_Env::SystemCall.new.zip pwd=Dir.pwd Dir.chdir(@env.processing_path.odt) system(" @@ -817,6 +818,8 @@ WOK ") FileUtils::mv(opendoc, @md.file.place_file.odt.dir) Dir.chdir(pwd) + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark('*EXITED odf* zip program not found') unless SiSU_Env::SystemCall.new.zip end end end diff --git a/lib/sisu/v6/sysenv.rb b/lib/sisu/v6/sysenv.rb index 7e81b2f4..8f40212b 100644 --- a/lib/sisu/v6/sysenv.rb +++ b/lib/sisu/v6/sysenv.rb @@ -764,6 +764,14 @@ module SiSU_Env false end end + def zip #zip + program='zip' + program_ref="\n\t\tused to in the making of number of file formats, odf, epub" + if program_found?(program); true + else SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark("*WARN* #{program} is not installed #{program_ref}") + false + end + end def openssl #openssl for digests program='openssl' program_ref="\n\t\tused to generate requested source document identification digest" diff --git a/lib/sisu/v6/xhtml_epub2.rb b/lib/sisu/v6/xhtml_epub2.rb index 1d4305ab..3164e575 100644 --- a/lib/sisu/v6/xhtml_epub2.rb +++ b/lib/sisu/v6/xhtml_epub2.rb @@ -748,7 +748,8 @@ module SiSU_XHTML_EPUB2 end def output_zip FileUtils::mkdir_p(@md.file.output_path.epub.dir) unless FileTest.directory?(@md.file.output_path.epub.dir) - if FileTest.directory?(@md.env.processing_path.epub) + if FileTest.directory?(@md.env.processing_path.epub) \ + and SiSU_Env::SystemCall.new.zip pwd=Dir.pwd Dir.chdir(@md.env.processing_path.epub) system(" @@ -759,6 +760,8 @@ module SiSU_XHTML_EPUB2 unless @md.opt.act[:maintenance][:set]==:on FileUtils::rm_r(@md.env.processing_path.epub) end + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark('*EXITED epub* zip program not found') unless SiSU_Env::SystemCall.new.zip end end def make_cover_image diff --git a/lib/sisu/v6/xml_odf_odt.rb b/lib/sisu/v6/xml_odf_odt.rb index b478805f..707e7a20 100644 --- a/lib/sisu/v6/xml_odf_odt.rb +++ b/lib/sisu/v6/xml_odf_odt.rb @@ -809,7 +809,8 @@ WOK od.close opendoc=@md.file.base_filename.odt #watch where output by language FileUtils::mkdir_p(@md.file.output_path.odt.dir) unless FileTest.directory?(@md.file.output_path.odt.dir) - if FileTest.directory?(@env.processing_path.odt) + if FileTest.directory?(@env.processing_path.odt) \ + and SiSU_Env::SystemCall.new.zip pwd=Dir.pwd Dir.chdir(@env.processing_path.odt) system(" @@ -817,6 +818,8 @@ WOK ") FileUtils::mv(opendoc, @md.file.place_file.odt.dir) Dir.chdir(pwd) + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark('*EXITED odf* zip program not found') unless SiSU_Env::SystemCall.new.zip end end end -- cgit v1.2.3