diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f7d06a3e..8276b4c1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ BUG FIXES: * core: Don't change background color on CLI anymore, making things look a tad nicer in some terminals. +* core: multiple ISO URLs works properly in all builders. [GH-683] * builder/amazon/chroot: Block when obtaining file lock to allow parallel builds. [GH-689] * builder/vmware: Cleanup of VMX keys works properly so cd-rom won't diff --git a/common/config.go b/common/config.go index 460eeabc7..a0204eed2 100644 --- a/common/config.go +++ b/common/config.go @@ -105,21 +105,21 @@ func DownloadableURL(original string) (string, error) { url.Path = strings.Replace(url.Path, `\`, `/`, -1) } - if _, err := os.Stat(url.Path); err != nil { - return "", err - } + // Only do the filepath transformations if the file appears + // to actually exist. + if _, err := os.Stat(url.Path); err == nil { + url.Path, err = filepath.Abs(url.Path) + if err != nil { + return "", err + } - url.Path, err = filepath.Abs(url.Path) - if err != nil { - return "", err - } + url.Path, err = filepath.EvalSymlinks(url.Path) + if err != nil { + return "", err + } - url.Path, err = filepath.EvalSymlinks(url.Path) - if err != nil { - return "", err + url.Path = filepath.Clean(url.Path) } - - url.Path = filepath.Clean(url.Path) } // Make sure it is lowercased