summaryrefslogtreecommitdiff
path: root/lang/tcltutor/patches/patch-TclTutor.tcl
diff options
context:
space:
mode:
authorkamil <kamil@pkgsrc.org>2019-10-07 14:37:34 +0000
committerkamil <kamil@pkgsrc.org>2019-10-07 14:37:34 +0000
commit4bdb7d53a43f3abc65b78bde997793f8022b2432 (patch)
tree92e8cd8e18a83e3ce97efeda459796e9a6cf2290 /lang/tcltutor/patches/patch-TclTutor.tcl
parenta4c49dcc7666fcbe37af043092b0fe06c2f2f964 (diff)
downloadpkgsrc-4bdb7d53a43f3abc65b78bde997793f8022b2432.tar.gz
lang/tcltutor: import tcltutor-30b7
This is a package designed to teach the Tcl programming language in a quick and easy manner. The goal is to teach the minimal amount of Tcl syntax, commands and options that are necessary to write useful programs. You are encouraged to use the man pages and books to augment this tutorial.
Diffstat (limited to 'lang/tcltutor/patches/patch-TclTutor.tcl')
-rw-r--r--lang/tcltutor/patches/patch-TclTutor.tcl82
1 files changed, 82 insertions, 0 deletions
diff --git a/lang/tcltutor/patches/patch-TclTutor.tcl b/lang/tcltutor/patches/patch-TclTutor.tcl
new file mode 100644
index 00000000000..d3d0ce1915f
--- /dev/null
+++ b/lang/tcltutor/patches/patch-TclTutor.tcl
@@ -0,0 +1,82 @@
+$NetBSD: patch-TclTutor.tcl,v 1.1 2019/10/07 14:37:34 kamil Exp $
+
+- fix shebang
+- disable logUsage+mailLog
+- overwrite data dir
+
+--- TclTutor.tcl.orig 2014-03-20 14:27:20.000000000 +0000
++++ TclTutor.tcl
+@@ -1,8 +1,8 @@
+-package provide app-tcltutor 1.0
+ #!/bin/sh
+ # \
+ exec wish "$0" "$@"
+
++package provide app-tcltutor 1.0
+ package require Tk
+
+ ;# NAME: TclTutor.tcl
+@@ -139,8 +139,8 @@ proc parseArgs {stateVar {throwError 1}}
+
+ switch $tcl_platform(platform) {
+ "unix" {
+- set Tutor(sourceHome) [file dirname $argv0]
+- set Tutor(lessonHome) [file dirname $argv0]/lesson
++ set Tutor(sourceHome) @TCLTUTOR_LIBDATADIR@
++ set Tutor(lessonHome) @TCLTUTOR_LIBDATADIR@/lesson
+ set Tutor(rcHome) $env(HOME)
+ set Tutor(rcfile) [file join $Tutor(rcHome) .tcltutorrc]
+ set Tutor(logFileName) [file join $Tutor(rcHome) .tcltutoract]
+@@ -160,8 +160,8 @@ proc parseArgs {stateVar {throwError 1}}
+ }
+ "macintosh" -
+ "mac" {
+- set Tutor(sourceHome) [file dirname $argv0]
+- set Tutor(lessonHome) [file dirname $argv0]/lesson
++ set Tutor(sourceHome) @TCLTUTOR_LIBDATADIR@
++ set Tutor(lessonHome) @TCLTUTOR_LIBDATADIR@/lesson
+ set Tutor(rcHome) [file dirname $argv0]
+ set Tutor(rcfile) [file join $Tutor(rcHome) tcltutor.rc]
+ set Tutor(logFileName) [file join $Tutor(rcHome) tcltutor.act]
+@@ -174,7 +174,7 @@ proc parseArgs {stateVar {throwError 1}}
+ }
+ }
+
+-set Tutor(noSaves) {sourceHome lessonHome}
++set Tutor(noSaves) {sourceHome lessonHome logUsage mailUsage}
+
+ #
+ # check if a Scripted Document
+@@ -694,7 +694,7 @@ proc createDisplay {} {
+ $mbf.file add command -label $l -command $l2
+ }
+
+- if {[string match $tcl_platform(platform) "unix"]} {
++ if {0 && [string match $tcl_platform(platform) "unix"]} {
+ if {$Tutor(logUsage)} {
+ $mbf.file add command -label "Disable activity log" -command {set Tutor(logUsage) 0}
+ } else {
+@@ -1153,6 +1153,8 @@ proc SetFontSize {} {
+ #
+ proc logUsage {str} {
+ global Tutor
++
++ return
+
+ if {$Tutor(logUsage) == 0} {return}
+
+@@ -1180,6 +1182,9 @@ proc logUsage {str} {
+ #
+ proc mailLog {} {
+ global Tutor tcl_platform
++
++ return
++
+ catch {close $Tutor(logFile)}
+
+ switch $tcl_platform(platform) {
+@@ -1388,4 +1393,3 @@ selectCourse [file join \
+ [format "%s.%s" $Tutor(courseName) cfg]]
+
+ applyOptions
+-