From patchwork Fri Jun 13 23:11:38 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: 359736 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 50A3D140108 for ; Sat, 14 Jun 2014 09:12:07 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 19E698BE4F; Fri, 13 Jun 2014 23:12:04 +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 pDkdlX_iUmzG; Fri, 13 Jun 2014 23:12:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id C977D8BE0B; Fri, 13 Jun 2014 23:12:00 +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 E92FF1BF97D for ; Fri, 13 Jun 2014 23:11:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E4BA58C22A for ; Fri, 13 Jun 2014 23:11:56 +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 emjWiOZ9a9ll for ; Fri, 13 Jun 2014 23:11:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by whitealder.osuosl.org (Postfix) with ESMTPS id 336C18C1B0 for ; Fri, 13 Jun 2014 23:11:56 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id x13so3370967wgg.27 for ; Fri, 13 Jun 2014 16:11:54 -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=tu3kbSptdUeqMYyyFndTTuR45bnUjEEscfDziLxEoy4=; b=vfaTlFv45HfKvPjrOtbe0JZerCDUzQ2YYSqXmHEJl93GF6roEsqoZJRcgbGCUqphyt Azqw27hW8ESw3nnwpQAPFq09Gqkg8hCApiAeUTfA8nylqQGcA/t7hAAg9D4i2A9zC0Iq n/R5ultodrmSKCQObrHst7p2SIAb5St9Y/T2MWKvavfGns4ftNaJBPH7jrs9D4q4cHHT JORDN7VQCPKR2SK3xP4gUyCeLupPHibqrVkppVihnAL7TlkOrWiwVjxvj7FxNH5a4oX2 1ow8i7Ph4cN3qpfaBpugPor9WG3+R46xe7l+MLKatsJhbdU92ZAljKAfYf1CHuNGy4hY 89Yg== X-Received: by 10.180.37.198 with SMTP id a6mr8405157wik.58.1402701114739; Fri, 13 Jun 2014 16:11:54 -0700 (PDT) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id fc7sm7635617wjc.37.2014.06.13.16.11.53 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Jun 2014 16:11:54 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sat, 14 Jun 2014 01:11:38 +0200 Message-Id: X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 04/14] pkg-infra: move the svn 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 From: "Yann E. MORIN" 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" Reviewed-by: Samuel Martin --- package/pkg-download.mk | 9 +++------ support/download/svn | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) create mode 100755 support/download/svn diff --git a/package/pkg-download.mk b/package/pkg-download.mk index 888d26e..570a47b 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -9,7 +9,7 @@ # Download method commands WGET := $(call qstrip,$(BR2_WGET)) $(QUIET) -SVN := $(call qstrip,$(BR2_SVN)) +export SVN := $(call qstrip,$(BR2_SVN)) CVS := $(call qstrip,$(BR2_CVS)) BZR := $(call qstrip,$(BR2_BZR)) export GIT := $(call qstrip,$(BR2_GIT)) @@ -133,11 +133,8 @@ endef define DOWNLOAD_SVN test -e $(DL_DIR)/$($(PKG)_SOURCE) || \ - (pushd $(DL_DIR) > /dev/null && \ - $(SVN) export -r $($(PKG)_DL_VERSION) $($(PKG)_SITE) $($(PKG)_DL_DIR) && \ - $(TAR) czf $($(PKG)_SOURCE) $($(PKG)_BASE_NAME)/ && \ - rm -rf $($(PKG)_DL_DIR) && \ - popd > /dev/null) + $(EXTRA_ENV) support/download/svn $($(PKG)_SITE) $($(PKG)_DL_VERSION) \ + $($(PKG)_BASE_NAME) $(DL_DIR)/$($(PKG)_SOURCE) endef define SOURCE_CHECK_SVN diff --git a/support/download/svn b/support/download/svn new file mode 100755 index 0000000..c3ab32c --- /dev/null +++ b/support/download/svn @@ -0,0 +1,25 @@ +#!/bin/sh + +# We want to catch any command failure, and exit immediately +set -e + +# Download helper for svn +# Call it with: +# $1: svn repo +# $2: svn revision +# $3: package's basename (eg. foobar-1.2.3) +# $4: output file +# And this environment: +# SVN : the svn command to call +# BR2_DL_DIR: path to Buildroot's download dir + +repo="${1}" +rev="${2}" +basename="${3}" +output="${4}" + +pushd "${BR2_DL_DIR}" +${SVN} export -r "${rev}" "${repo}" "${basename}" +tar czf "${output}" "${basename}" +rm -rf "${basename}" +popd