Merge pull request #1333 from hnakamur/accept_virtualbox_release_candidate_version

builder/virtualbox: Accept VirtualBox release candidate version
This commit is contained in:
Mitchell Hashimoto 2014-07-19 09:41:38 -07:00
commit 0552b65c5f
1 changed files with 3 additions and 3 deletions

View File

@ -186,9 +186,9 @@ func (d *VBox42Driver) Version() (string, error) {
return "", fmt.Errorf("VirtualBox is not properly setup: %s", versionOutput)
}
versionRe := regexp.MustCompile("[^.0-9]")
matches := versionRe.Split(versionOutput, 2)
if len(matches) == 0 || matches[0] == "" {
versionRe := regexp.MustCompile("^[.0-9]+(?:_RC[0-9]+)?")
matches := versionRe.FindAllString(versionOutput, 1)
if matches == nil {
return "", fmt.Errorf("No version found: %s", versionOutput)
}