pkg-generic: fix the logic showing the "Downloading" message
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 29 Mar 2015 17:33:16 +0000 (19:33 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 30 Mar 2015 21:38:40 +0000 (23:38 +0200)
Even though the .stamp_downloaded target is executed for each package
being built, the pkg-generic infrastructure tries to not display the
"Downloading" message when there is in fact nothing to download.

Unfortunately, the logic was incorrect for the patch download: it
forgot the fact that <pkg>_PATCH can contain either file names (in
which case we assume the patch should be downloaded from <pkg>_SITE),
or full URLs. The latter case was not properly handled, as we were
checking if $(DL_DIR)/<full URL> existed, while we should be testing
if $(DL_DIR)/`basename <full URL>` exists.

This patch fixes that, which makes sure the "Downloading" message is
displayed only when necessary.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Romain Naour <romain.naour@openwide.fr>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
package/pkg-generic.mk

index c1b379bf87847ed446681c6d55e8f08db4c7ac77..b44d476379b1297a9666cb929d7ac5beed57bc79 100644 (file)
@@ -77,7 +77,7 @@ ifeq ($(DL_MODE),DOWNLOAD)
                $(call MESSAGE,"Downloading") ; \
        else \
                for p in $($(PKG)_PATCH) ; do \
-                       if test ! -e $(DL_DIR)/$$p ; then \
+                       if test ! -e $(DL_DIR)/`basename $$p` ; then \
                                $(call MESSAGE,"Downloading") ; \
                                break ; \
                        fi ; \