From patchwork Mon Jun 30 22:26:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 365788 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id E21B21400D5 for ; Tue, 1 Jul 2014 08:27:11 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 962F88B737; Mon, 30 Jun 2014 22:27:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mNxl1E_Bk630; Mon, 30 Jun 2014 22:26:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8BAD48B214; Mon, 30 Jun 2014 22:26:54 +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 165A11C1654 for ; Mon, 30 Jun 2014 22:26:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 121CB8BD0E for ; Mon, 30 Jun 2014 22:26:47 +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 5d7rWBgYwpNL for ; Mon, 30 Jun 2014 22:26:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by whitealder.osuosl.org (Postfix) with ESMTPS id 664648BCCF for ; Mon, 30 Jun 2014 22:26:46 +0000 (UTC) Received: by mail-we0-f177.google.com with SMTP id u56so8666965wes.8 for ; Mon, 30 Jun 2014 15:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=bxi80PS2AvqR7iDsgsvLDlVDeIJYz8gJV04UbggcsjU=; b=CtcLtzZlNaVE5IV35F/tzRzqz5e3Xt8HSLkz0W9jJd6qWF63VBmi/9bXwRhXGQaQsP uvvwMHEEBi0Y87frPfIAJKInU/tDY1lQgQlqboIw/wIf6hWh9GDeDIa0V4AtI1WgtyRL YjY1sBeNy2b05pv4Y1C7R/BuDtLAnAsA2c7mKfKCCgNB26MVXS6hLgaAUrTUhCrzkfxE 17qu/HdlbSLV3bzvYMu7X5CS2cNxoikAYlACwrSu4o15arqmwmKQiJz+NQqwAHzhvQW+ lJX4dvhhVrZy+rbwttyJMaF5zCBlFHIRNSsSeOSZo9WyEROrYFf3qNtH8/0SakCJNYk6 VDrw== X-Received: by 10.180.24.66 with SMTP id s2mr31557622wif.33.1404167204898; Mon, 30 Jun 2014 15:26:44 -0700 (PDT) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id o12sm36042951wiw.5.2014.06.30.15.26.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Jun 2014 15:26:44 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Tue, 1 Jul 2014 00:26:27 +0200 Message-Id: <44de367b5fd40f793cc57569c9d6895a86e39133.1404167061.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 09/14] pkg-infra: move the scp download helper to a script 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Maintaining the download helpers in the Makefile has proved to be a bit complex, so move it to a shell script. Signed-off-by: "Yann E. MORIN" --- package/pkg-download.mk | 5 +++-- support/download/scp | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 support/download/scp diff --git a/package/pkg-download.mk b/package/pkg-download.mk index e420b05..eec91b8 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -14,7 +14,7 @@ export CVS := $(call qstrip,$(BR2_CVS)) export BZR := $(call qstrip,$(BR2_BZR)) export GIT := $(call qstrip,$(BR2_GIT)) export HG := $(call qstrip,$(BR2_HG)) $(QUIET) -SCP := $(call qstrip,$(BR2_SCP)) $(QUIET) +export SCP := $(call qstrip,$(BR2_SCP)) $(QUIET) SSH := $(call qstrip,$(BR2_SSH)) $(QUIET) LOCALFILES := $(call qstrip,$(BR2_LOCALFILES)) @@ -147,7 +147,8 @@ endef # to prepend the path with a slash: scp://[user@]host:/absolutepath define DOWNLOAD_SCP test -e $(DL_DIR)/$(2) || \ - $(SCP) '$(call stripurischeme,$(call qstrip,$(1)))' $(DL_DIR)/$(2) + $(EXTRA_ENV) support/download/scp '$(call stripurischeme,$(call qstrip,$(1)))' \ + $(DL_DIR)/$(2) endef define SOURCE_CHECK_SCP diff --git a/support/download/scp b/support/download/scp new file mode 100755 index 0000000..9f8a4f0 --- /dev/null +++ b/support/download/scp @@ -0,0 +1,16 @@ +#!/bin/sh + +# We want to catch any command failure, and exit immediately +set -e + +# Download helper for scp +# Call it with: +# $1: URL +# $2: output file +# And this environment: +# SCP : the scp command to call + +url="${1}" +output="${2}" + +${SCP} "${url}" "${output}"