From patchwork Mon Apr 15 19:47:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1085882 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=free.fr Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gtikcE9o"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44jfDM0FKFz9s0W for ; Tue, 16 Apr 2019 05:47:46 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0821C863A6; Mon, 15 Apr 2019 19:47:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FTq8SBkbLRHE; Mon, 15 Apr 2019 19:47:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id C981C86614; Mon, 15 Apr 2019 19:47:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id A1C651BF37A for ; Mon, 15 Apr 2019 19:47:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9D1B622802 for ; Mon, 15 Apr 2019 19:47:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z5SpcaevBx34 for ; Mon, 15 Apr 2019 19:47:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by silver.osuosl.org (Postfix) with ESMTPS id 5290B1FEE0 for ; Mon, 15 Apr 2019 19:47:39 +0000 (UTC) Received: by mail-wr1-f44.google.com with SMTP id k11so23536709wro.5 for ; Mon, 15 Apr 2019 12:47:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=d+2NWCDo15wldlErAcVfLETMTJeQXQTthFo2O0bYZJU=; b=gtikcE9oSjp6WAJodJi8r2947wJyAZ/0d5c2I2Mc9aMHimau4+NSt1evFLEfMjoZat nR+yUwNCPfrXC7FxqN2DzUS11MSGEQsCM8zNm+QVgS/HXGI3de8wIxAWNodiCS0oRygo EyZDwNtLWmGWA9Afb5qkE7f+LUYjuabiQMjPgUKw6BYW7TG3XpKvot0pm7ZHzCIKR3N8 9hBzt4MsomwegTSFNyGD2UPruMmCYOpB3w53xbigxd1gstBJbhmA5pZdoXwB/aOeqOXk r5/l9gyqRgcw40MOycdSIef9+yMKEcENMnu7dnfNOjW1kWleRa9NKS7XZPpMT2pJeMRX CHFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=d+2NWCDo15wldlErAcVfLETMTJeQXQTthFo2O0bYZJU=; b=frcqPYmxmm1xDxqe9FiPSVbqZKf5KawOVjNdTwhyqIcF9Qi6QBTCW3VQ0w8qTtJTDq Mamxj1rWWF7oelo850qvGfzSIDti533e7NqgY/fdAC4NY52h4PO8n1WsyKITO/4naJFb acEZyFmBOR3eQEJ9oG7AG3cuGjva/t6ykfhlhB+r4mb1AM8XLaIpUYuBRcpH2O1O36bQ mgaDbA+M9288Qr4mqq28N1y+qW0UM6QFJILq1jMxEzuZxoRsZ4ykatw1/AsxlVf7o+v0 Uk31xJ0joD5Etc7o5o8IuFFHvqLnJnm6Pl9fJqM451O3obBDyfa5uVpmAEfBhXQSSm3u oLbA== X-Gm-Message-State: APjAAAUclJn2/pK4efZYLmRYigT08++LxWvW9Bcs2wslTH6kmJOExFoU W8Lmm62aEp4h2o/AxKg1wnwKSQvo X-Google-Smtp-Source: APXvYqzUDIFU4m6JqBK2YMok9TDzrPuNw4QlzQLWxI+OkPLoymL+h1nHwkqzJm8z5B/Lp/z389TkBg== X-Received: by 2002:adf:fd46:: with SMTP id h6mr50616011wrs.139.1555357657736; Mon, 15 Apr 2019 12:47:37 -0700 (PDT) Received: from scaer.home ([2a01:cb19:829a:2800:68e8:7a61:9bb9:12a]) by smtp.gmail.com with ESMTPSA id z74sm1479222wmc.2.2019.04.15.12.47.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2019 12:47:37 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Mon, 15 Apr 2019 21:47:24 +0200 Message-Id: <493aca4729625cdaa2db75df867863f79cf9833b.1555357644.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: Subject: [Buildroot] [PATCH 02/12 v3] infra/pkg-download: make the URI list a callable macro X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas De Schampheleire , "Yann E. MORIN" , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently, that variable is context-dependent, as it expects the PKG variable to exist and be defined to the current package. This is not so clean, so change the variable to a callable macro. Adapt the caller accordingly. Signed-off-by: "Yann E. MORIN" Cc: Thomas De Schampheleire Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- Changes v1 -> v2: - split DOWNLOAD/DOWNLOAD_URIS comment (Thomas DS) --- package/pkg-download.mk | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/package/pkg-download.mk b/package/pkg-download.mk index 4163333998..623caf9325 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -63,19 +63,19 @@ github = https://github.com/$(1)/$(2)/archive/$(3) export BR_NO_CHECK_HASH_FOR = ################################################################################ -# DOWNLOAD -- Download helper. Will call DL_WRAPPER which will try to download -# source from: +# DOWNLOAD_URIS - List the candidates URIs where to get the package from: # 1) BR2_PRIMARY_SITE if enabled # 2) Download site, unless BR2_PRIMARY_SITE_ONLY is set # 3) BR2_BACKUP_SITE if enabled, unless BR2_PRIMARY_SITE_ONLY is set # # Argument 1 is the source location +# Argument 2 is the upper-case package name # ################################################################################ ifneq ($(call qstrip,$(BR2_PRIMARY_SITE)),) DOWNLOAD_URIS += \ - $(call getschemeplusuri,$(call qstrip,$(BR2_PRIMARY_SITE)/$($(PKG)_DL_SUBDIR)),urlencode) \ + $(call getschemeplusuri,$(call qstrip,$(BR2_PRIMARY_SITE)/$($(2)_DL_SUBDIR)),urlencode) \ $(call getschemeplusuri,$(call qstrip,$(BR2_PRIMARY_SITE)),urlencode) endif @@ -84,11 +84,19 @@ DOWNLOAD_URIS += \ $(patsubst %/,%,$(dir $(call qstrip,$(1)))) ifneq ($(call qstrip,$(BR2_BACKUP_SITE)),) DOWNLOAD_URIS += \ - $(call getschemeplusuri,$(call qstrip,$(BR2_BACKUP_SITE)/$($(PKG)_DL_SUBDIR)),urlencode) \ + $(call getschemeplusuri,$(call qstrip,$(BR2_BACKUP_SITE)/$($(2)_DL_SUBDIR)),urlencode) \ $(call getschemeplusuri,$(call qstrip,$(BR2_BACKUP_SITE)),urlencode) endif endif +################################################################################ +# DOWNLOAD -- Download helper. Will call DL_WRAPPER which will try to download +# source from the list returned by DOWNLOAD_URIS. +# +# Argument 1 is the source location +# +################################################################################ + define DOWNLOAD $(Q)mkdir -p $($(PKG)_DL_DIR) $(Q)$(EXTRA_ENV) $(FLOCK) $(DL_WRAPPER) \ @@ -101,7 +109,7 @@ define DOWNLOAD -N '$($(PKG)_RAWNAME)' \ -o '$($(PKG)_DL_DIR)/$(notdir $(1))' \ $(if $($(PKG)_GIT_SUBMODULES),-r) \ - $(foreach uri,$(DOWNLOAD_URIS),-u $(uri)) \ + $(foreach uri,$(call DOWNLOAD_URIS,$(1),$(PKG)),-u $(uri)) \ $(QUIET) \ -- \ $($(PKG)_DL_OPTS)