Skip to content

Commit

Permalink
build: use different progress flags based on the wget version
Browse files Browse the repository at this point in the history
The Unikraft build system uses the `--show-progress` flag for
Wget1. This flag has been renamed to `--force-progress` in Wget2.
That's why we need to check the version of Wget before using either
one of the flags. There's a list of CLI changes from Wget1 to Wget2
here:

https://gitlab.com/gnuwget/wget2/-/wikis/Home

Signed-off-by: Thassilo Schulze <[email protected]>
Reviewed-by: Cezar Craciunoiu <[email protected]>
Reviewed-by: Stefan Jumarea <[email protected]>
Reviewed-by: Razvan Deaconescu <[email protected]>
Approved-by: Simon Kuenzer <[email protected]>
GitHub-Closes: unikraft#1442
  • Loading branch information
thass0 authored and unikraft-bot committed Oct 14, 2024
1 parent f1dd5d6 commit eaf6fda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,11 @@ GZIP := gzip
TAR := tar
UNZIP := unzip -qq -u
GIT := git
WGET := wget
ifneq (,$(findstring Wget2,$(shell wget --version)))
WGET := wget -q --force-progress --progress=bar
else
WGET := wget -q --show-progress --progress=bar
endif
PYTHON := python3
SHA1SUM := sha1sum -b
SHA256SUM := sha256sum -b
Expand Down
6 changes: 3 additions & 3 deletions support/build/Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ endef
define fetchas =
$(BUILD_DIR)/$(1)/$(3):
$(call verbose_cmd,WGET,$(1)':' $(2), \
$(WGET) -q --show-progress --progress=bar -O $(BUILD_DIR)/$(1)/$(3) $(2) || \
$(WGET) -O $(BUILD_DIR)/$(1)/$(3) $(2) || \
$(RM) $(BUILD_DIR)/$(1)/$(3))

$(call _chksum_origin,$(1),$(BUILD_DIR)/$(1)/$(3),$(BUILD_DIR)/$(1)/.chksum)
Expand All @@ -541,8 +541,8 @@ endef
define fetchas2 =
$(BUILD_DIR)/$(1)/$(4):
$(call verbose_cmd,WGET,$(1)':' $(2) [retry-with: $(3)], \
$(WGET) -q --show-progress --progress=bar -O $(BUILD_DIR)/$(1)/$(4) $(2) || \
$(WGET) -q --show-progress --progress=bar -O $(BUILD_DIR)/$(1)/$(4) $(3) || \
$(WGET) -O $(BUILD_DIR)/$(1)/$(4) $(2) || \
$(WGET) -O $(BUILD_DIR)/$(1)/$(4) $(3) || \
$(RM) $(BUILD_DIR)/$(1)/$(4))

$(call _chksum_origin,$(1),$(BUILD_DIR)/$(1)/$(4),$(BUILD_DIR)/$(1)/.chksum)
Expand Down

0 comments on commit eaf6fda

Please sign in to comment.