Skip to content

Commit

Permalink
Ensure INSTALL_PATH directory is readable by all users (#1320)
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Boardwell authored May 31, 2021
1 parent 066e325 commit 59be722
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tasks/Makefile.downloads
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Macros to download a binary release from GitHub and install it
# $(call github_download_binary_release,version,repo,asset)
define download_binary
mkdir -p $(INSTALL_PATH)
mkdir -p -m a+rX $(INSTALL_PATH)
$(CURL) -o $(INSTALL_PATH)/$(PACKAGE_EXE) $(DOWNLOAD_URL) && chmod +x $(INSTALL_PATH)/$(PACKAGE_EXE)
endef

download/binary:
$(call download_binary)

define download_binary_gz
mkdir -p $(INSTALL_PATH)
mkdir -p -m a+rX $(INSTALL_PATH)
$(CURL) -o $(INSTALL_PATH)/$(PACKAGE_NAME).gz $(DOWNLOAD_URL)
gunzip -f -k -q $(INSTALL_PATH)/$(PACKAGE_NAME).gz
chmod +x $(INSTALL_PATH)/$(PACKAGE_EXE)
Expand All @@ -20,7 +20,7 @@ download/binary/gz:
$(call download_binary_gz)

define download_binary_bz2
mkdir -p $(INSTALL_PATH)
mkdir -p -m a+rX $(INSTALL_PATH)
$(CURL) -o $(INSTALL_PATH)/$(PACKAGE_NAME).bz2 $(DOWNLOAD_URL)
bzip2 -d -f -k -q $(INSTALL_PATH)/$(PACKAGE_NAME).bz2
chmod +x $(INSTALL_PATH)/$(PACKAGE_EXE)
Expand All @@ -31,6 +31,7 @@ download/binary/bz2:
$(call download_binary_bz2)

define download_tarball
mkdir -p -m a+rX $(INSTALL_PATH)
[ -n "$(TMP)" ] && [ -n "$(PACKAGE_NAME)" ] && rm -rf "$(TMP)/$(PACKAGE_NAME)"
mkdir -p $(TMP)/$(PACKAGE_NAME)
$(CURL) -o - $(DOWNLOAD_URL) | tar -zx -C '$(TMP)/$(PACKAGE_NAME)'
Expand All @@ -43,6 +44,7 @@ download/tarball:
$(call download_tarball)

define download_tar_bz2
mkdir -p -m a+rX $(INSTALL_PATH)
[ -n "$(TMP)" ] && [ -n "$(PACKAGE_NAME)" ] && rm -rf "$(TMP)/$(PACKAGE_NAME)"
mkdir -p $(TMP)/$(PACKAGE_NAME)
$(CURL) -o - $(DOWNLOAD_URL) | tar -jx -C $(TMP)/$(PACKAGE_NAME)
Expand All @@ -55,6 +57,7 @@ download/tar/bz2:
$(call download_tar_bz2)

define download_tar_gz
mkdir -p -m a+rX $(INSTALL_PATH)
[ -n "$(TMP)" ] && [ -n "$(PACKAGE_NAME)" ] && rm -rf "$(TMP)/$(PACKAGE_NAME)"
mkdir -p $(TMP)/$(PACKAGE_NAME)
$(CURL) -o - $(DOWNLOAD_URL) | tar -zx -C $(TMP)/$(PACKAGE_NAME)
Expand All @@ -67,6 +70,7 @@ download/tar/gz:
$(call download_tar_gz)

define download_tar_xz
mkdir -p -m a+rX $(INSTALL_PATH)
[ -n "$(TMP)" ] && [ -n "$(PACKAGE_NAME)" ] && rm -rf "$(TMP)/$(PACKAGE_NAME)"
mkdir -p $(TMP)/$(PACKAGE_NAME)
$(CURL) -o - $(DOWNLOAD_URL) | tar -Jx -C $(TMP)/$(PACKAGE_NAME)
Expand All @@ -79,6 +83,7 @@ download/tar/xz:
$(call download_tar_xz)

define download_zip
mkdir -p -m a+rX $(INSTALL_PATH)
[ -n "$(TMP)" ] && [ -n "$(PACKAGE_NAME)" ] && rm -rf "$(TMP)/$(PACKAGE_NAME)"
mkdir -p $(TMP)/$(PACKAGE_NAME)
$(CURL) -L -o $(TMP)/$(PACKAGE_NAME)/$(PACKAGE_NAME).zip $(DOWNLOAD_URL)
Expand All @@ -92,6 +97,7 @@ download/zip:
$(call download_zip)

define download_gz
mkdir -p -m a+rX $(INSTALL_PATH)
[ -n "$(TMP)" ] && [ -n "$(PACKAGE_NAME)" ] && rm -rf "$(TMP)/$(PACKAGE_NAME)"
mkdir -p $(TMP)/$(PACKAGE_NAME)
$(CURL) -L -o $(TMP)/$(PACKAGE_NAME)/$(PACKAGE_NAME).gz $(DOWNLOAD_URL)
Expand Down

0 comments on commit 59be722

Please sign in to comment.