Skip to content

Commit

Permalink
change util.CopyDirectory to archive.CopyWithTar
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <[email protected]> (github: dqminh)
  • Loading branch information
dqminh committed Nov 1, 2014
1 parent 4d4a7b8 commit e5ecfd3
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

log "github.com/Sirupsen/logrus"
"github.com/docker/docker/dockerversion"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/fileutils"
"github.com/docker/docker/pkg/ioutils"
)
Expand Down Expand Up @@ -250,14 +251,6 @@ func HashData(src io.Reader) (string, error) {
return "sha256:" + hex.EncodeToString(h.Sum(nil)), nil
}

// FIXME: this is deprecated by CopyWithTar in archive.go
func CopyDirectory(source, dest string) error {
if output, err := exec.Command("cp", "-ra", source, dest).CombinedOutput(); err != nil {
return fmt.Errorf("Error copy: %s (%s)", err, output)
}
return nil
}

type WriteFlusher struct {
sync.Mutex
w io.Writer
Expand Down Expand Up @@ -381,7 +374,7 @@ func TestDirectory(templateDir string) (dir string, err error) {
return
}
if templateDir != "" {
if err = CopyDirectory(templateDir, dir); err != nil {
if err = archive.CopyWithTar(templateDir, dir); err != nil {
return
}
}
Expand Down

0 comments on commit e5ecfd3

Please sign in to comment.