From patchwork Wed Apr 3 19:11:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 62681 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9535327BBE2; Wed, 3 Apr 2024 20:12:48 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8A01827BBE9 for ; Wed, 3 Apr 2024 20:12:46 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rs61n-0007f0-1P; Wed, 03 Apr 2024 15:12:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rs61i-0007eA-6E for guix-patches@gnu.org; Wed, 03 Apr 2024 15:12:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rs61h-0001bN-97 for guix-patches@gnu.org; Wed, 03 Apr 2024 15:12:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rs61l-0001ue-Ok for guix-patches@gnu.org; Wed, 03 Apr 2024 15:12:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70169] [PATCH 5/7] maint: Generate 'doc/version-LANG.texi' reproducibly. Resent-From: Janneke Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 03 Apr 2024 19:12:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70169 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70169@debbugs.gnu.org Received: via spool by 70169-submit@debbugs.gnu.org id=B70169.17121715147235 (code B ref 70169); Wed, 03 Apr 2024 19:12:05 +0000 Received: (at 70169) by debbugs.gnu.org; 3 Apr 2024 19:11:54 +0000 Received: from localhost ([127.0.0.1]:59671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rs61X-0001s2-CG for submit@debbugs.gnu.org; Wed, 03 Apr 2024 15:11:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rs61V-0001qj-0a for 70169@debbugs.gnu.org; Wed, 03 Apr 2024 15:11:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rs61L-0000zi-5g; Wed, 03 Apr 2024 15:11:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=jD6ePTMjJjOB1I3eR675QNNl+0TxWI/EHc3pSA3S8G8=; b=mOUnpnwrmdmzCf4ASrqb npYn5wkLogltBqRxpqqcN8pJUkrihN+6gjGLxnXPGYd9ZzI0filyHr8/mZOndTa+3lldn4ugxhHSl 0PSfl7X8IO7DUuWp2sWya2MzipBmpntODSnBwgwBOeT45GtHz8tGSjlUYmn9LGLAa91XJrT9XFf8x or9O4kc06wQi2nndHywhr+5Er/6KTEGt1ismoC1qgwPXq9uuWYxaXlrBSRWuCoKM+gnfy0YHVa7Fy 07KnV4F/P7aZg+sRsIFAxK5kWIjMJksY/SYLc4YFncGCoyOTUIyYHYXdA00TReavyibSNtrvWasN3 Xfm5Pr0UXWOr5g==; From: Janneke Nieuwenhuizen Date: Wed, 3 Apr 2024 21:11:07 +0200 Message-ID: <947bed93d2e2fec221fdec0d247f61912fb89567.1712165977.git.janneke@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * doc/local.mk ($(srcdir)/doc/stamp-vti): Change rule into... (version.texi-from-git): ...this new function. Call it with vti,guix.texi,; and for all MANUAL_LANGUAGES with $(i),po/doc/guix-manual.$(lang).po, -$(lang.po). Change-Id: Ia8df618178066cad320eecea0299337224e23a73 --- doc/local.mk | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/doc/local.mk b/doc/local.mk index 99a7e84361..893c99e1b1 100644 --- a/doc/local.mk +++ b/doc/local.mk @@ -6,6 +6,7 @@ # Copyright © 2016, 2018 Mathieu Lirzin # Copyright © 2018, 2021 Julien Lepiller # Copyright © 2019 Timothy Sample +# Copyright © 2024 Janneke Nieuwenhuizen # # This file is part of GNU Guix. # @@ -254,19 +255,28 @@ endif # Reproducible tarball -# Generate 'version.texi' reproducibly using metadata from Git rather -# than using metadata from the filesystem. -override $(srcdir)/doc/stamp-vti: $(srcdir)/doc/guix.texi $(top_srcdir)/configure - $(AM_V_GEN)set -e \ - export LC_ALL=C; \ - export TZ=UTC0; \ - timestamp=$$(git log --pretty=format:%ct -n1 -- $< 2>/dev/null \ - || echo $(SOURCE_DATE_EPOCH)) \ - dmy=$$(date --date="@$$timestamp" "+%-d %B %Y"); \ - my=$$(date --date="@$$timestamp" "+%B %Y"); \ - { echo "@set UPDATED $$dmy"; \ - echo "@set UPDATED-MONTH $$my"; \ - echo "@set EDITION $(VERSION)"; \ - echo "@set VERSION $(VERSION)"; } > $@-t; \ - mv $@-t $@ - @cp $@ $(srcdir)/doc/version.texi +# Define a rule to build `version[LANG].texi' reproducibly using metadata from +# Git rather than using metadata from the filesystem. +define version.texi-from-git +override $(srcdir)/doc/stamp-$(1): $(srcdir)/$(2) $(top_srcdir)/configure + $$(AM_V_GEN)set -e \ + export LC_ALL=C; \ + export TZ=UTC0; \ + timestamp=$$$$(git log --pretty=format:%ct -n1 -- $$< \ + 2>/dev/null \ + || echo $$(SOURCE_DATE_EPOCH)) \ + dmy=$$$$(date --date="@$$$$timestamp" "+%-d %B %Y"); \ + my=$$$$(date --date="@$$$$timestamp" "+%B %Y"); \ + { echo "@set UPDATED $$$$dmy"; \ + echo "@set UPDATED-MONTH $$$$my"; \ + echo "@set EDITION $$$(VERSION)"; \ + echo "@set VERSION $$$(VERSION)"; } > $$@-t; + mv $$@-t $$@ + cp -p $$@ $$(srcdir)/doc/version$(3).texi +endef + +i:=0 +$(eval $(call version.texi-from-git,vti,doc/guix.texi,)) +$(foreach lang, $(MANUAL_LANGUAGES), \ + $(eval i=$(shell echo $$(($(i)+1)))) \ + $(eval $(call version.texi-from-git,$(i),po/doc/guix-manual.$(lang).po,-$(lang))))