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
cbbc8de8
Commit
cbbc8de8
authored
Jun 09, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/vmware: Properly check MD5
parent
e2214106
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
builder/vmware/step_download_iso.go
builder/vmware/step_download_iso.go
+3
-2
No files found.
builder/vmware/step_download_iso.go
View file @
cbbc8de8
...
...
@@ -2,6 +2,7 @@ package vmware
import
(
"crypto/md5"
"encoding/hex"
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
...
...
@@ -105,7 +106,7 @@ func (stepDownloadISO) checkMD5(path string, expected string) error {
hash
:=
md5
.
New
()
io
.
Copy
(
hash
,
f
)
result
:=
strings
.
ToLower
(
s
tring
(
hash
.
Sum
(
nil
)))
result
:=
strings
.
ToLower
(
hex
.
EncodeToS
tring
(
hash
.
Sum
(
nil
)))
if
result
!=
expected
{
return
fmt
.
Errorf
(
"result != expected: %s != %s"
,
result
,
expected
)
}
...
...
@@ -116,7 +117,7 @@ func (stepDownloadISO) checkMD5(path string, expected string) error {
func
(
stepDownloadISO
)
downloadUrl
(
path
string
,
url
*
url
.
URL
,
progress
*
uint
)
(
string
,
error
)
{
if
url
.
Scheme
==
"file"
{
// If it is just a file URL, then we already have the ISO
return
p
ath
,
nil
return
url
.
P
ath
,
nil
}
// Otherwise, it is an HTTP URL, and we must download it.
...
...
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