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

This commit is contained in:
Mitchell Hashimoto 2013-06-24 09:24:16 -07:00
parent 76c2fcee87
commit 1f57d722ff
1 changed files with 10 additions and 0 deletions

View File

@ -16,6 +16,11 @@ import (
"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
// can be useful for various provisioning reasons.
//
@ -35,6 +40,11 @@ func (s *stepDownloadGuestAdditions) Run(state map[string]interface{}) multistep
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
// for this version.
checksumsUrl := fmt.Sprintf("http://download.virtualbox.org/virtualbox/%s/SHA256SUMS", version)