From a8cc8a5597ce1079efe2b00ce6b1c110274e00f1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 20 Mar 2021 09:37:41 +0100 Subject: [PATCH] - small changes to DOWNLOAD and EXTRACT macros --- make/buildsystem-helpers.mk | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/make/buildsystem-helpers.mk b/make/buildsystem-helpers.mk index 23295463..6dffb048 100644 --- a/make/buildsystem-helpers.mk +++ b/make/buildsystem-helpers.mk @@ -9,39 +9,39 @@ download = wget --no-check-certificate -t3 -T60 -c -P $(DL_DIR) WGET_DOWNLOAD = wget --no-check-certificate -t3 -T60 -c -P define DOWNLOAD + $(call MESSAGE,"Downloading") + $(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep)) $(Q)( \ if [ "$($(PKG)_VER)" == "git" ]; then \ - $(call MESSAGE,"Downloading") ; \ $(GET-GIT-SOURCE) $($(PKG)_SITE)/$($(PKG)_SOURCE) $(DL_DIR)/$($(PKG)_SOURCE); \ - else \ - if [ ! -f $(DL_DIR)/$($(PKG)_SOURCE) ]; then \ - $(call MESSAGE,"Downloading") ; \ + elif [ "$($(PKG)_VER)" == "svn" ]; then \ + $(GET-SVN-SOURCE) $($(PKG)_SITE)/$($(PKG)_SOURCE) $(DL_DIR)/$($(PKG)_SOURCE); \ + elif [ ! -f $(DL_DIR)/$(1) ]; then \ $(WGET_DOWNLOAD) $(DL_DIR) $($(PKG)_SITE)/$(1); \ - fi; \ fi; \ ) + $(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep)) endef # ----------------------------------------------------------------------------- -# unpack archives into build directory -define EXTRACT +# unpack archives into given directory +define EXTRACT # (directory) @$(call MESSAGE,"Extracting") + $(foreach hook,$($(PKG)_PRE_EXTRACT_HOOKS),$(call $(hook))$(sep)) $(Q)( \ case $($(PKG)_SOURCE) in \ *.tar | *.tar.bz2 | *.tbz | *.tar.gz | *.tgz | *.tar.xz | *.txz) \ - tar -xf ${DL_DIR}/$($(PKG)_SOURCE) -C ${1}; \ + tar -xf ${DL_DIR}/$($(PKG)_SOURCE) -C $(1); \ ;; \ *.zip) \ - unzip -o -q ${DL_DIR}/$($(PKG)_SOURCE) -d ${1}; \ + unzip -o -q ${DL_DIR}/$($(PKG)_SOURCE) -d $(1); \ ;; \ *.git) \ - cp -a -t ${1} $(DL_DIR)/$($(PKG)_SOURCE); \ - if test -z $($(PKG)_CHECKOUT); then \ - $(call MESSAGE,"use original head"); \ - else \ + cp -a -t $(1) $(DL_DIR)/$($(PKG)_SOURCE); \ + if test $($(PKG)_CHECKOUT); then \ $(call MESSAGE,"git checkout $($(PKG)_CHECKOUT)"); \ - $(CD) ${1}/$($(PKG)_DIR); git checkout -q $($(PKG)_CHECKOUT); \ + $(CD) $(1)/$($(PKG)_DIR); git checkout $($(PKG)_CHECKOUT); \ fi; \ ;; \ *) \ @@ -49,6 +49,7 @@ define EXTRACT false ;; \ esac \ ) + $(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep)) endef # -----------------------------------------------------------------------------