Move archive package into pkg/archive

Now that the archive package does not depend on any docker-specific
packages, only those in pkg and vendor, it can be safely moved into pkg.

Signed-off-by: Rafe Colton <rafael.colton@gmail.com>
This commit is contained in:
Rafe Colton 2014-09-29 23:23:36 -07:00
parent 73f4bfed81
commit 30d5a42c1f
30 changed files with 23 additions and 24 deletions

View file

@ -23,12 +23,12 @@ import (
"time"
"github.com/docker/docker/api"
"github.com/docker/docker/archive"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/engine"
"github.com/docker/docker/graph"
"github.com/docker/docker/nat"
"github.com/docker/docker/opts"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/log"
flag "github.com/docker/docker/pkg/mflag"
"github.com/docker/docker/pkg/parsers"

View file

@ -1,3 +0,0 @@
This code provides helper functions for dealing with archive files.
**TODO**: Move this to either `pkg` or (if not possible) to `utils`.

View file

@ -18,9 +18,9 @@ import (
"syscall"
"time"
"github.com/docker/docker/archive"
"github.com/docker/docker/daemon"
imagepkg "github.com/docker/docker/image"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/log"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/pkg/promise"

View file

@ -7,9 +7,9 @@ import (
"os/exec"
"strings"
"github.com/docker/docker/archive"
"github.com/docker/docker/daemon"
"github.com/docker/docker/engine"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/parsers"
"github.com/docker/docker/registry"
"github.com/docker/docker/utils"

View file

@ -16,12 +16,12 @@ import (
"github.com/docker/libcontainer/devices"
"github.com/docker/libcontainer/label"
"github.com/docker/docker/archive"
"github.com/docker/docker/daemon/execdriver"
"github.com/docker/docker/engine"
"github.com/docker/docker/image"
"github.com/docker/docker/links"
"github.com/docker/docker/nat"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/broadcastwriter"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/log"

View file

@ -15,7 +15,6 @@ import (
"github.com/docker/libcontainer/label"
"github.com/docker/docker/archive"
"github.com/docker/docker/daemon/execdriver"
"github.com/docker/docker/daemon/execdriver/execdrivers"
"github.com/docker/docker/daemon/execdriver/lxc"
@ -27,6 +26,7 @@ import (
"github.com/docker/docker/engine"
"github.com/docker/docker/graph"
"github.com/docker/docker/image"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/broadcastwriter"
"github.com/docker/docker/pkg/graphdb"
"github.com/docker/docker/pkg/ioutils"

View file

@ -30,8 +30,8 @@ import (
"sync"
"syscall"
"github.com/docker/docker/archive"
"github.com/docker/docker/daemon/graphdriver"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/log"
mountpk "github.com/docker/docker/pkg/mount"
"github.com/docker/docker/utils"

View file

@ -4,8 +4,8 @@ import (
"crypto/sha256"
"encoding/hex"
"fmt"
"github.com/docker/docker/archive"
"github.com/docker/docker/daemon/graphdriver"
"github.com/docker/docker/pkg/archive"
"io/ioutil"
"os"
"path"

View file

@ -6,7 +6,7 @@ import (
"os"
"path"
"github.com/docker/docker/archive"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/mount"
)

View file

@ -4,7 +4,7 @@ import (
"fmt"
"time"
"github.com/docker/docker/archive"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/log"
"github.com/docker/docker/utils"

View file

@ -9,8 +9,8 @@ import (
"strings"
"syscall"
"github.com/docker/docker/archive"
"github.com/docker/docker/daemon/execdriver"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/log"
"github.com/docker/docker/pkg/symlink"
"github.com/docker/docker/volumes"

View file

@ -7,8 +7,8 @@ import (
"os"
"path"
"github.com/docker/docker/archive"
"github.com/docker/docker/engine"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/log"
"github.com/docker/docker/pkg/parsers"
)

View file

@ -12,10 +12,10 @@ import (
"syscall"
"time"
"github.com/docker/docker/archive"
"github.com/docker/docker/daemon/graphdriver"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/image"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/log"
"github.com/docker/docker/pkg/truncindex"
"github.com/docker/docker/runconfig"

View file

@ -4,8 +4,8 @@ import (
"net/http"
"net/url"
"github.com/docker/docker/archive"
"github.com/docker/docker/engine"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/utils"
)

View file

@ -7,9 +7,9 @@ import (
"os"
"path"
"github.com/docker/docker/archive"
"github.com/docker/docker/engine"
"github.com/docker/docker/image"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/log"
)

View file

@ -7,8 +7,8 @@ import (
"os"
"path"
"github.com/docker/docker/archive"
"github.com/docker/docker/engine"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/log"
"github.com/docker/docker/registry"
"github.com/docker/docker/utils"

View file

@ -9,7 +9,7 @@ import (
"strconv"
"time"
"github.com/docker/docker/archive"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/log"
"github.com/docker/docker/runconfig"
"github.com/docker/docker/utils"

View file

@ -11,7 +11,7 @@ import (
"testing"
"time"
"github.com/docker/docker/archive"
"github.com/docker/docker/pkg/archive"
)
func TestBuildCacheADD(t *testing.T) {

View file

@ -2,11 +2,11 @@ package docker
import (
"errors"
"github.com/docker/docker/archive"
"github.com/docker/docker/daemon/graphdriver"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/graph"
"github.com/docker/docker/image"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/utils"
"io"
"io/ioutil"

1
pkg/archive/README.md Normal file
View file

@ -0,0 +1 @@
This code provides helper functions for dealing with archive files.

View file

@ -18,10 +18,11 @@ import (
"github.com/docker/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar"
"github.com/docker/docker/pkg/fileutils"
"github.com/docker/docker/pkg/log"
"github.com/docker/docker/pkg/pools"
"github.com/docker/docker/pkg/promise"
"github.com/docker/docker/pkg/system"
"github.com/docker/docker/utils"
)
type (
@ -370,7 +371,7 @@ func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error)
return nil
}
skip, err := utils.Matches(relFilePath, options.Excludes)
skip, err := fileutils.Matches(relFilePath, options.Excludes)
if err != nil {
log.Debugf("Error matching %s", relFilePath, err)
return err
@ -581,7 +582,7 @@ func CopyFileWithTar(src, dst string) (err error) {
}
r, w := io.Pipe()
errC := utils.Go(func() error {
errC := promise.Go(func() error {
defer w.Close()
srcF, err := os.Open(src)