summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/epspdf/epspdftk.tcl
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2010-12-25 21:28:43 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2010-12-25 21:28:43 +0000
commit36e0a60868a91490c3a5ab331cf1ce5fd93c8039 (patch)
tree88f540a92abc756dc8430708d25b7e0b13550b17 /Master/texmf-dist/scripts/epspdf/epspdftk.tcl
parenta291253eb0a578cb1f6c6342a7c26f779baad7af (diff)
Unix wrapper scripts eliminated
git-svn-id: svn://tug.org/texlive/trunk@20860 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/epspdf/epspdftk.tcl')
-rwxr-xr-xMaster/texmf-dist/scripts/epspdf/epspdftk.tcl25
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
}