From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OMrYEFfx9GBj1gAAgWs5BA (envelope-from ) for ; Mon, 19 Jul 2021 05:28:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id aG2WDFfx9GAsbwAAB5/wlQ (envelope-from ) for ; Mon, 19 Jul 2021 03:28:23 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C08D4C39D for ; Mon, 19 Jul 2021 05:28:22 +0200 (CEST) Received: from localhost ([::1]:40802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5Jx7-0000J4-O5 for larch@yhetil.org; Sun, 18 Jul 2021 23:28:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Jsw-0007nk-Iw for guix-patches@gnu.org; Sun, 18 Jul 2021 23:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46214) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5Jsw-0008KZ-A0 for guix-patches@gnu.org; Sun, 18 Jul 2021 23:24:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5Jsw-0000zb-6W for guix-patches@gnu.org; Sun, 18 Jul 2021 23:24:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49517] [PATCH] gnu: txr: Build documentation and update to 265. Resent-From: Kaz Kylheku Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Jul 2021 03:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49517 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Guillaume Le Vaillant Cc: "Paul A. Patience" , 49517@debbugs.gnu.org Received: via spool by 49517-submit@debbugs.gnu.org id=B49517.16266649993766 (code B ref 49517); Mon, 19 Jul 2021 03:24:02 +0000 Received: (at 49517) by debbugs.gnu.org; 19 Jul 2021 03:23:19 +0000 Received: from localhost ([127.0.0.1]:57760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5JsE-0000yg-OZ for submit@debbugs.gnu.org; Sun, 18 Jul 2021 23:23:19 -0400 Received: from omta001.cacentral1.a.cloudfilter.net ([3.97.99.32]:36444) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5JsB-0000yQ-8U for 49517@debbugs.gnu.org; Sun, 18 Jul 2021 23:23:17 -0400 Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id 51HpmKeRAFRDp5Js5mInlA; Mon, 19 Jul 2021 03:23:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=shaw.ca; s=s20180605; t=1626664989; bh=ByRC4JRDrPtwBrzQxS3frtbSedHKHrdQmJUz8YzR9uI=; h=To:Subject:Date:From:Cc:In-Reply-To:References; b=RsCys9RXjvmF68IMRIzVrx4fMMMd8tkdHUPwuvT7PsoUL5lGcYo+NFOo6Vzui6lvy CxqCppftfr1R+qfRWgPN+6Xs0r32c5KVKxfAfkPkyuvQcFWTgfo+yHYpcvrSXvqw9c 305PQ/X5VzZdDPoNc7HQsgld0pV3OJlSkQChjBGCaNywfRJgOy3zgt+1ONP9443mon wzHrqDbJnQI7r+ppOe+2Az1D1Ylup2x6pSC2896CK6deQczTpKASUKK+xfu/si+bNA JUl/yDq667P7b1nqIa3VeOg8vJHI8srvitG1oqV1DG8qEouKi8C1E/9XDkE4Cs+6Fx VsXWEptJMXAZA== Received: from kylheku.com ([70.79.163.252]) by cmsmtp with ESMTPA id 5Js4mxM673DJA5Js4mAK2c; Mon, 19 Jul 2021 03:23:09 +0000 X-Authority-Analysis: v=2.4 cv=FMjee8ks c=1 sm=1 tr=0 ts=60f4f01d a=95A0EdhkF1LMGt25d7h1IQ==:117 a=95A0EdhkF1LMGt25d7h1IQ==:17 a=IkcTkHD0fZMA:10 a=SMorJkV_YP8A:10 a=e_q4qTt1xDgA:10 a=2KUf1mbJAAAA:8 a=ocUVl4iIZ1vgkZ2snlIA:9 a=QEXdDO2ut3YA:10 a=LME9DoRMzU6P72L8X6EC:22 Received: from www-data by kylheku.com with local (Exim 4.72) (envelope-from ) id 1m5Js4-0005vE-0M; Sun, 18 Jul 2021 20:23:08 -0700 X-PHP-Originating-Script: 501:rcmail.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Date: Sun, 18 Jul 2021 20:23:07 -0700 From: Kaz Kylheku In-Reply-To: <874kcr7vt7.fsf@kitej> References: <87o8b1p8k1.fsf@kitej> <3ae1061ea0a61b579c48f9ea7b4f4832@mail.kylheku.com> <96d55c0d8940c64eca79aa4a15a3cb8f@mail.kylheku.com> <874kcr7vt7.fsf@kitej> Message-ID: <11fc334731df77688afd107574be9c6c@mail.kylheku.com> X-Sender: kaz@kylheku.com User-Agent: Roundcube Webmail/0.9.2 X-CMAE-Envelope: MS4xfGxQJYpXwsMdQaWNr7jFtWtgbY7BNz2Zg6HwnjP40M+73ggaAsGXJXNwHvjrXp58fyOI+IQpitsb4rz8qeQsTW/vBmha0gtaIubJ8mZjfUPZStsDXlla Yx/XQMRhrflSdfTJL/rSdQo2Y0IgeEFCLdw6cr0HrS/6YQIRSKJfKRghqkHNO5Vp370f3MpqwbsikHJTOWPKzfUwmVFgE4zzV+jSsezeirqGdSFNSC3Lirtf 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626665303; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=WcniGjeSsly87bwKrpqTPwDBXRV3Zo+6GJaC7/Dz5v8=; b=kwg6tNSg8ImtpUIqOxcL57Yjtj4x/OqN5MRkTIuIeVtSNjexhNfN9T4B9e7UOGoC+P97kp xlyDUs4ySCbTjkFsn+3rA4HdW3MYbjhMNR5Dik7kUaawd6AZ07b3LwSogoIdvWCttOE8dh AOnY3HsWrj/uDA0FXsegUZsT0slRGj0wQFpFw6HM5yER+YU1XmRAeCZhx2B4UkHOKpf/oE O1i/aT7C+4ex2dh6hsE2RvAW8pFe/nZulVdiOZ60SyUBrNhXVzsGIa0aRI8iKvzGuxU11I yC8dzEQHfR9ypHguaJyJAixYQHSDuRN5KZr1YDQM9wkhYoLr8C17niasLvSu+g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626665303; a=rsa-sha256; cv=none; b=px10CwzsO16BNgpf+VzYYm0ES01cB8tGYl9trqanbgWTTf9RAOo1evldGXUAPLzPIX0Gd7 NWZ2V1aFpE3CDl5F9WGJ8WIkSzwuZpJ6QuuiFK/rCzbtULo1RCvYgXrZPaIkHnNGjF1TJX R0pWwqWayjjao/0BBprbuQ07x1QSMxRRRBGONIsOo1y6fi8efBfILy0v6ljm3wWT9w8/pI DdYthw12L23jTUkydbmV7YlaFHU0UynLl/K4Ou2yRri+j4TiL5qtGznDr0YbEYOtxma+Rj EIcdoxwzpsKg1CdOhaJiHZkf6m892BB4SaQpSNhbnrUtkX8UtZtU4ruTRJE0/A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=shaw.ca header.s=s20180605 header.b=RsCys9RX; dmarc=fail reason="SPF not aligned (relaxed)" header.from=kylheku.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.31 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=shaw.ca header.s=s20180605 header.b=RsCys9RX; dmarc=fail reason="SPF not aligned (relaxed)" header.from=kylheku.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: C08D4C39D X-Spam-Score: -1.31 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6gKdvMHRBhHb On 2021-07-18 03:36, Guillaume Le Vaillant wrote: > Hi Kaz, >=20 > I tried your patch and it doesn't fix all the timestamps in the > environment used to build Guix packages: OK, I have a new patch which works for both the observed time formats issued by Ghostscript, which I reproduced and tested. Patch follows. I extended the capture region to extract not only the XML but that bit of PostScript with the dates which follows right after it. (I structured the script this way to avoid doing a regex search and replace of the whole file, which is not only more time consuming but risks more false positives than necessary.) The replacement argument of regsub can be a function; the function receives the original string and calculates its replacement. So we can check for a trailing Z and act accordingly. commit 920ae93cd768222db7387ee026f2d779d5e6de09 (HEAD -> master) Author: Kaz Kylheku Date: Sat Jul 17 19:11:20 2021 -0700 doc: reproducible PDF. * Makefile (txr-manpage.pdf): If SOURCE_DATE_EPOCH exists, then run pdf-clobber-stamps.tl. * pdf-clobber-stamps.tl: New file. diff --git a/Makefile b/Makefile index 0094985f..cac9b3c0 100644 --- a/Makefile +++ b/Makefile @@ -560,6 +560,7 @@ txr-manpage.html: txr.1 genman.txr txr-manpage.pdf: txr.1 checkman.txr $(TXR) checkman.txr $< tbl $< | pdfroff -ww -man --no-toc - > $@ + [ $$SOURCE_DATE_EPOCH ] && $(TXR) pdf-clobber-stamps.tl || true # # Special targets used by ./configure diff --git a/pdf-clobber-stamps.tl b/pdf-clobber-stamps.tl new file mode 100644 index 00000000..78ea06c6 --- /dev/null +++ b/pdf-clobber-stamps.tl @@ -0,0 +1,22 @@ +(let* ((epoch (or (tointz (getenv "SOURCE_DATE_EPOCH")) 0)) + (pdf (file-get-string "txr-manpage.pdf")) + (start (search-str pdf "....-..-..T..:..:..(Z|[+\-]..:..)/ + (ret `Date>@isotime@(if (ends-with "Z" @1) "Z" "+00:00")`)) + (regsub #/Date\(D:..............[Z+\-]..../ + `Date(D:@gstime`)) + (assert (eql (len xml) orig-len)) + (set [pdf start..end] xml) + (file-put-string "txr-manpage.pdf.temp" pdf) + (rename-path "txr-manpage.pdf.temp" "txr-manpage.pdf"))