mirror of
https://github.com/hashicorp/packer.git
synced 2026-10-21 21:52:10 -04:00
builder/virtualbox: remap versions that don't have guest additions
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user