Commit a380391b authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

common: allow files that don't exist to be URLs [GH-683]

parent 2dad0cdc
...@@ -11,6 +11,7 @@ BUG FIXES: ...@@ -11,6 +11,7 @@ BUG FIXES:
* core: Don't change background color on CLI anymore, making things look * core: Don't change background color on CLI anymore, making things look
a tad nicer in some terminals. 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 * builder/amazon/chroot: Block when obtaining file lock to allow
parallel builds. [GH-689] parallel builds. [GH-689]
* builder/vmware: Cleanup of VMX keys works properly so cd-rom won't * builder/vmware: Cleanup of VMX keys works properly so cd-rom won't
......
...@@ -105,10 +105,9 @@ func DownloadableURL(original string) (string, error) { ...@@ -105,10 +105,9 @@ func DownloadableURL(original string) (string, error) {
url.Path = strings.Replace(url.Path, `\`, `/`, -1) url.Path = strings.Replace(url.Path, `\`, `/`, -1)
} }
if _, err := os.Stat(url.Path); err != nil { // Only do the filepath transformations if the file appears
return "", err // to actually exist.
} if _, err := os.Stat(url.Path); err == nil {
url.Path, err = filepath.Abs(url.Path) url.Path, err = filepath.Abs(url.Path)
if err != nil { if err != nil {
return "", err return "", err
...@@ -121,6 +120,7 @@ func DownloadableURL(original string) (string, error) { ...@@ -121,6 +120,7 @@ func DownloadableURL(original string) (string, error) {
url.Path = filepath.Clean(url.Path) url.Path = filepath.Clean(url.Path)
} }
}
// Make sure it is lowercased // Make sure it is lowercased
url.Scheme = strings.ToLower(url.Scheme) url.Scheme = strings.ToLower(url.Scheme)
......
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