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     54   function download_src () {
    55     55   	if [ ! -f "${SRC}" -a -n "${SRC}" -a -n "${SRCURL}" ]; then
    56     56   		mkdir -p "$(dirname "${SRC}")" >/dev/null 2>/dev/null
    57     57   
    58     58   		download "${SRC}" "${SRCURL}" || exit 1
    59     59   	fi
    60     60   }
           61  +
           62  +function extract_src () {
           63  +	rm -rf build
           64  +	mkdir build
           65  +
           66  +	(
           67  +		cd build/ || exit 1
           68  +
           69  +		gzip -dc "../${SRC}" | tar -xf -
           70  +		cd "${BUILDDIR}" || exit 1
           71  +	) || exit 1
           72  +}
           73  +
           74  +function apply_patches () {
           75  +	local patchroot patchdir patchfiles patchfile idx
           76  +
           77  +	patchroot="$(pwd)/patches"
           78  +
           79  +	for patchdir in "${patchroot}/all" "${patchroot}/${VERS}"; do
           80  +		unset patchfiles
           81  +
           82  +		if [ -f "${patchdir}/series" ]; then
           83  +			idx=0
           84  +			for patchfile in $(cat "${patchdir}/series"); do
           85  +				patchfiles[${idx}]="${patchdir}/${patchfile}"
           86  +				idx=$[${idx} + 1]
           87  +			done
           88  +		else
           89  +			patchfiles=("${patchdir}"/*.diff)
           90  +		fi
           91  +
           92  +		for patchfile in "${patchfiles[@]}"; do
           93  +			if [ ! -f "${patchfile}" ]; then
           94  +				continue
           95  +			fi
           96  +
           97  +			(
           98  +				cd "build/${BUILDDIR}" || exit 1
           99  +
          100  +				echo "* Applying patch \"${patchfile}\""
          101  +				"${PATCH:-patch}" -p1 < "${patchfile}"
          102  +			)
          103  +		done
          104  +	done
          105  +}
    61    106   
    62    107   WORKDIR="${TMPDIR:-/tmp}/tcl-buildpkgs-$$${RANDOM}${RANDOM}${RANDOM}"
    63    108   PLATDIR="$(pwd)/out/${PLATFORM}"
    64    109   export WORKDIR PLATDIR
    65    110   
    66    111   setup_tcl84

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

    11     11   source ../common.sh
    12     12   
    13     13   # Do not build if the "tcl" platform has been requested
    14     14   not_platforms 'tcl'
    15     15   
    16     16   # Download source
    17     17   download_src
           18  +
           19  +# Extract source
           20  +extract_src
           21  +
           22  +# Apply appropriate patches
           23  +apply_patches
    18     24   
    19     25   # Build package
    20     26   (
    21         -	rm -rf build
    22     27   	mkdir -p "${PLATDIR}" >/dev/null 2>/dev/null
    23         -	mkdir build
    24         -
    25         -	cd build/ || exit 1
    26         -
    27         -	gzip -dc "../${SRC}" | tar -xf -
    28         -	cd "${BUILDDIR}" || exit 1
    29         -
    30         -	# The configure script that comes with TclReadLine is out-of-date
    31         -	autoreconf -fvi
           28  +	cd "build/${BUILDDIR}" || exit 1
    32     29   
    33     30   	# TclReadLine doesn't know it should use stubs, force it.
    34     31   	CFLAGS="${CFLAGS} -DUSE_TCL_STUBS=1"
    35     32   	CPPFLAGS="${CPPFLAGS} -DUSE_TCL_STUBS=1"
    36     33   	LDFLAGS="${LDFLAGS} $(source "${TCLCONFIGDIR}/tclConfig.sh" 2>/dev/null; eval echo "${TCL_STUB_LIB_SPEC}")" 
    37     34   	export CFLAGS CPPFLAGS LDFLAGS
    38     35   

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

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

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

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

            1  +Patch by Sergei Golovan fixes syntax error in expression.
            2  +
            3  +Index: tclreadline/tclreadlineCompleter.tcl
            4  +===================================================================
            5  +--- tclreadline.orig/tclreadlineCompleter.tcl
            6  ++++ tclreadline/tclreadlineCompleter.tcl
            7  +@@ -3042,7 +3042,7 @@
            8  + proc complete(regsub) {text start end line pos mod} {
            9  + 	set prev [PreviousWord ${start} ${line}]
           10  + 	if {[llength ${prev}] && "--" != $prev && \
           11  +-		("-" == [string index ${prev} 0] || 1 == ${pos)}} {
           12  ++		("-" == [string index ${prev} 0] || 1 == ${pos})} {
           13  + 		set cmds [RemoveUsedOptions ${line} {
           14  + 			-all -nocase --} {--}]
           15  + 		if {[llength ${cmds}]} {
           16  +@@ -3449,7 +3449,7 @@
           17  + proc complete(switch) {text start end line pos mod} {
           18  + 	set prev [PreviousWord ${start} ${line}]
           19  + 	if {[llength ${prev}] && "--" != ${prev} && \
           20  +-		("-" == [string index ${prev} 0] || 1 == ${pos)}} {
           21  ++		("-" == [string index ${prev} 0] || 1 == ${pos})} {
           22  + 		set cmds [RemoveUsedOptions ${line} {
           23  + 			-exact -glob -regexp --} {--}]
           24  + 		if {[llength ${cmds}]} {

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

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

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

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

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

    13     13   
    14     14   # Do not build if the "tcl" platform has been requested
    15     15   not_platforms 'tcl'
    16     16   
    17     17   # Download source
    18     18   download_src
    19     19   
    20         -(
    21         -	rm -rf build
    22         -	mkdir build
    23         -	cd build/ || exit 1
           20  +# Extract source
           21  +extract_src
    24     22   
    25         -	gzip -dc "../${SRC}" | tar -xf -
    26         -	cd "${BUILDDIR}" || exit 1
           23  +# Apply appropriate patches
           24  +apply_patches
    27     25   
    28         -	# Apply patches
    29         -	for patchfile in "${PATCHDIR}"/all/*.diff "${PATCHDIR}/${VERS}"/*.diff; do
    30         -		if [ ! -f "${patchfile}" ]; then
    31         -			continue
    32         -		fi
    33         -
    34         -		"${PATCH:-patch}" -p1 < "${patchfile}"
    35         -	done
           26  +(
           27  +	cd "build/${BUILDDIR}" || exit 1
    36     28   
    37     29   	if [ -z "${SSLDIR}" ]; then
    38     30   		for chkssldir in $(pkg-config openssl --cflags | sed 's@ *-I *@|@g' | tr '|' "\n" | grep '^/'); do
    39     31   			if [ -f "${chkssldir}/openssl/opensslv.h" -o -f "${chkssldir}/opensslv.h" ]; then
    40     32   				SSLDIR=$(echo "${chkssldir}" | sed 's@/[^/]*/*$@@')
    41     33   			fi
    42     34   		done