Check-in [9c59c70725]
Overview
Comment:Consolidated patch application process Added patches for tclreadline
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9c59c70725306b12380ba679be58b25bcd87dc76
User & Date: rkeene on 2011-07-06 10:32:12
Other Links: manifest | tags
Context
2011-07-06
11:21
Updated to include patches in src tree check-in: c578308a85 user: rkeene tags: trunk
10:32
Consolidated patch application process Added patches for tclreadline check-in: 9c59c70725 user: rkeene tags: trunk
09:45
Updated to include common.sh in src tarballs check-in: 05f4343e50 user: rkeene tags: trunk
Changes

Modified server/buildpkgs/common.sh from [0a6dc891a3] to [5c88931dca].

54
55
56
57
58
59
60













































61
62
63
64
65
66
function download_src () {
	if [ ! -f "${SRC}" -a -n "${SRC}" -a -n "${SRCURL}" ]; then
		mkdir -p "$(dirname "${SRC}")" >/dev/null 2>/dev/null

		download "${SRC}" "${SRCURL}" || exit 1
	fi
}














































WORKDIR="${TMPDIR:-/tmp}/tcl-buildpkgs-$$${RANDOM}${RANDOM}${RANDOM}"
PLATDIR="$(pwd)/out/${PLATFORM}"
export WORKDIR PLATDIR

setup_tcl84







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
function download_src () {
	if [ ! -f "${SRC}" -a -n "${SRC}" -a -n "${SRCURL}" ]; then
		mkdir -p "$(dirname "${SRC}")" >/dev/null 2>/dev/null

		download "${SRC}" "${SRCURL}" || exit 1
	fi
}

function extract_src () {
	rm -rf build
	mkdir build

	(
		cd build/ || exit 1

		gzip -dc "../${SRC}" | tar -xf -
		cd "${BUILDDIR}" || exit 1
	) || exit 1
}

function apply_patches () {
	local patchroot patchdir patchfiles patchfile idx

	patchroot="$(pwd)/patches"

	for patchdir in "${patchroot}/all" "${patchroot}/${VERS}"; do
		unset patchfiles

		if [ -f "${patchdir}/series" ]; then
			idx=0
			for patchfile in $(cat "${patchdir}/series"); do
				patchfiles[${idx}]="${patchdir}/${patchfile}"
				idx=$[${idx} + 1]
			done
		else
			patchfiles=("${patchdir}"/*.diff)
		fi

		for patchfile in "${patchfiles[@]}"; do
			if [ ! -f "${patchfile}" ]; then
				continue
			fi

			(
				cd "build/${BUILDDIR}" || exit 1

				echo "* Applying patch \"${patchfile}\""
				"${PATCH:-patch}" -p1 < "${patchfile}"
			)
		done
	done
}

WORKDIR="${TMPDIR:-/tmp}/tcl-buildpkgs-$$${RANDOM}${RANDOM}${RANDOM}"
PLATDIR="$(pwd)/out/${PLATFORM}"
export WORKDIR PLATDIR

setup_tcl84

Modified server/buildpkgs/tclreadline/build.sh from [dd5656fd18] to [82c95eff2e].

11
12
13
14
15
16
17






18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
source ../common.sh

# Do not build if the "tcl" platform has been requested
not_platforms 'tcl'

# Download source
download_src







# Build package
(
	rm -rf build
	mkdir -p "${PLATDIR}" >/dev/null 2>/dev/null
	mkdir build

	cd build/ || exit 1

	gzip -dc "../${SRC}" | tar -xf -
	cd "${BUILDDIR}" || exit 1

	# The configure script that comes with TclReadLine is out-of-date
	autoreconf -fvi

	# TclReadLine doesn't know it should use stubs, force it.
	CFLAGS="${CFLAGS} -DUSE_TCL_STUBS=1"
	CPPFLAGS="${CPPFLAGS} -DUSE_TCL_STUBS=1"
	LDFLAGS="${LDFLAGS} $(source "${TCLCONFIGDIR}/tclConfig.sh" 2>/dev/null; eval echo "${TCL_STUB_LIB_SPEC}")" 
	export CFLAGS CPPFLAGS LDFLAGS








>
>
>
>
>
>



<

<
<
<
<
<
|
<
<
<







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

27





28



29
30
31
32
33
34
35
source ../common.sh

# Do not build if the "tcl" platform has been requested
not_platforms 'tcl'

# Download source
download_src

# Extract source
extract_src

# Apply appropriate patches
apply_patches

# Build package
(

	mkdir -p "${PLATDIR}" >/dev/null 2>/dev/null





	cd "build/${BUILDDIR}" || exit 1




	# TclReadLine doesn't know it should use stubs, force it.
	CFLAGS="${CFLAGS} -DUSE_TCL_STUBS=1"
	CPPFLAGS="${CPPFLAGS} -DUSE_TCL_STUBS=1"
	LDFLAGS="${LDFLAGS} $(source "${TCLCONFIGDIR}/tclConfig.sh" 2>/dev/null; eval echo "${TCL_STUB_LIB_SPEC}")" 
	export CFLAGS CPPFLAGS LDFLAGS

Added server/buildpkgs/tclreadline/patches/2.1.0/autoreconf.diff version [8fd0124d8a].

more than 10,000 changes

Added server/buildpkgs/tclreadline/patches/2.1.0/complete_nontcl.diff version [0647275ef3].













































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Index: tclreadline/tclreadlineCompleter.tcl
=====================================================================
--- tclreadline.orig/tclreadlineCompleter.tcl
+++ tclreadline/tclreadlineCompleter.tcl
@@ -625,7 +625,7 @@
 			}
 		}
 	}
-	if {![catch [list set type [image type ${cmd}]]]} {
+	if {![catch {list set type [image type ${cmd}]}]} {
 		switch -- ${type} {
 			photo {
 				set result [PhotoObj ${text} ${start} ${end} ${line} ${pos}]
@@ -1460,7 +1460,7 @@
 			# this can raise an error, if alias is
 			# no valid command.
 			#
-			if {[catch [list set alias [namespace origin $alias]]]} {
+			if {[catch {set alias [namespace origin $alias]}]} {
 				return ""
 			}
 

Added server/buildpkgs/tclreadline/patches/2.1.0/completion_matches.diff version [07a20f0688].



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
Index: tclreadline/tclreadline.c
=====================================================================
--- tclreadline.orig/tclreadline.c
+++ tclreadline/tclreadline.c
@@ -745,7 +745,7 @@
     }
 
     if (!matches && tclrl_use_builtin_completer) {
-	matches = completion_matches(text, TclReadline0generator);
+	matches = rl_completion_matches(text, (rl_compentry_func_t *)TclReadline0generator);
     }
 
     return matches;

Added server/buildpkgs/tclreadline/patches/2.1.0/completion_pbug.diff version [70bbea0580].

















































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Patch by Sergei Golovan fixes syntax error in expression.

Index: tclreadline/tclreadlineCompleter.tcl
===================================================================
--- tclreadline.orig/tclreadlineCompleter.tcl
+++ tclreadline/tclreadlineCompleter.tcl
@@ -3042,7 +3042,7 @@
 proc complete(regsub) {text start end line pos mod} {
 	set prev [PreviousWord ${start} ${line}]
 	if {[llength ${prev}] && "--" != $prev && \
-		("-" == [string index ${prev} 0] || 1 == ${pos)}} {
+		("-" == [string index ${prev} 0] || 1 == ${pos})} {
 		set cmds [RemoveUsedOptions ${line} {
 			-all -nocase --} {--}]
 		if {[llength ${cmds}]} {
@@ -3449,7 +3449,7 @@
 proc complete(switch) {text start end line pos mod} {
 	set prev [PreviousWord ${start} ${line}]
 	if {[llength ${prev}] && "--" != ${prev} && \
-		("-" == [string index ${prev} 0] || 1 == ${pos)}} {
+		("-" == [string index ${prev} 0] || 1 == ${pos})} {
 		set cmds [RemoveUsedOptions ${line} {
 			-exact -glob -regexp --} {--}]
 		if {[llength ${cmds}]} {

Added server/buildpkgs/tclreadline/patches/2.1.0/memuse.diff version [038b5af4c2].































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Index: tclreadline/tclreadline.c
=====================================================================
--- tclreadline.orig/tclreadline.c
+++ tclreadline/tclreadline.c
@@ -49,8 +49,8 @@
 static const char* tclrl_version_str = TCLRL_VERSION_STR;
 static const char* tclrl_patchlevel_str = TCLRL_PATCHLEVEL_STR;
 
-#define MALLOC(size) Tcl_Alloc((int) size)
-#define FREE(ptr) if (ptr) { Tcl_Free((char*) ptr); ptr = 0; }
+#define MALLOC(size) malloc((int) size)
+#define FREE(ptr) if (ptr) { free((char*) ptr); ptr = 0; }
 
 enum {
     _CMD_SET     = (1 << 0),

Added server/buildpkgs/tclreadline/patches/2.1.0/varnames.diff version [5b03b6e0ff].























































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Index: tclreadline/tclreadline.n.in
===================================================================
--- tclreadline.orig/tclreadline.n.in
+++ tclreadline/tclreadline.n.in
@@ -232,6 +232,11 @@
 of the printable prompt. See for example the variable `prompt_string'
 in the file tclreadlineSetup.tcl in your tclreadline installation directory.
 
+.TP 5
+\fB::tclreadline::prompt2\fP
+a proc which is called by ::tclreadline::Loop and returns a string
+which will be displayed as the secondary prompt when interactively
+prompting  for  continuation  of  an incomplete command.
 
 .\" .SH "EXAMPLES"
 
Index: tclreadline/tclreadlineSetup.tcl.in
===================================================================
--- tclreadline.orig/tclreadlineSetup.tcl.in
+++ tclreadline/tclreadlineSetup.tcl.in
@@ -135,7 +135,7 @@
 	    ::tclreadline::Init
 	}
 
-	if {[catch {set a [::tclreadline::prompt1]}] && [info nameofexecutable] != ""} {
+	if {"" == [info procs ::tclreadline::prompt1] && [info nameofexecutable] != ""} {
 
 	    namespace eval ::tclreadline {
 		variable prompt_string
@@ -170,6 +170,16 @@
 	    # puts body=[info body ::tclreadline::prompt1]
 	}
 
+	if {"" == [info procs ::tclreadline::prompt2] && [info nameofexecutable] != ""} {
+
+	    if {"" == [info procs ::tclreadline::prompt2]} {
+		proc ::tclreadline::prompt2 {} {
+		    return ">"
+		}
+	    }
+	    # puts body=[info body ::tclreadline::prompt2]
+	}
+
 	if {"" == [info procs exit]} {
 
 	    catch {rename ::tclreadline::Exit ""}
@@ -262,22 +272,21 @@
 
 	while {1} {
 
-	    if [info exists tcl_prompt2] {
-		set prompt2 $tcl_prompt2
-	    } else {
-		set prompt2 ">"
-	    }
-
 	    if {[catch {
 		if {"" != [namespace eval ::tclreadline {info procs prompt1}]} {
-		    set LINE [::tclreadline::readline read \
+		    set ::tclreadline::LINE [::tclreadline::readline read \
 		    [::tclreadline::prompt1]]
 		} else {
-		    set LINE [::tclreadline::readline read %]
+		    set ::tclreadline::LINE [::tclreadline::readline read %]
 		}
-		while {![::tclreadline::readline complete $LINE]} {
-		    append LINE "\n"
-		    append LINE [tclreadline::readline read ${prompt2}]
+		while {![::tclreadline::readline complete $::tclreadline::LINE]} {
+		    append ::tclreadline::LINE "\n"
+		    if {"" != [namespace eval ::tclreadline {info procs prompt2}]} {
+			append ::tclreadline::LINE \
+			    [tclreadline::readline read [::tclreadline::prompt2]]
+		    } else {
+			append ::tclreadline::LINE [tclreadline::readline read >]
+		    }
 		}
 	    } ::tclreadline::errorMsg]} {
 		puts stderr [list tclreadline::Loop: error. \
@@ -293,19 +302,20 @@
 	    # from tcsh's behaviour, but I found it quite convenient
 	    # while using mshell on os9.
 	    #
-	    if {[string length $LINE] && [history event 0] != $LINE} {
-		history add $LINE
+	    if {[string length $::tclreadline::LINE] && \
+		    [history event 0] != $::tclreadline::LINE} {
+		history add $::tclreadline::LINE
 	    }
 
 	    if [catch {
-		set result [eval $LINE]
-		if {$result != "" && [tclreadline::Print]} {
-		    puts $result
+		set ::tclreadline::result [eval $::tclreadline::LINE]
+		if {$::tclreadline::result != "" && [tclreadline::Print]} {
+		    puts $::tclreadline::result
 		}
-		set result ""
+		set ::tclreadline::result ""
 	    } ::tclreadline::errorMsg] {
 		puts stderr $::tclreadline::errorMsg
-		puts stderr [list while evaluating $LINE]
+		puts stderr [list while evaluating $::tclreadline::LINE]
 	    }
 
 	}

Modified server/buildpkgs/tls/build.sh from [6e15606227] to [656d097351].

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42

# Do not build if the "tcl" platform has been requested
not_platforms 'tcl'

# Download source
download_src

(
	rm -rf build
	mkdir build
	cd build/ || exit 1

	gzip -dc "../${SRC}" | tar -xf -
	cd "${BUILDDIR}" || exit 1

	# Apply patches
	for patchfile in "${PATCHDIR}"/all/*.diff "${PATCHDIR}/${VERS}"/*.diff; do
		if [ ! -f "${patchfile}" ]; then
			continue
		fi

		"${PATCH:-patch}" -p1 < "${patchfile}"
	done


	if [ -z "${SSLDIR}" ]; then
		for chkssldir in $(pkg-config openssl --cflags | sed 's@ *-I *@|@g' | tr '|' "\n" | grep '^/'); do
			if [ -f "${chkssldir}/openssl/opensslv.h" -o -f "${chkssldir}/opensslv.h" ]; then
				SSLDIR=$(echo "${chkssldir}" | sed 's@/[^/]*/*$@@')
			fi
		done







<
<
<
|
|
<
<

|
<
|
|
<
|
<
<
>







13
14
15
16
17
18
19



20
21


22
23

24
25

26


27
28
29
30
31
32
33
34

# Do not build if the "tcl" platform has been requested
not_platforms 'tcl'

# Download source
download_src




# Extract source
extract_src



# Apply appropriate patches

apply_patches


(


	cd "build/${BUILDDIR}" || exit 1

	if [ -z "${SSLDIR}" ]; then
		for chkssldir in $(pkg-config openssl --cflags | sed 's@ *-I *@|@g' | tr '|' "\n" | grep '^/'); do
			if [ -f "${chkssldir}/openssl/opensslv.h" -o -f "${chkssldir}/opensslv.h" ]; then
				SSLDIR=$(echo "${chkssldir}" | sed 's@/[^/]*/*$@@')
			fi
		done