Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Packer
Commits
bda45c1b
Commit
bda45c1b
authored
11 years ago
by
Mitchell Hashimoto
Browse files
Options
Download
Email Patches
Plain Diff
builder/virtualbox: remove unused function
parent
4188e07f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
builder/virtualbox/step_download_guest_additions.go
+0
-42
builder/virtualbox/step_download_guest_additions.go
with
0 additions
and
42 deletions
+0
-42
builder/virtualbox/step_download_guest_additions.go
+
0
-
42
View file @
bda45c1b
...
...
@@ -11,7 +11,6 @@ import (
"log"
"os"
"strings"
"time"
)
var
additionsVersionMap
=
map
[
string
]
string
{
...
...
@@ -106,47 +105,6 @@ func (s *stepDownloadGuestAdditions) Run(state map[string]interface{}) multistep
func
(
s
*
stepDownloadGuestAdditions
)
Cleanup
(
state
map
[
string
]
interface
{})
{}
func
(
s
*
stepDownloadGuestAdditions
)
progressDownload
(
c
*
common
.
DownloadClient
,
state
map
[
string
]
interface
{})
(
string
,
multistep
.
StepAction
)
{
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
var
result
string
downloadCompleteCh
:=
make
(
chan
error
,
1
)
// Start a goroutine to actually do the download...
go
func
()
{
var
err
error
result
,
err
=
c
.
Get
()
downloadCompleteCh
<-
err
}()
progressTicker
:=
time
.
NewTicker
(
5
*
time
.
Second
)
defer
progressTicker
.
Stop
()
// A loop that handles showing progress as well as timing out and handling
// interrupts and all that.
DownloadWaitLoop
:
for
{
select
{
case
err
:=
<-
downloadCompleteCh
:
if
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
"Error downloading: %s"
,
err
)
return
""
,
multistep
.
ActionHalt
}
break
DownloadWaitLoop
case
<-
progressTicker
.
C
:
ui
.
Message
(
fmt
.
Sprintf
(
"Download progress: %d%%"
,
c
.
PercentProgress
()))
case
<-
time
.
After
(
1
*
time
.
Second
)
:
if
_
,
ok
:=
state
[
multistep
.
StateCancelled
];
ok
{
ui
.
Say
(
"Interrupt received. Cancelling download..."
)
return
""
,
multistep
.
ActionHalt
}
}
}
return
result
,
multistep
.
ActionContinue
}
func
(
s
*
stepDownloadGuestAdditions
)
downloadAdditionsSHA256
(
state
map
[
string
]
interface
{},
additionsVersion
string
,
additionsName
string
)
(
string
,
multistep
.
StepAction
)
{
// First things first, we get the list of checksums for the files available
// for this version.
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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