]> Cypherpunks repositories - gostls13.git/commitdiff
encoding: move asn1, csv, gob, json, xml into encoding
authorRob Pike <r@golang.org>
Thu, 3 Nov 2011 18:39:52 +0000 (11:39 -0700)
committerRob Pike <r@golang.org>
Thu, 3 Nov 2011 18:39:52 +0000 (11:39 -0700)
This is Go 1 package renaming CL #1.
This one merely moves the source; the import strings will be
changed after the next weekly release.

The only edits are in Makefiles.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5331060

50 files changed:
src/pkg/Makefile
src/pkg/deps.bash
src/pkg/encoding/asn1/Makefile [moved from src/pkg/asn1/Makefile with 80% similarity]
src/pkg/encoding/asn1/asn1.go [moved from src/pkg/asn1/asn1.go with 100% similarity]
src/pkg/encoding/asn1/asn1_test.go [moved from src/pkg/asn1/asn1_test.go with 100% similarity]
src/pkg/encoding/asn1/common.go [moved from src/pkg/asn1/common.go with 100% similarity]
src/pkg/encoding/asn1/marshal.go [moved from src/pkg/asn1/marshal.go with 100% similarity]
src/pkg/encoding/asn1/marshal_test.go [moved from src/pkg/asn1/marshal_test.go with 100% similarity]
src/pkg/encoding/csv/Makefile [moved from src/pkg/csv/Makefile with 79% similarity]
src/pkg/encoding/csv/reader.go [moved from src/pkg/csv/reader.go with 100% similarity]
src/pkg/encoding/csv/reader_test.go [moved from src/pkg/csv/reader_test.go with 100% similarity]
src/pkg/encoding/csv/writer.go [moved from src/pkg/csv/writer.go with 100% similarity]
src/pkg/encoding/csv/writer_test.go [moved from src/pkg/csv/writer_test.go with 100% similarity]
src/pkg/encoding/gob/Makefile [moved from src/pkg/gob/Makefile with 88% similarity]
src/pkg/encoding/gob/codec_test.go [moved from src/pkg/gob/codec_test.go with 100% similarity]
src/pkg/encoding/gob/debug.go [moved from src/pkg/gob/debug.go with 100% similarity]
src/pkg/encoding/gob/decode.go [moved from src/pkg/gob/decode.go with 100% similarity]
src/pkg/encoding/gob/decoder.go [moved from src/pkg/gob/decoder.go with 100% similarity]
src/pkg/encoding/gob/doc.go [moved from src/pkg/gob/doc.go with 100% similarity]
src/pkg/encoding/gob/dump.go [moved from src/pkg/gob/dump.go with 100% similarity]
src/pkg/encoding/gob/encode.go [moved from src/pkg/gob/encode.go with 100% similarity]
src/pkg/encoding/gob/encoder.go [moved from src/pkg/gob/encoder.go with 100% similarity]
src/pkg/encoding/gob/encoder_test.go [moved from src/pkg/gob/encoder_test.go with 100% similarity]
src/pkg/encoding/gob/error.go [moved from src/pkg/gob/error.go with 100% similarity]
src/pkg/encoding/gob/gobencdec_test.go [moved from src/pkg/gob/gobencdec_test.go with 100% similarity]
src/pkg/encoding/gob/timing_test.go [moved from src/pkg/gob/timing_test.go with 100% similarity]
src/pkg/encoding/gob/type.go [moved from src/pkg/gob/type.go with 100% similarity]
src/pkg/encoding/gob/type_test.go [moved from src/pkg/gob/type_test.go with 100% similarity]
src/pkg/encoding/json/Makefile [moved from src/pkg/json/Makefile with 82% similarity]
src/pkg/encoding/json/decode.go [moved from src/pkg/json/decode.go with 100% similarity]
src/pkg/encoding/json/decode_test.go [moved from src/pkg/json/decode_test.go with 100% similarity]
src/pkg/encoding/json/encode.go [moved from src/pkg/json/encode.go with 100% similarity]
src/pkg/encoding/json/encode_test.go [moved from src/pkg/json/encode_test.go with 100% similarity]
src/pkg/encoding/json/indent.go [moved from src/pkg/json/indent.go with 100% similarity]
src/pkg/encoding/json/scanner.go [moved from src/pkg/json/scanner.go with 100% similarity]
src/pkg/encoding/json/scanner_test.go [moved from src/pkg/json/scanner_test.go with 100% similarity]
src/pkg/encoding/json/stream.go [moved from src/pkg/json/stream.go with 100% similarity]
src/pkg/encoding/json/stream_test.go [moved from src/pkg/json/stream_test.go with 100% similarity]
src/pkg/encoding/json/tagkey_test.go [moved from src/pkg/json/tagkey_test.go with 100% similarity]
src/pkg/encoding/json/tags.go [moved from src/pkg/json/tags.go with 100% similarity]
src/pkg/encoding/json/tags_test.go [moved from src/pkg/json/tags_test.go with 100% similarity]
src/pkg/encoding/xml/Makefile [moved from src/pkg/xml/Makefile with 80% similarity]
src/pkg/encoding/xml/atom_test.go [moved from src/pkg/xml/atom_test.go with 100% similarity]
src/pkg/encoding/xml/embed_test.go [moved from src/pkg/xml/embed_test.go with 100% similarity]
src/pkg/encoding/xml/marshal.go [moved from src/pkg/xml/marshal.go with 100% similarity]
src/pkg/encoding/xml/marshal_test.go [moved from src/pkg/xml/marshal_test.go with 100% similarity]
src/pkg/encoding/xml/read.go [moved from src/pkg/xml/read.go with 100% similarity]
src/pkg/encoding/xml/read_test.go [moved from src/pkg/xml/read_test.go with 100% similarity]
src/pkg/encoding/xml/xml.go [moved from src/pkg/xml/xml.go with 100% similarity]
src/pkg/encoding/xml/xml_test.go [moved from src/pkg/xml/xml_test.go with 100% similarity]

index 3d11502f241324cc1154338529824f3f4fc79531..105f3c4cfa117b39474f4cdd64a68be6df2390f9 100644 (file)
@@ -16,7 +16,6 @@ all: install
 DIRS=\
        archive/tar\
        archive/zip\
-       asn1\
        big\
        bufio\
        bytes\
@@ -62,19 +61,23 @@ DIRS=\
        crypto/x509\
        crypto/x509/pkix\
        crypto/xtea\
-       csv\
        debug/dwarf\
        debug/macho\
        debug/elf\
        debug/gosym\
        debug/pe\
        encoding/ascii85\
+       encoding/asn1\
        encoding/base32\
        encoding/base64\
        encoding/binary\
+       encoding/csv\
        encoding/git85\
+       encoding/gob\
        encoding/hex\
+       encoding/json\
        encoding/pem\
+       encoding/xml\
        errors\
        exec\
        exp/ebnf\
@@ -98,7 +101,6 @@ DIRS=\
        go/printer\
        go/scanner\
        go/token\
-       gob\
        hash\
        hash/adler32\
        hash/crc32\
@@ -122,7 +124,6 @@ DIRS=\
        index/suffixarray\
        io\
        io/ioutil\
-       json\
        log\
        mail\
        math\
@@ -172,7 +173,6 @@ DIRS=\
        utf16\
        utf8\
        websocket\
-       xml\
        ../cmd/cgo\
        ../cmd/godoc\
        ../cmd/gofix\
@@ -236,6 +236,9 @@ TEST=\
 BENCH=\
        $(filter-out $(NOBENCH),$(TEST))
 
+CRAP:
+       echo $(DIRS)
+
 clean.dirs: $(addsuffix .clean, $(DIRS))
 install.dirs: $(addsuffix .install, $(DIRS))
 nuke.dirs: $(addsuffix .nuke, $(DIRS))
index d7919aa2e14f869a0f4f022bf056289f2d7b7d51..5760453c9e3343da584de7358c3fe7ddd04ef8b5 100755 (executable)
@@ -21,10 +21,17 @@ dirpat=$(echo $dirs C | awk '{
                gsub("/", "\\/", x)
                printf("/^(%s)$/\n", x)
        }
-}')
+}'
+       # Add packages' old names. TODO: clean up after renaming.
+       echo "/^(asn1)$/"
+       echo "/^(csv)$/"
+       echo "/^(gob)$/"
+       echo "/^(json)$/"
+       echo "/^(xml)$/"
+)
 
 for dir in $dirs; do (
-       cd $dir || exit 1
+       cd $dir >/dev/null || exit 1
 
        sources=$(sed -n 's/^[  ]*\([^  ]*\.go\)[       ]*\\*[  ]*$/\1/p' Makefile)
        sources=$(echo $sources | sed 's/\$(GOOS)/'$GOOS'/g')
@@ -39,6 +46,16 @@ for dir in $dirs; do (
                awk "$dirpat" |
                grep -v "^$dir\$" |
                sed 's/$/.install/' |
+               # TODO: rename the dependencies for renamed directories.  TODO: clean up after renaming.
+               # awk is overkill but it's easy to understand.
+               awk '
+                       /^asn1.install$/ { print "encoding/asn1.install"; next }
+                       /^csv.install$/ { print "encoding/csv.install"; next }
+                       /^gob.install$/ { print "encoding/gob.install"; next }
+                       /^json.install$/ { print "encoding/json.install"; next }
+                       /^xml.install$/ { print "encoding/xml.install"; next }
+                       {print}
+               ' |
                sed 's;^C\.install;runtime/cgo.install;' |
                sort -u
        )
similarity index 80%
rename from src/pkg/asn1/Makefile
rename to src/pkg/encoding/asn1/Makefile
index 6b7770e820f33924c23569f00fb298d7f3da7cc2..692c469878d948506a1de30e59c2ee2d61b2afa3 100644 (file)
@@ -2,7 +2,7 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
+include ../../../Make.inc
 
 TARG=asn1
 GOFILES=\
@@ -10,4 +10,4 @@ GOFILES=\
        common.go\
        marshal.go\
 
-include ../../Make.pkg
+include ../../../Make.pkg
similarity index 79%
rename from src/pkg/csv/Makefile
rename to src/pkg/encoding/csv/Makefile
index e364d51d23fb3d0936b6c044de53066e2102fd67..7476d816a107680feacf2f882b4ae0f284fd5ae6 100644 (file)
@@ -2,11 +2,11 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
+include ../../../Make.inc
 
 TARG=csv
 GOFILES=\
        reader.go\
        writer.go\
 
-include ../../Make.pkg
+include ../../../Make.pkg
similarity index 88%
rename from src/pkg/gob/Makefile
rename to src/pkg/encoding/gob/Makefile
index 68007c189e20d62032cfe7028e6d344cb962aa4a..70ea22f94b1fb8fb89b7d4dcadfe2274756fcd5a 100644 (file)
@@ -2,7 +2,7 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
+include ../../../Make.inc
 
 TARG=gob
 GOFILES=\
@@ -14,7 +14,7 @@ GOFILES=\
        error.go\
        type.go\
 
-include ../../Make.pkg
+include ../../../Make.pkg
 
 # Help for debugging. Requires adding debug.go to the gob package as well.
 
similarity index 82%
rename from src/pkg/json/Makefile
rename to src/pkg/encoding/json/Makefile
index 28ed62bc4b1d77353f24fef03f27898843823f2d..203cf3ca985bf835cb92d4524b3c7fe8cc44d5b9 100644 (file)
@@ -2,7 +2,7 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
+include ../../../Make.inc
 
 TARG=json
 GOFILES=\
@@ -13,4 +13,4 @@ GOFILES=\
        stream.go\
        tags.go\
 
-include ../../Make.pkg
+include ../../../Make.pkg
similarity index 80%
rename from src/pkg/xml/Makefile
rename to src/pkg/encoding/xml/Makefile
index d66c4988a8ea5732cc99c8a58923a0ad41f98ff7..731d2ad9597f07900757d759abc1df4f38b4591b 100644 (file)
@@ -2,7 +2,7 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
+include ../../../Make.inc
 
 TARG=xml
 
@@ -11,4 +11,4 @@ GOFILES=\
        read.go\
        xml.go\
 
-include ../../Make.pkg
+include ../../../Make.pkg