Commit 5e9ff92f authored by Matthew Hooker's avatar Matthew Hooker

Revert "notes/reorg."

This reverts commit 73c5aec24d0a504ecfbae038b4b7effb54adb929.

Conflicts:
	builder/amazon/chroot/step_copy_files.go
parent ce3725ef
...@@ -53,6 +53,22 @@ func (c *Communicator) Start(cmd *packer.RemoteCmd) error { ...@@ -53,6 +53,22 @@ func (c *Communicator) Start(cmd *packer.RemoteCmd) error {
return nil return nil
} }
func (c *Communicator) Upload(dst string, r io.Reader) error {
dst = filepath.Join(c.Chroot, dst)
log.Printf("Uploading to chroot dir: %s", dst)
f, err := os.Create(dst)
if err != nil {
return err
}
defer f.Close()
if _, err := io.Copy(f, r); err != nil {
return err
}
return nil
}
func (c *Communicator) UploadDir(dst string, src string, exclude []string) error { func (c *Communicator) UploadDir(dst string, src string, exclude []string) error {
walkFn := func(fullPath string, info os.FileInfo, err error) error { walkFn := func(fullPath string, info os.FileInfo, err error) error {
if err != nil { if err != nil {
...@@ -81,22 +97,6 @@ func (c *Communicator) UploadDir(dst string, src string, exclude []string) error ...@@ -81,22 +97,6 @@ func (c *Communicator) UploadDir(dst string, src string, exclude []string) error
return filepath.Walk(src, walkFn) return filepath.Walk(src, walkFn)
} }
func (c *Communicator) Upload(dst string, r io.Reader) error {
dst = filepath.Join(c.Chroot, dst)
log.Printf("Uploading to chroot dir: %s", dst)
f, err := os.Create(dst)
if err != nil {
return err
}
defer f.Close()
if _, err := io.Copy(f, r); err != nil {
return err
}
return nil
}
func (c *Communicator) Download(src string, w io.Writer) error { func (c *Communicator) Download(src string, w io.Writer) error {
src = filepath.Join(c.Chroot, src) src = filepath.Join(c.Chroot, src)
log.Printf("Downloading from chroot dir: %s", src) log.Printf("Downloading from chroot dir: %s", src)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment