From de83755c00000e5a848ec05ebc74ed220e3e1efd Mon Sep 17 00:00:00 2001
From: Matthew Hooker <mwhooker@gmail.com>
Date: Thu, 26 Sep 2013 18:34:01 -0700
Subject: [PATCH] wip

---
 builder/amazon/chroot/step_copy_files.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/builder/amazon/chroot/step_copy_files.go b/builder/amazon/chroot/step_copy_files.go
index 10296742..7ca6ef2a 100644
--- a/builder/amazon/chroot/step_copy_files.go
+++ b/builder/amazon/chroot/step_copy_files.go
@@ -5,6 +5,7 @@ import (
 	"github.com/mitchellh/multistep"
 	"github.com/mitchellh/packer/packer"
 	"log"
+	"os/exec"
 	"path/filepath"
 )
 
@@ -56,7 +57,9 @@ func (s *StepCopyFiles) CleanupFunc(multistep.StateBag) error {
 	if s.files != nil {
 		for _, file := range s.files {
 			log.Printf("Removing: %s", file)
-			if err := copySingle(file, "", "rm"); err != nil {
+			chrootCommand := fmt.Sprintf("rm %s", file)
+			localCmd := exec.Command("/bin/sh", "-c", chrootCommand)
+			if err := localCmd.Run(); err != nil {
 				return err
 			}
 		}
-- 
2.30.9