From patchwork Fri Apr 6 20:18:55 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: 151265 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 B1701B706D for ; Sat, 7 Apr 2012 06:19:29 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 18823FFE52; Fri, 6 Apr 2012 20:19:28 +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 g03QXKV1SZLA; Fri, 6 Apr 2012 20:19:26 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id EA32CFFC84; Fri, 6 Apr 2012 20:19:25 +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 171188F753 for ; Fri, 6 Apr 2012 20:19:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0E3F388157 for ; Fri, 6 Apr 2012 20:19:25 +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 BpDGaVdS+mHt for ; Fri, 6 Apr 2012 20:19:23 +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 7644087E3F for ; Fri, 6 Apr 2012 20:19:23 +0000 (UTC) Received: by eaal11 with SMTP id l11so976519eaa.16 for ; Fri, 06 Apr 2012 13:19:21 -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=wleMKKrrpt/Uh/2rq2NXluAOpIUL7fiRi9h2ePjnLp0=; b=t51qlhBtSpS0IrInnDlos/RkQP4iN8BB6+IwlBp77SeR7yacDR4qV8mLBv+/Y6//lr stoIjkQf47FA7H3BO2xISMYfvuY5WyrReMqp+E7EZF+SXebFxS3knnvvse8EZGFemQcZ s6ueSDgwkg0Muew4Zn5Lz2nblyRNVgUEJ8411o7O7KZgAKO9w/Upk1nIXNdvLHpYO3D3 9FLln26JHMmv9toUm+TAV2Pp0GMJMAwsv1WQhoDpPUAzmOBibdr2zOmcwsR0fK3IhTWm e87NhIRdVzdSfU2dXF5F7tDq3WLs3cG6dsJACUW0bgdvUzhoAOQha78nFaf9o4tbPDqU Ou6g== Received: by 10.14.119.15 with SMTP id m15mr1404159eeh.34.1333743561650; Fri, 06 Apr 2012 13:19:21 -0700 (PDT) Received: from [127.0.1.1] (94-227-97-70.access.telenet.be. [94.227.97.70]) by mx.google.com with ESMTPS id z47sm29783594een.5.2012.04.06.13.19.20 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 06 Apr 2012 13:19:20 -0700 (PDT) MIME-Version: 1.0 X-Mercurial-Node: 2fcc145e1eef0f8bc4684731534598d5c61b6873 Message-Id: <2fcc145e1eef0f8bc468.1333743535@beantl019720> User-Agent: Mercurial-patchbomb/1.9.1 Date: Fri, 06 Apr 2012 22:18:55 +0200 From: Thomas De Schampheleire To: buildroot@busybox.net Subject: [Buildroot] [PATCH] 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 --- Config.in | 12 ++++++++++++ package/Makefile.package.in | 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/Makefile.package.in b/package/Makefile.package.in --- a/package/Makefile.package.in +++ b/package/Makefile.package.in @@ -269,8 +269,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 @@ -290,6 +290,9 @@ define DOWNLOAD_INNER *) $(call $(DL_MODE)_WGET,$(BR2_PRIMARY_SITE),$(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 ;; \