]> Cypherpunks repositories - gostls13.git/commit
cmd/pack: fix c command for existing file
authorRob Pike <r@golang.org>
Wed, 24 Sep 2014 01:24:35 +0000 (18:24 -0700)
committerRob Pike <r@golang.org>
Wed, 24 Sep 2014 01:24:35 +0000 (18:24 -0700)
commit1193993c1db83ee8c0a8e86e6d41db1dd1982002
tree3101a105f9401b3afdff095f13e87a3620424a76
parentdb492b8df41cd90ebecaf69a73bf4cc5e0db5f20
cmd/pack: fix c command for existing file
There were at least two bugs:
1) It would overwrite a non-archive.
2) It would truncate a non-archive and then fail.
In general the file handling was too clever to be correct.
Make it more straightforward, doing the creation
separately from archive management.

Fixes #8369.

LGTM=adg, iant
R=golang-codereviews, adg, iant
CC=golang-codereviews
https://golang.org/cl/147010046
src/cmd/pack/doc.go
src/cmd/pack/pack.go
src/cmd/pack/pack_test.go