diff options
Diffstat (limited to 'Master/texmf-dist/scripts/epspdf/epspdftk.tcl')
-rwxr-xr-x | Master/texmf-dist/scripts/epspdf/epspdftk.tcl | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/Master/texmf-dist/scripts/epspdf/epspdftk.tcl b/Master/texmf-dist/scripts/epspdf/epspdftk.tcl index ac96d844be7..ff29eff893d 100755 --- a/Master/texmf-dist/scripts/epspdf/epspdftk.tcl +++ b/Master/texmf-dist/scripts/epspdf/epspdftk.tcl @@ -25,10 +25,12 @@ set classic_unix [expr {$::tcl_platform(platform) eq "unix" && \ # Get full path of epspdf.rb. It should be in the same directory as # either this script or of the starpack containing this script. +# For non-windows versions, epspdftk might be called via a symlink. # For the windows-only starpack, a ruby subset is included. # Otherwise, ruby should be on the searchpath. proc set_progs {} { + set scriptfile [file normalize [info script]] # starpack edition? set starred 0 if {$::tcl_platform(platform) eq "windows"} { @@ -39,13 +41,24 @@ proc set_progs {} { } } } + set syml 0 + if {$::tcl_platform(platform) eq "unix" && \ + ! [catch {file readlink [$scriptfile]}]} { + set syml 1 + } if {$starred} { - set eproot [file normalize \ - [regsub {([\\/])([^\\/]+)$} [info nameofexecutable] {}]] + set eproot [file dirname [file normalize [info nameofexecutable]]] set ::ruby [file normalize "$eproot/../rubysub/bin/ruby.exe"] } else { - set eproot [file normalize \ - [regsub {([\\/])([^\\/]+)$} [info script] {}]] + set eproot [file dirname $scriptfile] + if {$::tcl_platform(platform) eq "unix" && \ + ! [catch {file readlink $scriptfile}]} { + # evaluate readlink from symlink directory + set savedir [pwd] + cd $eproot + set eproot [file dirname [file normalize [file readlink $scriptfile]]] + cd $savedir + } set ::ruby "ruby" } set ::epspdf_rb [file join $eproot "epspdf.rb"] @@ -661,7 +674,7 @@ proc page_valid {w} { # end conversion options -pack [label .status] -side bottom -anchor w -fill x +pack [label .status -justify left] -side bottom -anchor w -fill x -expand 1 # main buttons @@ -758,7 +771,7 @@ proc saveDialog {} { lappend cmd $::gfile(path) lappend cmd $try # $cmd/run_epspdf never bombs, but returns 1 (success) or 0 (fail) - .status configure -text "Working..." + .status configure -text "Working..." -justify "left" foreach b {view open convert done} { .bottomf.$b configure -state disabled } |