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
71664cb3
Commit
71664cb3
authored
Aug 14, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common: return -1 download percent if download hasn't started [GH-288]
parent
62b87ee4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
5 deletions
+18
-5
CHANGELOG.md
CHANGELOG.md
+7
-0
builder/virtualbox/step_download_iso.go
builder/virtualbox/step_download_iso.go
+4
-1
builder/vmware/step_download_iso.go
builder/vmware/step_download_iso.go
+4
-1
common/download.go
common/download.go
+3
-3
No files found.
CHANGELOG.md
View file @
71664cb3
...
...
@@ -20,6 +20,13 @@ IMPROVEMENTS:
only check at execution.
*
command/build: A path of "-" will read the template from stdin.
BUG FIXES:
*
builder/virtualbox: dowload progress won't be shown until download
actually starts. [GH-288]
*
builder/vmware: dowload progress won't be shown until download
actually starts. [GH-288]
## 0.3.1 (August 12, 2013)
IMPROVEMENTS:
...
...
builder/virtualbox/step_download_iso.go
View file @
71664cb3
...
...
@@ -69,7 +69,10 @@ DownloadWaitLoop:
break
DownloadWaitLoop
case
<-
progressTicker
.
C
:
ui
.
Message
(
fmt
.
Sprintf
(
"Download progress: %d%%"
,
download
.
PercentProgress
()))
progress
:=
download
.
PercentProgress
()
if
progress
>=
0
{
ui
.
Message
(
fmt
.
Sprintf
(
"Download progress: %d%%"
,
progress
))
}
case
<-
time
.
After
(
1
*
time
.
Second
)
:
if
_
,
ok
:=
state
[
multistep
.
StateCancelled
];
ok
{
ui
.
Say
(
"Interrupt received. Cancelling download..."
)
...
...
builder/vmware/step_download_iso.go
View file @
71664cb3
...
...
@@ -71,7 +71,10 @@ DownloadWaitLoop:
break
DownloadWaitLoop
case
<-
progressTicker
.
C
:
ui
.
Say
(
fmt
.
Sprintf
(
"Download progress: %d%%"
,
download
.
PercentProgress
()))
progress
:=
download
.
PercentProgress
()
if
progress
>=
0
{
ui
.
Message
(
fmt
.
Sprintf
(
"Download progress: %d%%"
,
progress
))
}
case
<-
time
.
After
(
1
*
time
.
Second
)
:
if
_
,
ok
:=
state
[
multistep
.
StateCancelled
];
ok
{
ui
.
Say
(
"Interrupt received. Cancelling download..."
)
...
...
common/download.go
View file @
71664cb3
...
...
@@ -148,12 +148,12 @@ func (d *DownloadClient) Get() (string, error) {
}
// PercentProgress returns the download progress as a percentage.
func
(
d
*
DownloadClient
)
PercentProgress
()
u
int
{
func
(
d
*
DownloadClient
)
PercentProgress
()
int
{
if
d
.
downloader
==
nil
{
return
0
return
-
1
}
return
u
int
((
float64
(
d
.
downloader
.
Progress
())
/
float64
(
d
.
downloader
.
Total
()))
*
100
)
return
int
((
float64
(
d
.
downloader
.
Progress
())
/
float64
(
d
.
downloader
.
Total
()))
*
100
)
}
// VerifyChecksum tests that the path matches the checksum for the
...
...
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