summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2012-09-25 23:14:49 +0100
committerNick White <git@njw.me.uk>2012-09-25 23:14:49 +0100
commit508b7b1123ea479caed7af68ffd9f90ffcc37281 (patch)
treeea2453507278fd7fc01dff421fde1e490e3ae877
parent0e5aa70532abf872179b173cbd2711ade0ccd13b (diff)
Stop using dirty and dangerous PATH hack
-rw-r--r--Makefile20
-rw-r--r--TODO1
-rwxr-xr-xgetxbookgui.tcl4
3 files changed, 13 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 51b25cb..b123b11 100644
--- a/Makefile
+++ b/Makefile
@@ -64,7 +64,8 @@ dist:
# needs config.mk set up to build statically
dist-static: $(BIN)
mkdir -p $(NAME)-$(VERSION)
- cp $(BIN) $(GUI) $(DOC) $(MAN) config.mk $(NAME)-$(VERSION)
+ sed '/^\tset cmd / i set cmdbin [file join ./ $$cmdbin]' < getxbookgui.tcl > $(NAME)-$(VERSION)/getxbookgui.tcl
+ cp $(BIN) $(DOC) $(MAN) config.mk $(NAME)-$(VERSION)
sed 's/^install: all$$/install:/' < Makefile > $(NAME)-$(VERSION)/Makefile
mkdir -p $(NAME)-$(VERSION)/icons
cp icons/* $(NAME)-$(VERSION)/icons/
@@ -76,14 +77,15 @@ dist-static: $(BIN)
echo $(NAME)-$(VERSION)-static.tar.bz2 $(NAME)-$(VERSION)-static.tar.bz2.sig
getxbookgui.exe: getxbookgui.tcl
- @echo STARPACK $@
- @sed 's/\/icons/\/..\/icons/;s/set cmd "/set cmd "tools\//' < getxbookgui.tcl > getxbookgui-win.tcl
- @sdx qwrap getxbookgui-win.tcl getxbookgui
- @sdx unwrap getxbookgui.kit
- @cp -f getxbook.ico getxbookgui.vfs/tclkit.ico
- @echo 'FileDescription "Book downloader"' > getxbookgui.vfs/tclkit.inf
- @sdx wrap $@ -runtime $(W32TCLKIT)
- @rm -r getxbookgui-win.tcl getxbookgui.kit getxbookgui.vfs
+ echo STARPACK $@
+ sed 's/ icons/ .. icons/' < getxbookgui.tcl > getxbookgui-win.tcl
+ sed -i '/^\tset cmd / i set cmdbin [file join tools $$cmdbin]' getxbookgui-win.tcl
+ sdx qwrap getxbookgui-win.tcl getxbookgui
+ sdx unwrap getxbookgui.kit
+ cp -f getxbook.ico getxbookgui.vfs/tclkit.ico
+ echo 'FileDescription "Book downloader"' > getxbookgui.vfs/tclkit.inf
+ sdx wrap $@ -runtime $(W32TCLKIT)
+ rm -r getxbookgui-win.tcl getxbookgui.kit getxbookgui.vfs
# needs config.mk set up to use mingw
dist-win: $(BIN) $(GUI:.tcl=.exe)
diff --git a/TODO b/TODO
index c1a57b2..2eb2e66 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,3 @@
-use a better method than setting PATH in gui
release 1.1
create debian package & post to mentors list
check whether windows build will still run the tools successfully if run from a shortcut elsewhere
diff --git a/getxbookgui.tcl b/getxbookgui.tcl
index eb3c863..2cc9b96 100755
--- a/getxbookgui.tcl
+++ b/getxbookgui.tcl
@@ -12,7 +12,6 @@ set cmdselected 0
set dling 0
set manual 0
-set env(PATH) "[file dirname $::argv0]:$env(PATH)"
set iconpath [file join [file dirname $::argv0] icons]
proc updateStatus {chan} {
@@ -46,7 +45,8 @@ proc go {} {
if { [.input.id get] == "" } {
return
}
- set cmd "[lindex [lindex $cmds $cmdselected] 0] [.input.id get]"
+ set cmdbin [lindex [lindex $cmds $cmdselected] 0]
+ set cmd "$cmdbin [.input.id get]"
set dling 1
.dl configure -state disabled -text "Downloading"
.input.id configure -state readonly