From patchwork Mon Aug 27 00:12:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danomi Manchego X-Patchwork-Id: 180107 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 0E8972C00D2 for ; Mon, 27 Aug 2012 10:13:06 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D6B98100DD3; Mon, 27 Aug 2012 00:13:02 +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 trXfrnvj5okH; Mon, 27 Aug 2012 00:13:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5AB5510033D; Mon, 27 Aug 2012 00:13:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id C86B48F753 for ; Mon, 27 Aug 2012 00:12:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B977FA0034 for ; Mon, 27 Aug 2012 00:12:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8ayzaJ0M1oPz for ; Mon, 27 Aug 2012 00:12:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qmta14.westchester.pa.mail.comcast.net (qmta14.westchester.pa.mail.comcast.net [76.96.59.212]) by hemlock.osuosl.org (Postfix) with ESMTP id 121ACA001B for ; Mon, 27 Aug 2012 00:12:58 +0000 (UTC) Received: from omta01.westchester.pa.mail.comcast.net ([76.96.62.11]) by qmta14.westchester.pa.mail.comcast.net with comcast id rbxp1j0040EZKEL5EcD2Uj; Mon, 27 Aug 2012 00:13:02 +0000 Received: from localhost.localdomain ([68.37.48.40]) by omta01.westchester.pa.mail.comcast.net with comcast id rcDF1j00H0s1VyU3McDFLq; Mon, 27 Aug 2012 00:13:15 +0000 From: Danomi Manchego To: buildroot@uclibc.org Date: Sun, 26 Aug 2012 20:12:55 -0400 Message-Id: <1346026375-15339-1-git-send-email-danomimanchego123@gmail.com> X-Mailer: git-send-email 1.7.9.5 Subject: [Buildroot] [PATCH] Replace DL_DIR refs in the GIT/SVN/HG 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net If DL_DIR is set to a relative path, then the download helpers for GIT, SVN, and HG fail, because they reference DL_DIR or $(PKG)_DL_DIR from within the DL_DIR directory. (But the relative path is relative to TOPDIR.) All of these cases can be avoided, since the location of the cloned repo is always $(DL_DIR)/$($(PKG)_BASE_NAME), which can be used to make the helpers simpler, as well as more friendly to the relative DL_DIR definition. Signed-off-by: Danomi Manchego --- package/pkg-download.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package/pkg-download.mk b/package/pkg-download.mk index 9e98581..a7cef0e 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -68,11 +68,11 @@ define DOWNLOAD_GIT test -e $(DL_DIR)/$($(PKG)_SOURCE) || \ (pushd $(DL_DIR) > /dev/null && \ $(GIT) clone --bare $($(PKG)_SITE) $($(PKG)_BASE_NAME) && \ - pushd $($(PKG)_BASE_NAME) > /dev/null && \ + cd $($(PKG)_BASE_NAME) && \ $(GIT) archive --format=tar --prefix=$($(PKG)_BASE_NAME)/ $($(PKG)_DL_VERSION) | \ - gzip -c > $(DL_DIR)/$($(PKG)_SOURCE) && \ - popd > /dev/null && \ - rm -rf $($(PKG)_DL_DIR) && \ + gzip -c > ../$($(PKG)_SOURCE) && \ + cd .. && \ + rm -rf $($(PKG)_BASE_NAME) && \ popd > /dev/null) endef @@ -104,9 +104,9 @@ 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) && \ + $(SVN) export -r $($(PKG)_DL_VERSION) $($(PKG)_SITE) $($(PKG)_BASE_NAME) && \ $(TAR) czf $($(PKG)_SOURCE) $($(PKG)_BASE_NAME)/ && \ - rm -rf $($(PKG)_DL_DIR) && \ + rm -rf $($(PKG)_BASE_NAME) && \ popd > /dev/null) endef @@ -140,8 +140,8 @@ define DOWNLOAD_HG (pushd $(DL_DIR) > /dev/null && \ $(HG) clone --noupdate --rev $($(PKG)_DL_VERSION) $($(PKG)_SITE) $($(PKG)_BASE_NAME) && \ $(HG) archive --repository $($(PKG)_BASE_NAME) --type tgz --prefix $($(PKG)_BASE_NAME)/ \ - --rev $($(PKG)_DL_VERSION) $(DL_DIR)/$($(PKG)_SOURCE) && \ - rm -rf $($(PKG)_DL_DIR) && \ + --rev $($(PKG)_DL_VERSION) ./$($(PKG)_SOURCE) && \ + rm -rf $($(PKG)_BASE_NAME) && \ popd > /dev/null) endef