From patchwork Wed Nov 18 09:03:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 545908 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 442FD1402B9 for ; Wed, 18 Nov 2015 20:03:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 899E5872D5; Wed, 18 Nov 2015 09:03:40 +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 umO9O6pIXMTX; Wed, 18 Nov 2015 09:03:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id AF9348721C; Wed, 18 Nov 2015 09:03:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 14CA01BFC16 for ; Wed, 18 Nov 2015 09:03:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0F5888971B for ; Wed, 18 Nov 2015 09:03:39 +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 DCbqey5iRG34 for ; Wed, 18 Nov 2015 09:03:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lupi.sysmic.org (sysmic.org [62.210.89.17]) by whitealder.osuosl.org (Postfix) with ESMTPS id 706148970A for ; Wed, 18 Nov 2015 09:03:31 +0000 (UTC) Received: from localhost.localdomain (unknown [212.234.226.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jezz) by lupi.sysmic.org (Postfix) with ESMTPSA id 3096842F36; Wed, 18 Nov 2015 10:03:29 +0100 (CET) From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= To: buildroot@busybox.net Date: Wed, 18 Nov 2015 10:03:25 +0100 Message-Id: <1447837405-25846-1-git-send-email-jezz@sysmic.org> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Cc: Thomas Petazzoni , =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Subject: [Buildroot] [PATCH v2] pkg-download: support 'file://' in BR2_PRIMARY_SITE X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 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" This feature was already discuted here: http://lists.busybox.net/pipermail/buildroot/2015-April/125419.html Personally, I have a big central directory with all tarballs I have ever downloaded. I use this feature to isolate tarballs necessary to build a configuration: make project_defconfig make BR2_DL_DIR=/tmp/mirror-project BR2_PRIMARY_SITE=file:///home/user/dl source tar -C /tmp -czvf mirror-project.tgz mirror-project Signed-off-by: Jérôme Pouiller --- v2: - Update help message Config.in | 6 ++++-- package/pkg-download.mk | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Config.in b/Config.in index d795361..1809eeb 100644 --- a/Config.in +++ b/Config.in @@ -165,8 +165,10 @@ config BR2_PRIMARY_SITE Primary site to download from. If this option is set then buildroot will try to download package source first from this site and try the default if the file is not found. - Valid URIs are URIs recognized by $(WGET) and scp URIs of the form - scp://[user@]host:path. + Valid URIs are: + - URIs recognized by $(WGET) + - local URIs of the form file://absolutepath + - scp URIs of the form scp://[user@]host:path. config BR2_PRIMARY_SITE_ONLY bool "Only allow downloads from primary download site" diff --git a/package/pkg-download.mk b/package/pkg-download.mk index c86b9ab..f08f616 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -214,6 +214,7 @@ endef define DOWNLOAD_INNER $(Q)if test -n "$(call qstrip,$(BR2_PRIMARY_SITE))" ; then \ case "$(call geturischeme,$(BR2_PRIMARY_SITE))" in \ + file) $(call $(3)_LOCALFILES,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \ scp) $(call $(3)_SCP,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \ *) $(call $(3)_WGET,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \ esac ; \