diff options
Diffstat (limited to 'Master/bin/i386-freebsd/texmfstart')
-rwxr-xr-x | Master/bin/i386-freebsd/texmfstart | 56 |
1 files changed, 40 insertions, 16 deletions
diff --git a/Master/bin/i386-freebsd/texmfstart b/Master/bin/i386-freebsd/texmfstart index a886b2aa142..4d1e2976145 100755 --- a/Master/bin/i386-freebsd/texmfstart +++ b/Master/bin/i386-freebsd/texmfstart @@ -425,7 +425,7 @@ class KpseFast @rootpath = '' @treepath = '' @progname = 'kpsewhich' - @engine = 'pdfetex' + @engine = 'pdftex' @variables = Hash.new @expansions = Hash.new @files = Hash.new @@ -1074,7 +1074,7 @@ end # puts k.expansion("$TEXMF") # puts k.expanded_path("TEXINPUTS","context") - # k.progname, k.engine, k.format = 'context', 'pdfetex', 'tfm' + # k.progname, k.engine, k.format = 'context', 'pdftex', 'tfm' # k.scandisk = false # == must_exist # k.expand_variables @@ -1429,7 +1429,7 @@ end $mswindows = Config::CONFIG['host_os'] =~ /mswin/ $separator = File::PATH_SEPARATOR -$version = "2.0.2" +$version = "2.0.3" $ownpath = File.dirname($0) if $mswindows then @@ -1520,7 +1520,7 @@ def set_applications(page=1) $applications['perl'] = $applications['pl'] = 'perl' $applications['ruby'] = $applications['rb'] = 'ruby' $applications['python'] = $applications['py'] = 'python' - $applications['lua'] = $applications['lua'] = 'lua' + $applications['lua'] = $applications['lua'] = 'luatex --luaonly' $applications['java'] = $applications['jar'] = 'java' if $mswindows then @@ -1804,14 +1804,16 @@ def changeddir?(path) if path.empty? then return true else + oldpath = File.expand_path(path) begin - Dir.chdir(path) if ! path.empty? + Dir.chdir(path) if not path.empty? rescue report("unable to change to directory: #{path}") else report("changed to directory: #{path}") end - return File.expand_path(Dir.getwd) == File.expand_path(path) + newpath = File.expand_path(Dir.getwd) + return oldpath == newpath end end @@ -1971,10 +1973,15 @@ def find(filename,program) end filename.sub!(/^.*[\\\/]/, '') # next we look at the current path and the callerpath - [ ['.','current'], - [$ownpath,'caller'], ["#{$ownpath}/../#{suffixlist[0]}",'caller'], - [registered("THREAD"),'thread'], ["#{registered("THREAD")}/../#{suffixlist[0]}",'thread'], - ].each do |p| + pathlist = [ ] + progpath = $applications[suffixlist[0]] + threadok = registered("THREAD") !~ /unknown/ + pathlist << ['.','current'] + pathlist << [$ownpath,'caller'] if $ownpath != '.' + pathlist << ["#{$ownpath}/../#{progpath}",'caller'] if progpath + pathlist << [registered("THREAD"),'thread'] if threadok + pathlist << ["#{registered("THREAD")}/../#{progpath}",'thread'] if progpath && threadok + pathlist.each do |p| if p && ! p.empty? && ! (p[0] == 'unknown') then suffixlist.each do |suffix| fname = "#{filename}.#{suffix}" @@ -2483,27 +2490,35 @@ def execute(arguments) if $selfmerge then output("ruby libraries are cleaned up") if SelfMerge::cleanup output("ruby libraries are merged") if SelfMerge::merge + return true elsif $selfcleanup then output("ruby libraries are cleaned up") if SelfMerge::cleanup + return true elsif $serve then if ENV['KPSEMETHOD'] && ENV['KPSEPORT'] then # # kpse_merge_done: require 'base/kpseremote' begin KpseRemote::start_server rescue + return false + else + return true end else usage puts("") puts("message : set 'KPSEMETHOD' and 'KPSEPORT' variables") + return false end elsif $help || ! $filename || $filename.empty? then usage loadtree($tree) loadenvironment($environment) show_environment() + return true elsif $batch && $filename && ! $filename.empty? then # todo, take commands from file and avoid multiple starts and checks + return false else report("texmfstart version #{$version}") loadtree($tree) @@ -2524,33 +2539,42 @@ def execute(arguments) make(filename,$mswindows,!$mswindows,$remove) end end + return true # guess elsif $browser && $filename =~ /^http\:\/\// then - launch($filename) + return launch($filename) else begin process do if $direct || $filename =~ /^bin\:/ then - direct($filename) + return direct($filename) elsif $edit && ! $editor.empty? then - edit($filename) + return edit($filename) else # script: or no prefix command = find(shortpathname($filename),$program) if command then register("THREAD",File.dirname(File.expand_path(command))) - run(command) + return run(command) else report('unable to locate program') + return false end end end rescue report('fatal error in starting process') + return false end end end end -execute(ARGV) +if execute(ARGV) then + report("\nexecution was successful") if $verbose + exit(0) +else + report("\nexecution failed") if $verbose + exit(1) +end -exit (if ($?.to_i rescue 0) > 0 then 1 else 0 end) +# exit (if ($?.to_i rescue 0) > 0 then 1 else 0 end) |