gitk: Check that we are running on at least Tcl/Tk 8.4
This checks that we have Tcl/Tk 8.4 or later, and puts up an error message in a window and quits if not. This was prompted by a patch submitted by Steffen Prohaska, but is done a bit differently (this uses package require rather than looking at [info tclversion], and uses show_error to display the error rather than printing it to stderr). Signed-off-by: Paul Mackerras <paulus@samba.org>
Paul Mackerras committed
Oct 20, 2007 at 21:21 UTC
5d7589d4c43e941563dfa2d096e6d6c184191702
1 file changed
+7
gitk
+7
@@ -7838,6 +7838,13 @@ proc tcl_encoding {enc} {
7838
return {}
7839
}
7840
7841
+# First check that Tcl/Tk is recent enough
7842
+if {[catch {package require Tk 8.4} err]} {
7843
+ show_error {} . "Sorry, gitk cannot run with this version of Tcl/Tk.\n\
7844
+ Gitk requires at least Tcl/Tk 8.4."
7845
+ exit 1
7846
+}
7847
+
7848
# defaults...
7849
set datemode 0
7850
set diffopts "-U 5 -p"