]> granicus.if.org Git - docbook-dsssl/commitdiff
Corrected bugs caused by path and file assumptions were not met
authorKeith Fahlgren <abdelazer@users.sourceforge.net>
Tue, 21 Jul 2009 01:17:35 +0000 (01:17 +0000)
committerKeith Fahlgren <abdelazer@users.sourceforge.net>
Tue, 21 Jul 2009 01:17:35 +0000 (01:17 +0000)
xsl/epub/bin/dbtoepub
xsl/epub/bin/lib/docbook.rb

index d864024e3912de043cc13c651749fa623d81c810..b9239d110be40a40794aabf10605918c4f8bc87f 100755 (executable)
@@ -20,6 +20,7 @@
 lib = File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
 $LOAD_PATH.unshift(lib) if File.exist?(lib)
 
+require 'fileutils'
 require 'optparse'
 require 'tmpdir'
 
@@ -60,6 +61,7 @@ end
 
 db_files.each {|docbook_file|
   dir = File.expand_path(File.join(Dir.tmpdir, ".epubtmp#{Time.now.to_f.to_s}"))
+  FileUtils.mkdir_p(dir)
   e = DocBook::Epub.new(docbook_file, dir, css_file, customization_layer, otf_files)
 
   if output_file
index 39627d0bd803b9389b75646f2d79ee7bd7dc38d2..2664999bb74f9a6ae27824c1443fac7cb8cb2a92 100755 (executable)
@@ -115,8 +115,8 @@ module DocBook
     # were XIncluded or added by ENTITY
     #   http://sourceforge.net/tracker/?func=detail&aid=2750442&group_id=21935&atid=373747
     def collapse_docbook
-      collapsed_file = File.join(File.dirname(@docbook_file),
-                                              '.collapsed.' + File.basename(@docbook_file))
+      collapsed_file = File.join(File.expand_path(File.dirname(@docbook_file)), 
+                                 '.collapsed.' + File.basename(@docbook_file))
       entity_collapse_command = "xmllint --loaddtd --noent -o '#{collapsed_file}' '#{@docbook_file}'"
       entity_success = system(entity_collapse_command)
       raise "Could not collapse named entites in #{@docbook_file}" unless entity_success