Skip to content

Commit

Permalink
Move archive package into pkg/archive
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rafecolton committed Sep 30, 2014
1 parent 73f4bfe commit 30d5a42
Show file tree
Hide file tree
Showing 30 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion api/client/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 0 additions & 3 deletions archive/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion builder/internals.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builder/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion daemon/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion daemon/graphdriver/aufs/aufs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion daemon/graphdriver/aufs/aufs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion daemon/graphdriver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"path"

"github.com/docker/docker/archive"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/mount"
)

Expand Down
2 changes: 1 addition & 1 deletion daemon/graphdriver/fsdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion daemon/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion graph/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion graph/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion graph/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion graph/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion graph/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion integration-cli/docker_cli_build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"testing"
"time"

"github.com/docker/docker/archive"
"github.com/docker/docker/pkg/archive"
)

func TestBuildCacheADD(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion integration/graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions pkg/archive/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This code provides helper functions for dealing with archive files.
7 changes: 4 additions & 3 deletions archive/archive.go → pkg/archive/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 30d5a42

Please sign in to comment.