http_prebuilt: Improve retrieval of artifacts from archive

The current version always redownloads the artifact.
Kali does not like the nested md5sum command and ignores it
leaving file checksum value blank so the test always fails.
A temporary variable is used to get around this limitation
of kali.

The echo "Downloading..." command has been modified to actually
print and has been moved so it only does so when downloading
the artifact.

Change-Id: I115860a87e55399a652d6548fe50f6204337f854
gugelfrei
David Marble 8 years ago
parent 0e57974630
commit 20c06fd75e

@ -47,11 +47,13 @@ define curl-checksum
endef
define audit-checksum
@echo "Downloading: $(filename) (version $(version))" -> $(filepath);
$(hide) if [ ! -f $(filepath) ]; then \
echo "Downloading: $(filename) (version $(version)) -> $(filepath)"; \
$(call download-prebuilt-module, $(HTTP_FILE_URL),$(filepath)) \
else \
if [ "$(shell echo $(md5sum $(filepath)))" != "$(shell cat $(checksum) | cut -d ' ' -f1)" ]; then \
temp_checksum=$(shell md5sum $(filepath) | cut -d ' ' -f1); \
if [ "$$temp_checksum" != "$(shell cat $(checksum) | cut -d ' ' -f1)" ]; then \
echo "Downloading: $(filename) (version $(version)) -> $(filepath)"; \
rm -rf $(filepath); \
$(call download-prebuilt-module, $(HTTP_FILE_URL),$(filepath)) \
fi; \

Loading…
Cancel
Save