From patchwork Tue May 15 18:40:45 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: 159411 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 C2BC8B6FA9 for ; Wed, 16 May 2012 04:41:09 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 73E6F8CDA5; Tue, 15 May 2012 18:41:08 +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 xNzpKDMi2gsu; Tue, 15 May 2012 18:41:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 06BC08CE0C; Tue, 15 May 2012 18:41:06 +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 ED1028F76A for ; Tue, 15 May 2012 18:41:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E12FF8CDA5 for ; Tue, 15 May 2012 18:41:04 +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 XiRIXuWby+CU for ; Tue, 15 May 2012 18:41:03 +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 B34D08CE0C for ; Tue, 15 May 2012 18:41:02 +0000 (UTC) Received: by eaaa12 with SMTP id a12so2843149eaa.16 for ; Tue, 15 May 2012 11:41:00 -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=r01G3LLqB+GsDHxHYPmku67wekTuJ1A8i2y9511elNQ=; b=G9SaasijwgbVm6psf0/sw/d7niQUfch21SDaDMjzerIiySF/dWSZLJCoBDQk5g1/VM 4ATF/v7Xvh2AmR/UCfuxu64apUd0ZiZ+GvgiAg2vs1BIaS5A3Whf3Jb2uEp1cl/Fk1iv IEe1ssHGZ6HHHmXEIKZ578+W8viW9tgsLobdJFHA37eGJXdEhORLcJpL3oc4n9ujpsgW SYxjAISx/DPTbFjcNM7IPG7wX4MavQpEV0mURSh5Aj2SrRdT09R6GMDQVwfnp6YZp9KL BNY2W5Pvm2wkX4XwFAzJy2CdHWQC3/KAWbeNQGgGP1orEkIwiDJxA4FoG3WYHQ7DUFwz VCTA== Received: by 10.213.15.82 with SMTP id j18mr715292eba.133.1337107260841; Tue, 15 May 2012 11:41:00 -0700 (PDT) Received: from [127.0.1.1] (d54C62A5A.access.telenet.be. [84.198.42.90]) by mx.google.com with ESMTPS id a16sm16888570eeg.0.2012.05.15.11.40.59 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 May 2012 11:41:00 -0700 (PDT) MIME-Version: 1.0 X-Mercurial-Node: a5856c332d488da31db2d2c6c504a87ccb102001 Message-Id: User-Agent: Mercurial-patchbomb/1.9.1 Date: Tue, 15 May 2012 20:40:45 +0200 From: Thomas De Schampheleire To: buildroot@busybox.net Subject: [Buildroot] [PATCH v2] 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 ;; \