Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
83772fc5
Commit
83772fc5
authored
Oct 27, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1509 from kamazee/fix_detecting_guest_additions_when_sysprop_empty
Fix detecting guest additions URL
parents
2d71bebe
3592d670
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
builder/virtualbox/common/driver_4_2.go
builder/virtualbox/common/driver_4_2.go
+4
-3
No files found.
builder/virtualbox/common/driver_4_2.go
View file @
83772fc5
...
...
@@ -49,11 +49,12 @@ func (d *VBox42Driver) Iso() (string, error) {
return
""
,
err
}
DefaultGuestAdditionsRe
:=
regexp
.
MustCompile
(
"Default Guest Additions ISO:(.
*
)"
)
DefaultGuestAdditionsRe
:=
regexp
.
MustCompile
(
"Default Guest Additions ISO:(.
+
)"
)
for
_
,
line
:=
range
strings
.
Split
(
stdout
.
String
(),
"
\n
"
)
{
// Need to trim off CR character when running in windows
line
=
strings
.
TrimRight
(
line
,
"
\r
"
)
// Trimming whitespaces at this point helps to filter out empty value
line
=
strings
.
TrimRight
(
line
,
"
\r
"
)
matches
:=
DefaultGuestAdditionsRe
.
FindStringSubmatch
(
line
)
if
matches
==
nil
{
...
...
@@ -66,7 +67,7 @@ func (d *VBox42Driver) Iso() (string, error) {
return
isoname
,
nil
}
return
""
,
fmt
.
Errorf
(
"Cannot find
\"
Default Guest Additions ISO
\"
in vboxmanage output"
)
return
""
,
fmt
.
Errorf
(
"Cannot find
\"
Default Guest Additions ISO
\"
in vboxmanage output
(or it is empty)
"
)
}
func
(
d
*
VBox42Driver
)
Import
(
name
string
,
path
string
,
flags
[]
string
)
error
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment