Commit Graph

13 Commits

Author SHA1 Message Date
Megan Marsh d6d4eb2087 fix some tests and some config behavior to prevent null dereference errors and incorrect precedence between iso checksum and iso checksum url 2019-06-28 15:29:39 -07:00
Adrien Delorme 9f82b75e57 Use the hashicorp/go-getter to download files
* removed packer.Cache and references since packer.Cache is never used except in the download step. The download step now uses the new func packer.CachePath(targetPath) for this, the behavior is the same.
* removed download code from packer that was reimplemented into the go-getter library: progress bar, http download restart, checksuming from file, skip already downloaded files, symlinking, make a download cancellable by context.
* on windows if packer is running without symlinking rights and we are getting a local file, the file will be copied instead to avoid errors.
* added unit tests for step_download that are now CI tested on windows, mac & linux.
* files are now downloaded under cache dir `sha1(filename + "?checksum=" + checksum) + file_extension`
* since the output dir is based on the source url and the checksum, when the checksum fails, the file is auto deleted.
* a download file is protected and locked by a file lock,
* updated docs
* updated go modules and vendors
2019-03-13 12:11:58 +01:00
Megan Marsh 2a9f49a5c6 make sure we don't try to load an iso into memory because of a user mistake 2019-02-13 16:21:55 -08:00
Adrien Delorme 02ba6ccfab make common/iso_config_test.go invisible to windows 2018-10-16 18:41:27 +02:00
DanHam 7e478f650e
Remove tmp files created by common/ tests 2018-04-30 18:16:46 +01:00
Pavel Boldin 853b04420c iso_config: allow for subdirs in hash sum files
Allow hash sum files and ISOs to be in different directories as
Ubuntu does.

Signed-off-by: Pavel Boldin <boldin.pavel@gmail.com>
2017-11-13 09:28:43 +02:00
Rickard von Essen 97498f80be
core: iso_checksum_url should strip query param
When iso_urls contains query parameters these should be stripped when
searching the content of iso_checksum_url for a maching checksum.

Closes #5176
2017-07-27 07:21:39 +02:00
Mikhail Zholobov 57d07f227a
Add "iso_target_extension" option for all local *-iso builders
This option allows to set the extension of the ISO file after download.
Defaults to "iso". It makes sense for building Mac OS X guests, where the
bootable image is actually a DMG, not an ISO.
In particular, it is important for "parallels-iso" builder to set the right extension.
2016-12-17 12:50:30 +02:00
Taliesin Sisson e5510873bb Added file with correct line endings
When dealing with windows the file url format is file:///c:/
On windows a lot of git clients will convert LF to CRLF. This would be a problem where file contents are compared exactly
2016-12-12 22:44:51 +00:00
Matthew Hooker 54651e0005 fix parseCheckSumFile panic
resolves #3516
2016-10-14 00:56:05 -07:00
Vasiliy Tolstov 82c63bd723 iso_checksum: fix parsing with absent newline
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2016-07-03 12:06:31 +03:00
Rickard von Essen bbade5d8ae Added "iso_checksum_url" and keep the functionality of "iso_checksum"
Added support for file shema in "iso_checksum_url".
Added some unit tests and updated the docs accordingly.
2016-02-08 19:35:50 +01:00
Mark Peek cdcffecc2d Refactor builder ISO options
The ISO builders (parallels, qemu, virtualbox, and vmware) had too
much common code which needed to be maintained separately. This change
moves that code to a common ISO configuration.
2015-10-20 16:27:47 -07:00