From fa3e70ef75eb93fb15542c44b4a034dcc4765b16 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Thu, 17 Oct 2013 22:50:02 +0000 Subject: [PATCH] builder/amazon/chroot: Delete files at destination before copy. This should help with the dangling symbolic link issue we've been seeing with ubuntu. fixes GH-500 --- builder/amazon/chroot/step_copy_files.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/amazon/chroot/step_copy_files.go b/builder/amazon/chroot/step_copy_files.go index 70af624c8..844e9e5c1 100644 --- a/builder/amazon/chroot/step_copy_files.go +++ b/builder/amazon/chroot/step_copy_files.go @@ -33,7 +33,7 @@ func (s *StepCopyFiles) Run(state multistep.StateBag) multistep.StepAction { chrootPath := filepath.Join(mountPath, path) log.Printf("Copying '%s' to '%s'", path, chrootPath) - cmdText, err := wrappedCommand(fmt.Sprintf("cp %s %s", path, chrootPath)) + cmdText, err := wrappedCommand(fmt.Sprintf("cp --remove-destination %s %s", path, chrootPath)) if err != nil { err := fmt.Errorf("Error building copy command: %s", err) state.Put("error", err)