mirror of https://github.com/docker/docs.git
Remove old debug from tarsum
This commit is contained in:
parent
efaf2cac5c
commit
360078d761
|
@ -1,26 +1,17 @@
|
||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"archive/tar"
|
||||||
"bytes"
|
"bytes"
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"archive/tar"
|
|
||||||
"hash"
|
"hash"
|
||||||
"io"
|
"io"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
type verboseHash struct {
|
|
||||||
hash.Hash
|
|
||||||
}
|
|
||||||
|
|
||||||
func (h verboseHash) Write(buf []byte) (int, error) {
|
|
||||||
Debugf("--->%s<---", buf)
|
|
||||||
return h.Hash.Write(buf)
|
|
||||||
}
|
|
||||||
|
|
||||||
type TarSum struct {
|
type TarSum struct {
|
||||||
io.Reader
|
io.Reader
|
||||||
tarR *tar.Reader
|
tarR *tar.Reader
|
||||||
|
@ -29,7 +20,6 @@ type TarSum struct {
|
||||||
bufTar *bytes.Buffer
|
bufTar *bytes.Buffer
|
||||||
bufGz *bytes.Buffer
|
bufGz *bytes.Buffer
|
||||||
h hash.Hash
|
h hash.Hash
|
||||||
h2 verboseHash
|
|
||||||
sums []string
|
sums []string
|
||||||
finished bool
|
finished bool
|
||||||
first bool
|
first bool
|
||||||
|
@ -52,7 +42,6 @@ func (ts *TarSum) encodeHeader(h *tar.Header) error {
|
||||||
// {"atime", strconv.Itoa(int(h.AccessTime.UTC().Unix()))},
|
// {"atime", strconv.Itoa(int(h.AccessTime.UTC().Unix()))},
|
||||||
// {"ctime", strconv.Itoa(int(h.ChangeTime.UTC().Unix()))},
|
// {"ctime", strconv.Itoa(int(h.ChangeTime.UTC().Unix()))},
|
||||||
} {
|
} {
|
||||||
// Debugf("-->%s<-- -->%s<--", elem[0], elem[1])
|
|
||||||
if _, err := ts.h.Write([]byte(elem[0] + elem[1])); err != nil {
|
if _, err := ts.h.Write([]byte(elem[0] + elem[1])); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -68,7 +57,6 @@ func (ts *TarSum) Read(buf []byte) (int, error) {
|
||||||
ts.tarW = tar.NewWriter(ts.bufTar)
|
ts.tarW = tar.NewWriter(ts.bufTar)
|
||||||
ts.gz = gzip.NewWriter(ts.bufGz)
|
ts.gz = gzip.NewWriter(ts.bufGz)
|
||||||
ts.h = sha256.New()
|
ts.h = sha256.New()
|
||||||
// ts.h = verboseHash{sha256.New()}
|
|
||||||
ts.h.Reset()
|
ts.h.Reset()
|
||||||
ts.first = true
|
ts.first = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue