From patchwork Fri Jun 22 05:42:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 166505 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id EE97FB6EE7 for ; Fri, 22 Jun 2012 15:44:26 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B7F9F8B6CB; Fri, 22 Jun 2012 05:44:21 +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 g8FrJFcTEYi8; Fri, 22 Jun 2012 05:44:20 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id E00DC8BDBE; Fri, 22 Jun 2012 05:44:16 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 9F38B8F753 for ; Fri, 22 Jun 2012 05:43:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 106108C9EF for ; Fri, 22 Jun 2012 05:43:30 +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 bv5uLrPorlDh for ; Fri, 22 Jun 2012 05:43:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ey0-f171.google.com (mail-ey0-f171.google.com [209.85.215.171]) by whitealder.osuosl.org (Postfix) with ESMTPS id 9C9628CA25 for ; Fri, 22 Jun 2012 05:43:22 +0000 (UTC) Received: by mail-ey0-f171.google.com with SMTP id a12so805328eaa.16 for ; Thu, 21 Jun 2012 22:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:content-transfer-encoding:subject :x-mercurial-node:message-id:in-reply-to:references:user-agent:date :from:to:cc; bh=EhUxKB4Sz55tfLnBjkgSzyLxl1gEij1+fEAZ1+YYXNQ=; b=RtlpCJrNwNBT7FgTTFZVtUnMBnnX58QKsMgJpPnT1E8mJnARZ9P0X753++d0IE2qt1 AkTPnGqUOz7GOrZKPs77Ngh1xx5gSsa2O21nlMC0IasZl55B9xUozgIf/4tN5qsz+KeA /TwFT7WqP5MImSn1cRpEn+Vai7qw/0BDKI9Ahho5lDGvAUsiUN/7sP1OCf/3RHCOMbm0 al30V4fj4EfU8ZUAGFw7gZfYPKWTbsy6Sb3YmZgIEC4LfHExlVk6MHXZfjlInznw5BEY ZLPyQg3okb1CL/CAY4vjXD850IAvFFEyMHqNjnUuJ4W4L7A+CHsidEkTPx+fdAWab0A1 rUEw== Received: by 10.14.98.201 with SMTP id v49mr155672eef.210.1340343802139; Thu, 21 Jun 2012 22:43:22 -0700 (PDT) Received: from [127.0.1.1] (d54C62EEB.access.telenet.be. [84.198.46.235]) by mx.google.com with ESMTPS id c51sm109212458eei.12.2012.06.21.22.43.20 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jun 2012 22:43:21 -0700 (PDT) MIME-Version: 1.0 X-Mercurial-Node: 8cbde66c4041f84f6c45a28673db8b99a5aa7470 Message-Id: <8cbde66c4041f84f6c45.1340343756@beantl019720> In-Reply-To: References: User-Agent: Mercurial-patchbomb/2.0.2 Date: Fri, 22 Jun 2012 07:42:36 +0200 From: Thomas De Schampheleire To: buildroot@busybox.net Subject: [Buildroot] [PATCH 3 of 6 resend] pkg-download.mk: support detection of URI schemes in DOWNLOAD X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net When using one of the package infrastructures, the DOWNLOAD function uses $(PKG)_SITE_METHOD to determine the appropriate download method, which is autodetected based on the URI if none was explicitly set. When the DOWNLOAD function is called directly, for example when downloading a toolchain, or from a package that does not use one of the package infrastructures, the SITE_METHOD is not autodetected, and thus the download defaults to wget. This patch adds URI scheme detection directly to the DOWNLOAD method, in case no SITE_METHOD was detected yet. Signed-off-by: Thomas De Schampheleire Acked-by: Arnout Vandecappelle (Essensium/Mind) --- package/pkg-download.mk | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/package/pkg-download.mk b/package/pkg-download.mk --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -211,7 +211,12 @@ define DOWNLOAD_INNER esac ; \ fi ; \ if test -n "$(1)" ; then \ - case "$($(PKG)_SITE_METHOD)" in \ + if test -z "$($(PKG)_SITE_METHOD)" ; then \ + scheme="$(call geturischeme,$(1))" ; \ + else \ + scheme="$($(PKG)_SITE_METHOD)" ; \ + fi ; \ + case "$$scheme" in \ git) $($(DL_MODE)_GIT) && exit ;; \ svn) $($(DL_MODE)_SVN) && exit ;; \ bzr) $($(DL_MODE)_BZR) && exit ;; \