Move tarsum utilities out of common package

In preparation for removing the common package, the tarsum utilities are being
moved to the more relevant digest package. This functionality will probably go
away in the future, but it's maintained here for the time being.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2015-01-05 16:04:30 -08:00
parent 1266f13afa
commit 8be20212f1
4 changed files with 4 additions and 6 deletions

View file

@ -10,7 +10,6 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/docker/distribution/common"
"github.com/docker/docker/pkg/tarsum" "github.com/docker/docker/pkg/tarsum"
) )
@ -105,7 +104,7 @@ func FromBytes(p []byte) (Digest, error) {
func (d Digest) Validate() error { func (d Digest) Validate() error {
s := string(d) s := string(d)
// Common case will be tarsum // Common case will be tarsum
_, err := common.ParseTarSum(s) _, err := ParseTarSum(s)
if err == nil { if err == nil {
return nil return nil
} }

View file

@ -1,4 +1,4 @@
package common package digest
import ( import (
"fmt" "fmt"

View file

@ -1,4 +1,4 @@
package common package digest
import ( import (
"reflect" "reflect"

View file

@ -5,7 +5,6 @@ import (
"path" "path"
"strings" "strings"
"github.com/docker/distribution/common"
"github.com/docker/distribution/digest" "github.com/docker/distribution/digest"
) )
@ -189,7 +188,7 @@ func digestPathComoponents(dgst digest.Digest) ([]string, error) {
hex, hex,
} }
if tsi, err := common.ParseTarSum(dgst.String()); err == nil { if tsi, err := digest.ParseTarSum(dgst.String()); err == nil {
// We have a tarsum! // We have a tarsum!
version := tsi.Version version := tsi.Version
if version == "" { if version == "" {