I have updated the libgo library to the weekly.2011-11-02 release of the master library. The only changes in this patch are to switch from using the type os.Error to the new predeclared type error, and to add a new errors package providing a couple of convenience functions. This causes mechanical changes to over 450 files in the library. I have not included the complete diffs in this e-mail message; they are available from SVN or from the master library. I have only included the diffs to files outside the Go library proper. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r c05039b68dc2 libgo/MERGE --- a/libgo/MERGE Fri Dec 02 16:13:57 2011 -0800 +++ b/libgo/MERGE Fri Dec 02 17:54:15 2011 -0800 @@ -1,4 +1,4 @@ -941b8015061a +780c85032b17 The first line of this file holds the Mercurial revision number of the last merge done from the master library sources. diff -r c05039b68dc2 libgo/Makefile.am --- a/libgo/Makefile.am Fri Dec 02 16:13:57 2011 -0800 +++ b/libgo/Makefile.am Fri Dec 02 17:54:15 2011 -0800 @@ -107,6 +107,7 @@ cmath.gox \ crypto.gox \ csv.gox \ + errors.gox \ exec.gox \ expvar.gox \ flag.gox \ @@ -563,6 +564,9 @@ go/csv/reader.go \ go/csv/writer.go +go_errors_files = \ + go/errors/errors.go + go_exec_files = \ go/exec/exec.go \ go/exec/lp_unix.go @@ -1623,6 +1627,7 @@ cmath/cmath.lo \ crypto/crypto.lo \ csv/csv.lo \ + errors/errors.lo \ exec/exec.lo \ expvar/expvar.lo \ flag/flag.lo \ @@ -1944,6 +1949,15 @@ @$(CHECK) .PHONY: csv/check +@go_include@ errors/errors.lo.dep +errors/errors.lo.dep: $(go_errors_files) + $(BUILDDEPS) +errors/errors.lo: $(go_errors_files) + $(BUILDPACKAGE) +errors/check: $(CHECK_DEPS) + @$(CHECK) +.PHONY: errors/check + @go_include@ exec/exec.lo.dep exec/exec.lo.dep: $(go_exec_files) $(BUILDDEPS) @@ -3445,6 +3459,8 @@ $(BUILDGOX) csv.gox: csv/csv.lo $(BUILDGOX) +errors.gox: errors/errors.lo + $(BUILDGOX) exec.gox: exec/exec.lo $(BUILDGOX) expvar.gox: expvar/expvar.lo @@ -3791,6 +3807,7 @@ bytes/check \ cmath/check \ csv/check \ + errors/check \ exec/check \ expvar/check \ flag/check \ diff -r c05039b68dc2 libgo/merge.sh --- a/libgo/merge.sh Fri Dec 02 16:13:57 2011 -0800 +++ b/libgo/merge.sh Fri Dec 02 17:54:15 2011 -0800 @@ -121,6 +121,21 @@ fi } +merge_c() { + from=$1 + to=$2 + oldfile=${OLDDIR}/src/pkg/runtime/$from + if test -f ${oldfile}; then + sed -e 's/·/_/g' < ${oldfile} > ${oldfile}.tmp + oldfile=${oldfile}.tmp + newfile=${NEWDIR}/src/pkg/runtime/$from + sed -e 's/·/_/g' < ${newfile} > ${newfile}.tmp + newfile=${newfile}.tmp + libgofile=runtime/$to + merge $from ${oldfile} ${newfile} ${libgofile} + fi +} + (cd ${NEWDIR}/src/pkg && find . -name '*.go' -print) | while read f; do if test `dirname $f` = "./syscall"; then continue @@ -153,32 +168,11 @@ runtime="chan.c cpuprof.c goc2c.c lock_futex.c lock_sema.c mcache.c mcentral.c mfinal.c mfixalloc.c mgc0.c mheap.c msize.c proc.c runtime.c runtime.h malloc.h malloc.goc mprof.goc runtime1.goc sema.goc sigqueue.goc string.goc" for f in $runtime; do - oldfile=${OLDDIR}/src/pkg/runtime/$f - if test -f ${oldfile}; then - sed -e 's/·/_/g' < ${oldfile} > ${oldfile}.tmp - oldfile=${oldfile}.tmp - newfile=${NEWDIR}/src/pkg/runtime/$f - sed -e 's/·/_/g' < ${newfile} > ${newfile}.tmp - newfile=${newfile}.tmp - libgofile=runtime/$f - merge $f ${oldfile} ${newfile} ${libgofile} - fi + merge_c $f $f done -runtime2="linux/thread.c thread-linux.c linux/mem.c mem.c" -echo $runtime2 | while read from; do - read to - oldfile=${OLDDIR}/src/pkg/runtime/$from - if test -f ${oldfile}; then - sed -e 's/·/_/g' < ${oldfile} > ${oldfile}.tmp - oldfile=${oldfile}.tmp - newfile=${NEWDIR}/src/pkg/runtime/$from - sed -e 's/·/_/g' < ${newfile} > ${newfile}.tmp - newfile=${newfile}.tmp - libgofile=runtime/$to - merge $f ${oldfile} ${newfile} ${libgofile} - fi -done +merge_c linux/thread.c thread-linux.c +merge_c linux/mem.c mem.c (cd ${OLDDIR}/src/pkg && find . -name '*.go' -print) | while read f; do oldfile=${OLDDIR}/src/pkg/$f diff -r c05039b68dc2 libgo/testsuite/gotest --- a/libgo/testsuite/gotest Fri Dec 02 16:13:57 2011 -0800 +++ b/libgo/testsuite/gotest Fri Dec 02 17:54:15 2011 -0800 @@ -346,7 +346,6 @@ echo 'import "./_xtest_"' fi echo 'import "testing"' - echo 'import __os__ "os"' # rename in case tested package is called os echo 'import __regexp__ "regexp"' # rename in case tested package is called regexp # test array echo @@ -385,7 +384,7 @@ var matchPat string var matchRe *__regexp__.Regexp -func matchString(pat, str string) (result bool, err __os__.Error) { +func matchString(pat, str string) (result bool, err error) { if matchRe == nil || matchPat != pat { matchPat = pat matchRe, err = __regexp__.Compile(matchPat)