Commit f4cd8022 authored by Rob Pike's avatar Rob Pike

encoding: move asn1, csv, gob, json, xml into encoding

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
parent 11075ed8
...@@ -16,7 +16,6 @@ all: install ...@@ -16,7 +16,6 @@ all: install
DIRS=\ DIRS=\
archive/tar\ archive/tar\
archive/zip\ archive/zip\
asn1\
big\ big\
bufio\ bufio\
bytes\ bytes\
...@@ -62,19 +61,23 @@ DIRS=\ ...@@ -62,19 +61,23 @@ DIRS=\
crypto/x509\ crypto/x509\
crypto/x509/pkix\ crypto/x509/pkix\
crypto/xtea\ crypto/xtea\
csv\
debug/dwarf\ debug/dwarf\
debug/macho\ debug/macho\
debug/elf\ debug/elf\
debug/gosym\ debug/gosym\
debug/pe\ debug/pe\
encoding/ascii85\ encoding/ascii85\
encoding/asn1\
encoding/base32\ encoding/base32\
encoding/base64\ encoding/base64\
encoding/binary\ encoding/binary\
encoding/csv\
encoding/git85\ encoding/git85\
encoding/gob\
encoding/hex\ encoding/hex\
encoding/json\
encoding/pem\ encoding/pem\
encoding/xml\
errors\ errors\
exec\ exec\
exp/ebnf\ exp/ebnf\
...@@ -98,7 +101,6 @@ DIRS=\ ...@@ -98,7 +101,6 @@ DIRS=\
go/printer\ go/printer\
go/scanner\ go/scanner\
go/token\ go/token\
gob\
hash\ hash\
hash/adler32\ hash/adler32\
hash/crc32\ hash/crc32\
...@@ -122,7 +124,6 @@ DIRS=\ ...@@ -122,7 +124,6 @@ DIRS=\
index/suffixarray\ index/suffixarray\
io\ io\
io/ioutil\ io/ioutil\
json\
log\ log\
mail\ mail\
math\ math\
...@@ -172,7 +173,6 @@ DIRS=\ ...@@ -172,7 +173,6 @@ DIRS=\
utf16\ utf16\
utf8\ utf8\
websocket\ websocket\
xml\
../cmd/cgo\ ../cmd/cgo\
../cmd/godoc\ ../cmd/godoc\
../cmd/gofix\ ../cmd/gofix\
...@@ -236,6 +236,9 @@ TEST=\ ...@@ -236,6 +236,9 @@ TEST=\
BENCH=\ BENCH=\
$(filter-out $(NOBENCH),$(TEST)) $(filter-out $(NOBENCH),$(TEST))
CRAP:
echo $(DIRS)
clean.dirs: $(addsuffix .clean, $(DIRS)) clean.dirs: $(addsuffix .clean, $(DIRS))
install.dirs: $(addsuffix .install, $(DIRS)) install.dirs: $(addsuffix .install, $(DIRS))
nuke.dirs: $(addsuffix .nuke, $(DIRS)) nuke.dirs: $(addsuffix .nuke, $(DIRS))
......
...@@ -21,10 +21,17 @@ dirpat=$(echo $dirs C | awk '{ ...@@ -21,10 +21,17 @@ dirpat=$(echo $dirs C | awk '{
gsub("/", "\\/", x) gsub("/", "\\/", x)
printf("/^(%s)$/\n", 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 ( for dir in $dirs; do (
cd $dir || exit 1 cd $dir >/dev/null || exit 1
sources=$(sed -n 's/^[ ]*\([^ ]*\.go\)[ ]*\\*[ ]*$/\1/p' Makefile) sources=$(sed -n 's/^[ ]*\([^ ]*\.go\)[ ]*\\*[ ]*$/\1/p' Makefile)
sources=$(echo $sources | sed 's/\$(GOOS)/'$GOOS'/g') sources=$(echo $sources | sed 's/\$(GOOS)/'$GOOS'/g')
...@@ -39,6 +46,16 @@ for dir in $dirs; do ( ...@@ -39,6 +46,16 @@ for dir in $dirs; do (
awk "$dirpat" | awk "$dirpat" |
grep -v "^$dir\$" | grep -v "^$dir\$" |
sed 's/$/.install/' | 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;' | sed 's;^C\.install;runtime/cgo.install;' |
sort -u sort -u
) )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
include ../../Make.inc include ../../../Make.inc
TARG=asn1 TARG=asn1
GOFILES=\ GOFILES=\
...@@ -10,4 +10,4 @@ GOFILES=\ ...@@ -10,4 +10,4 @@ GOFILES=\
common.go\ common.go\
marshal.go\ marshal.go\
include ../../Make.pkg include ../../../Make.pkg
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
# Use of this source code is governed by a BSD-style # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
include ../../Make.inc include ../../../Make.inc
TARG=csv TARG=csv
GOFILES=\ GOFILES=\
reader.go\ reader.go\
writer.go\ writer.go\
include ../../Make.pkg include ../../../Make.pkg
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
include ../../Make.inc include ../../../Make.inc
TARG=gob TARG=gob
GOFILES=\ GOFILES=\
...@@ -14,7 +14,7 @@ GOFILES=\ ...@@ -14,7 +14,7 @@ GOFILES=\
error.go\ error.go\
type.go\ type.go\
include ../../Make.pkg include ../../../Make.pkg
# Help for debugging. Requires adding debug.go to the gob package as well. # Help for debugging. Requires adding debug.go to the gob package as well.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
include ../../Make.inc include ../../../Make.inc
TARG=json TARG=json
GOFILES=\ GOFILES=\
...@@ -13,4 +13,4 @@ GOFILES=\ ...@@ -13,4 +13,4 @@ GOFILES=\
stream.go\ stream.go\
tags.go\ tags.go\
include ../../Make.pkg include ../../../Make.pkg
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
include ../../Make.inc include ../../../Make.inc
TARG=xml TARG=xml
...@@ -11,4 +11,4 @@ GOFILES=\ ...@@ -11,4 +11,4 @@ GOFILES=\
read.go\ read.go\
xml.go\ xml.go\
include ../../Make.pkg include ../../../Make.pkg
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment