From 8be20212f1a4b80b5ceeb1242b0e87a34056d460 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Mon, 5 Jan 2015 16:04:30 -0800 Subject: [PATCH] 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 --- digest/digest.go | 3 +-- {common => digest}/tarsum.go | 2 +- {common => digest}/tarsum_test.go | 2 +- storage/paths.go | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-) rename {common => digest}/tarsum.go (99%) rename {common => digest}/tarsum_test.go (99%) diff --git a/digest/digest.go b/digest/digest.go index dcf6bc910..a5d5b5a84 100644 --- a/digest/digest.go +++ b/digest/digest.go @@ -10,7 +10,6 @@ import ( "regexp" "strings" - "github.com/docker/distribution/common" "github.com/docker/docker/pkg/tarsum" ) @@ -105,7 +104,7 @@ func FromBytes(p []byte) (Digest, error) { func (d Digest) Validate() error { s := string(d) // Common case will be tarsum - _, err := common.ParseTarSum(s) + _, err := ParseTarSum(s) if err == nil { return nil } diff --git a/common/tarsum.go b/digest/tarsum.go similarity index 99% rename from common/tarsum.go rename to digest/tarsum.go index a1a56d6d8..6c32bc590 100644 --- a/common/tarsum.go +++ b/digest/tarsum.go @@ -1,4 +1,4 @@ -package common +package digest import ( "fmt" diff --git a/common/tarsum_test.go b/digest/tarsum_test.go similarity index 99% rename from common/tarsum_test.go rename to digest/tarsum_test.go index e860c9cdf..5a10b7468 100644 --- a/common/tarsum_test.go +++ b/digest/tarsum_test.go @@ -1,4 +1,4 @@ -package common +package digest import ( "reflect" diff --git a/storage/paths.go b/storage/paths.go index 9a61e0815..a19f2d702 100644 --- a/storage/paths.go +++ b/storage/paths.go @@ -5,7 +5,6 @@ import ( "path" "strings" - "github.com/docker/distribution/common" "github.com/docker/distribution/digest" ) @@ -189,7 +188,7 @@ func digestPathComoponents(dgst digest.Digest) ([]string, error) { hex, } - if tsi, err := common.ParseTarSum(dgst.String()); err == nil { + if tsi, err := digest.ParseTarSum(dgst.String()); err == nil { // We have a tarsum! version := tsi.Version if version == "" {