|
|
|
|
@ -6,7 +6,6 @@ import (
|
|
|
|
|
"encoding/hex"
|
|
|
|
|
"fmt"
|
|
|
|
|
"log"
|
|
|
|
|
"strings"
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
"github.com/hashicorp/packer/helper/multistep"
|
|
|
|
|
@ -67,7 +66,7 @@ func (s *StepDownload) Run(_ context.Context, state multistep.StateBag) multiste
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ui.Say(fmt.Sprintf("Downloading, copying or inplace referencing %s", s.Description))
|
|
|
|
|
ui.Say(fmt.Sprintf("Retrieving %s", s.Description))
|
|
|
|
|
|
|
|
|
|
// First try to use any already downloaded file
|
|
|
|
|
// If it fails, proceed to regular download logic
|
|
|
|
|
@ -112,14 +111,10 @@ func (s *StepDownload) Run(_ context.Context, state multistep.StateBag) multiste
|
|
|
|
|
|
|
|
|
|
if finalPath == "" {
|
|
|
|
|
for i, url := range s.Url {
|
|
|
|
|
if strings.HasPrefix(url, "file://") {
|
|
|
|
|
if s.Inplace {
|
|
|
|
|
ui.Message(fmt.Sprintf("Inplace referencing: %s", url))
|
|
|
|
|
} else {
|
|
|
|
|
ui.Message(fmt.Sprintf("Copying: %s", url))
|
|
|
|
|
}
|
|
|
|
|
if s.Inplace {
|
|
|
|
|
ui.Message(fmt.Sprintf("Using file in-place: %s", url))
|
|
|
|
|
} else {
|
|
|
|
|
ui.Message(fmt.Sprintf("Downloading: %s", url))
|
|
|
|
|
ui.Message(fmt.Sprintf("Transferring file from path: %s", url))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
config := downloadConfigs[i]
|
|
|
|
|
|