From 7c2475e886adf49946dc3d34e114e6d9de25966e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 24 Jun 2013 09:24:16 -0700 Subject: [PATCH] builder/virtualbox: remap versions that don't have guest additions --- builder/virtualbox/step_download_guest_additions.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/builder/virtualbox/step_download_guest_additions.go b/builder/virtualbox/step_download_guest_additions.go index f28d9cd90..759336bb2 100644 --- a/builder/virtualbox/step_download_guest_additions.go +++ b/builder/virtualbox/step_download_guest_additions.go @@ -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)