From patchwork Sun Jul 6 21:27:14 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: 367398 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 C98F41400ED for ; Mon, 7 Jul 2014 07:27:33 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0400289D28; Sun, 6 Jul 2014 21:27:33 +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 v7E3j+Eridul; Sun, 6 Jul 2014 21:27:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 8149788F4C; Sun, 6 Jul 2014 21:27:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 4A3511BFA1E for ; Sun, 6 Jul 2014 21:27:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 470012742D for ; Sun, 6 Jul 2014 21:27:24 +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 hXoxWFv2PAMN for ; Sun, 6 Jul 2014 21:27:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by silver.osuosl.org (Postfix) with ESMTPS id 47ECF2FB3D for ; Sun, 6 Jul 2014 21:27:23 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id bs8so15036325wib.13 for ; Sun, 06 Jul 2014 14:27:21 -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=tcrqyHM4vZbBYX1x/kD5QU0tIM4lsJvIFtqfSgqla9w=; b=Qg0WVymzjr/ruI1xlgpFf8qQndoF4I0RPc29jBmsyNbJUKA3I3y86AeBjH1vchdPVo m/3pYuT21T3VqmbRhNKA9D68K1LKzfwmd/u3zEmcVtJfNYNQhLHq85Gk4W4G5GvRbz+4 SInjGTr0vXxb4EkmwJ6/b7x/rKgCfgvmEpT5c56sqhSqbrncDhF4ib0ZHsivMREQiTtZ Jqg1y+vpJZOsM7GuaDRNuC0nnG26RDcwR67DqXIk7zJHIzWgYgOEwQtGeaWMdiVUDcbA 8DGkS4IBoOgm5Rpc5pPw5UCSteZCqwSCJeo5ruvosKK4mZKoSeHEkW1oyCHSYaUQEwUN vCYQ== X-Received: by 10.194.24.36 with SMTP id r4mr27572032wjf.35.1404682041813; Sun, 06 Jul 2014 14:27:21 -0700 (PDT) Received: from gourin.bzh.lan (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id ey16sm107205473wid.14.2014.07.06.14.27.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 06 Jul 2014 14:27:21 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 6 Jul 2014 23:27:14 +0200 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 3/5] support/download: simplify the local-files helper 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 Currently, the local-files download helper behaves like all the other download helpers, by first copying into the BUILD_DIR, then to BR2_DL_DIR, and then rename the final file. This does two copies, for the sake of using the LOCALFILES command. Just get rid of the intermediate copy to BUILD_DIR. Instead, directly copy to the final temp file and rename that. This does a single copy, but we lose the file access mode, so we just reinstate them (in case it's a self-extracting executable used in a br2-external package, for example.) Signed-off-by: "Yann E. MORIN" --- One may argue that we could just do a symlink dest -> source. But if source is on a network mount, it may vanish any time (eg. when undocking your laptop for example ;-) ). So we really need to do a copy. --- Config.in | 4 ---- Config.in.legacy | 11 +++++++++++ package/pkg-download.mk | 1 - support/download/cp | 13 ++++++------- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Config.in b/Config.in index 50968fb..9e81d77 100644 --- a/Config.in +++ b/Config.in @@ -71,10 +71,6 @@ config BR2_CVS string "CVS command" default "cvs" -config BR2_LOCALFILES - string "Local files retrieval command" - default "cp" - config BR2_SCP string "Secure copy (scp) command" default "scp" diff --git a/Config.in.legacy b/Config.in.legacy index a2c7846..aa49806 100644 --- a/Config.in.legacy +++ b/Config.in.legacy @@ -101,6 +101,17 @@ endif ############################################################################### comment "Legacy options removed in 2014.08" +config BR2_LOCALFILES + string "Local files retrieval command has been removed" + help + The option to specify how to copy local files has been removed. + It is now handled by a helper script in support/download/cp. + +config BR2_LOCALFILES_WRAP + bool + default y if BR2_LOCALFILES != "" + select BR2_LEGACY + config BR2_KERNEL_HEADERS_3_8 bool "kernel headers version 3.8.x are no longer supported" select BR2_KERNEL_HEADERS_3_9 diff --git a/package/pkg-download.mk b/package/pkg-download.mk index 7f208d5..fb52ae0 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -16,7 +16,6 @@ export GIT := $(call qstrip,$(BR2_GIT)) export HG := $(call qstrip,$(BR2_HG)) $(QUIET) export SCP := $(call qstrip,$(BR2_SCP)) $(QUIET) SSH := $(call qstrip,$(BR2_SSH)) $(QUIET) -export LOCALFILES := $(call qstrip,$(BR2_LOCALFILES)) # Default spider mode is 'DOWNLOAD'. Other possible values are 'SOURCE_CHECK' # used by the _source-check target and 'SHOW_EXTERNAL_DEPS', used by the diff --git a/support/download/cp b/support/download/cp index e73159b..e1e7337 100755 --- a/support/download/cp +++ b/support/download/cp @@ -8,20 +8,19 @@ set -e # $1: source file # $2: output file # And this environment: -# LOCALFILES: the cp command to call +# (nothing special) source="${1}" output="${2}" -tmp_dl="$( mktemp "${BUILD_DIR}/.XXXXXX" )" tmp_output="$( mktemp "${output}.XXXXXX" )" ret=1 -if ${LOCALFILES} "${source}" "${tmp_dl}"; then - if cat "${tmp_dl}" >"${tmp_output}"; then - mv "${tmp_output}" "${output}" - ret=0 - fi +if cat "${source}" >"${tmp_output}"; then + mode="$( stat -c '%a' "${source}" )" + chmod "${mode}" "${tmp_output}" + mv "${tmp_output}" "${output}" + ret=0 fi # Cleanup