Commit 1f57d722 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/virtualbox: remap versions that don't have guest additions

parent 76c2fcee
...@@ -16,6 +16,11 @@ import ( ...@@ -16,6 +16,11 @@ import (
"time" "time"
) )
var additionsVersionMap = map[string]string {
"4.2.1": "4.2.0",
"4.1.23": "4.1.22",
}
// This step uploads a file containing the VirtualBox version, which // This step uploads a file containing the VirtualBox version, which
// can be useful for various provisioning reasons. // can be useful for various provisioning reasons.
// //
...@@ -35,6 +40,11 @@ func (s *stepDownloadGuestAdditions) Run(state map[string]interface{}) multistep ...@@ -35,6 +40,11 @@ func (s *stepDownloadGuestAdditions) Run(state map[string]interface{}) multistep
return multistep.ActionHalt return multistep.ActionHalt
} }
if newVersion, ok := additionsVersionMap[version]; ok {
log.Printf("Rewriting guest additions version: %s to %s", version, newVersion)
version = newVersion
}
// First things first, we get the list of checksums for the files available // First things first, we get the list of checksums for the files available
// for this version. // for this version.
checksumsUrl := fmt.Sprintf("http://download.virtualbox.org/virtualbox/%s/SHA256SUMS", version) checksumsUrl := fmt.Sprintf("http://download.virtualbox.org/virtualbox/%s/SHA256SUMS", version)
......
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