From: Thomas Petazzoni Date: Sun, 29 Mar 2015 17:33:18 +0000 (+0200) Subject: pkg-generic: refactor the "Downloading" message logic X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59e19c7e243c09513b5e133446691cdd68101475;p=buildroot.git pkg-generic: refactor the "Downloading" message logic In the .stamp_downloaded hook, the logic to decide whether or not to display the "Downloading" message is treating the check of _SOURCE as a special case. But in fact, there is no real reason to do so: the existing loop used for _PATCH and _EXTRA_DOWNLOADS could work just as well. This commit therefore refactors this piece of code, to have a single loop checking _SOURCE, _PATCH and _EXTRA_DOWNLOADS. Signed-off-by: Thomas Petazzoni Acked-by: "Yann E. MORIN" --- diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 003fd693d6..3c868780bf 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -73,16 +73,12 @@ $(BUILD_DIR)/%/.stamp_downloaded: $(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep)) ifeq ($(DL_MODE),DOWNLOAD) # Only show the download message if it isn't already downloaded - $(Q)if test ! -e $(DL_DIR)/$($(PKG)_SOURCE); then \ - $(call MESSAGE,"Downloading") ; \ - else \ - for p in $($(PKG)_PATCH) $($(PKG)_EXTRA_DOWNLOADS) ; do \ - if test ! -e $(DL_DIR)/`basename $$p` ; then \ - $(call MESSAGE,"Downloading") ; \ - break ; \ - fi ; \ - done ; \ - fi + $(Q)for p in $($(PKG)_SOURCE) $($(PKG)_PATCH) $($(PKG)_EXTRA_DOWNLOADS) ; do \ + if test ! -e $(DL_DIR)/`basename $$p` ; then \ + $(call MESSAGE,"Downloading") ; \ + break ; \ + fi ; \ + done endif $(if $($(PKG)_SOURCE),$(call DOWNLOAD,$($(PKG)_SITE:/=)/$($(PKG)_SOURCE))) $(foreach p,$($(PKG)_EXTRA_DOWNLOADS),$(call DOWNLOAD,$($(PKG)_SITE:/=)/$(p))$(sep))