From patchwork Fri Jun 22 05:37:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 166502 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id C66E4B6F9F for ; Fri, 22 Jun 2012 15:37:42 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6D26731DBE; Fri, 22 Jun 2012 05:37:41 +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 0D81HzVVo+LJ; Fri, 22 Jun 2012 05:37:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id C927425C4F; Fri, 22 Jun 2012 05:37:39 +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 656DA8F753 for ; Fri, 22 Jun 2012 05:37:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5EA9B8C9A3 for ; Fri, 22 Jun 2012 05:37:38 +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 GJDWagh4X5c7 for ; Fri, 22 Jun 2012 05:37:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ey0-f171.google.com (mail-ey0-f171.google.com [209.85.215.171]) by whitealder.osuosl.org (Postfix) with ESMTPS id 7AFC08C967 for ; Fri, 22 Jun 2012 05:37:36 +0000 (UTC) Received: by eaaa12 with SMTP id a12so804363eaa.16 for ; Thu, 21 Jun 2012 22:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:content-transfer-encoding:subject :x-mercurial-node:message-id:user-agent:date:from:to:cc; bh=1+wOS6rjG8zi5EbG+kzj8m44L9EhJXEThO8CuBuOzZI=; b=mG8bVwDCTEGrMaMtn4cFEkpfL20R4b3z043ZhcZy9DhgCfs3jExmNVqS61AO0cMT0r qFisbkocCPlFTZBWQVsElMH15cgvhzrZUgUy+5uNAnCOA82RJsyHHph6bso9cN1NFKex KlcfTYujMpsUT0l7fcf/pESIXjCL3a1JKxCquo7h3LC70enejWdFWqgrwOYur3by/0+t +JKQ3VkioTUt1r10jXMEe7ZaajzpjeNnzHW+GvMHNYC5HYN4B59BIUOBsYxN73KyFsee /Xm/rQx4An5X8H1DIK3ipj+Dw3C1rdCJ+Vr7G3QUS2xT7ZgXx+rRwTsV8420tvYVPgiZ +Uvg== Received: by 10.14.96.8 with SMTP id q8mr148393eef.203.1340343454362; Thu, 21 Jun 2012 22:37:34 -0700 (PDT) Received: from [127.0.1.1] (d54C62EEB.access.telenet.be. [84.198.46.235]) by mx.google.com with ESMTPS id p41sm109202452eef.5.2012.06.21.22.37.32 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jun 2012 22:37:33 -0700 (PDT) MIME-Version: 1.0 X-Mercurial-Node: 119fa03d4dfc91ef89e750e6c78b2ed86f76e528 Message-Id: <119fa03d4dfc91ef89e7.1340343423@beantl019720> User-Agent: Mercurial-patchbomb/2.0.2 Date: Fri, 22 Jun 2012 07:37:03 +0200 From: Thomas De Schampheleire To: buildroot@busybox.net Subject: [Buildroot] [PATCH v2-resend2] Package downloads: allow restricting to primary site only 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: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net This patch adds a new config option BR2_PRIMARY_SITE_ONLY that, when set, restricts package downloads to the specified BR2_PRIMARY_SITE. If the package is not present on the primary site, the download fails. This is useful for project developers who want to ensure that the project can be built even if the upstream tarball locations disappear. Signed-off-by: Thomas De Schampheleire Acked-by: Arnout Vandecappelle (Essensium/Mind) --- v2: update after moving of Makefile.package.in Config.in | 12 ++++++++++++ package/pkg-download.mk | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Config.in b/Config.in --- a/Config.in +++ b/Config.in @@ -119,6 +119,16 @@ config BR2_PRIMARY_SITE NOTE: This works for all packages using the central package infrastructure (generic, autotools, cmake, ...) +config BR2_PRIMARY_SITE_ONLY + bool "Only allow downloads from primary download site" + help + If this option is enabled, downloads will only be attempted from the + primary download site. Other locations, like the package's official + download location or the backup download site, will not be + considered. + +if !BR2_PRIMARY_SITE_ONLY + config BR2_BACKUP_SITE string "Backup download site" default "http://sources.buildroot.net/" @@ -175,6 +185,8 @@ config BR2_DEBIAN_MIRROR Usually, just add your country code like XX here: http://ftp.XX.debian.org +endif + endmenu config BR2_JLEVEL diff --git a/package/pkg-download.mk b/package/pkg-download.mk --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -189,8 +189,8 @@ endef ################################################################################ # DOWNLOAD -- Download helper. Will try to download source from: # 1) BR2_PRIMARY_SITE if enabled -# 2) Download site -# 3) BR2_BACKUP_SITE if enabled +# 2) Download site, unless BR2_PRIMARY_SITE_ONLY is set +# 3) BR2_BACKUP_SITE if enabled, unless BR2_PRIMARY_SITE_ONLY is set # # Argument 1 is the source location # Argument 2 is the source filename @@ -210,6 +210,9 @@ define DOWNLOAD_INNER *) $(call $(DL_MODE)_WGET,$(BR2_PRIMARY_SITE)/$(2),$(2)) && exit ;; \ esac ; \ fi ; \ + if test "$(BR2_PRIMARY_SITE_ONLY)" = "y" ; then \ + exit 1 ; \ + fi ; \ if test -n "$(1)" ; then \ case "$($(PKG)_SITE_METHOD)" in \ git) $($(DL_MODE)_GIT) && exit ;; \