From patchwork Sat Apr 30 07:48:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilles Chanteperdrix X-Patchwork-Id: 617049 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 3qxjRq1XB1z9t5n for ; Sat, 30 Apr 2016 17:51:03 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 446DEC04F5; Sat, 30 Apr 2016 07:51: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 a96z0PCWwuJ5; Sat, 30 Apr 2016 07:50:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 95C0AC04E0; Sat, 30 Apr 2016 07:50:54 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 90B8F1C1E84 for ; Sat, 30 Apr 2016 07:50:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8C95295828 for ; Sat, 30 Apr 2016 07:50:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Improper folded header field made up entirely of whitespace (char 20 hex): X-Spam_report: ...that system for details.\n \n Content previ[...] Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w80aixEJPYwf for ; Sat, 30 Apr 2016 07:50:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-51317.xenomai.org (sd-51317.xenomai.org [62.210.215.82]) by hemlock.osuosl.org (Postfix) with ESMTPS id 0C7B6957D2 for ; Sat, 30 Apr 2016 07:50:42 +0000 (UTC) Received: from for13-1-78-194-115-96.fbxo.proxad.net ([78.194.115.96] helo=prometheus.click-hack.org) by sd-51317.xenomai.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1awPel-0004Hf-3h; Sat, 30 Apr 2016 09:49:39 +0200 From: Gilles Chanteperdrix To: buildroot@buildroot.org Date: Sat, 30 Apr 2016 09:48:59 +0200 Message-Id: <1462002570-14706-3-git-send-email-gilles.chanteperdrix@xenomai.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1462002570-14706-1-git-send-email-gilles.chanteperdrix@xenomai.org> References: <20160430074358.GE1781@hermes.click-hack.org> <1462002570-14706-1-git-send-email-gilles.chanteperdrix@xenomai.org> X-Spam_score: -1.0 X-Spam_score_int: -9 X-Spam_bar: - X-Spam_report: Spam detection software, running on the system "sd-51317.xenomai.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: When reproducibility is wanted, generates a global SOURCE_DATE_EPOCH environment variable which contains either the date of buildroot last commit if running from a git repository, or the latest release date. [...] Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Cc: Gilles Chanteperdrix Subject: [Buildroot] [PATCH 03/34] reproducibility: generate SOURCE_DATE_EPOCH 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When reproducibility is wanted, generates a global SOURCE_DATE_EPOCH environment variable which contains either the date of buildroot last commit if running from a git repository, or the latest release date. This means that all packages embedding build dates will appear to have the same build date, so in case of new commit or release, all packages will appear to have been change, even though some of them may not have changed in fact. --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 86b2ed2..c1d2961 100644 --- a/Makefile +++ b/Makefile @@ -223,6 +223,11 @@ ifeq ($(BR2_REPRODUCIBLE),y) export TZ=UTC export LANG=C export LC_ALL=C +SOURCE_DATE_GIT = $(shell GIT_DIR=$(TOPDIR)/.git $(GIT) log -1 --format=%at) +SOURCE_DATE_CHANGES = $(shell head -n 1 $(TOPDIR)/CHANGES | \ + sed 's/^.*Released \(.*\)$$/\1/;s/\(st\|nd\|rd\|th\),//' | \ + LANG=C LC_ALL=C TZ=UTC xargs -i date -d \{\} +%s) +export SOURCE_DATE_EPOCH = $(if $(wildcard $(TOPDIR)/.git),$(SOURCE_DATE_GIT),$(SOURCE_DATE_CHANGES)) endif # To put more focus on warnings, be less verbose as default