From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9CD8C433DB for ; Wed, 23 Dec 2020 16:10:34 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E6CB9229CA for ; Wed, 23 Dec 2020 16:10:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6CB9229CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=daemonizer.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.58468.102841 (Exim 4.92) (envelope-from ) id 1ks6iV-0006NW-63; Wed, 23 Dec 2020 16:10:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 58468.102841; Wed, 23 Dec 2020 16:10:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ks6iV-0006NP-2u; Wed, 23 Dec 2020 16:10:23 +0000 Received: by outflank-mailman (input) for mailman id 58468; Wed, 23 Dec 2020 16:10:21 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ks6iT-0006NK-Ov for xen-devel@lists.xenproject.org; Wed, 23 Dec 2020 16:10:21 +0000 Received: from mx1.somlen.de (unknown [89.238.87.226]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 69215828-7abd-4150-a7a0-c600245441f3; Wed, 23 Dec 2020 16:10:19 +0000 (UTC) Received: by mx1.somlen.de with ESMTPSA id C16B7C3AF0B; Wed, 23 Dec 2020 17:10:17 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 69215828-7abd-4150-a7a0-c600245441f3 From: Maximilian Engelhardt To: Jan Beulich Cc: Ian Jackson , Wei Liu , xen-devel@lists.xenproject.org Subject: Re: [XEN PATCH 3/3] docs: set date to SOURCE_DATE_EPOCH if available Date: Wed, 23 Dec 2020 17:10:12 +0100 Message-ID: <2354439.sqZyMsV9Az@localhost> In-Reply-To: <3c3edc91-7d22-289f-575b-9fd3c2ec4bc8@suse.com> References: <23352f4835ae58c5cae6f425d5a8378f3d694055.1608319634.git.maxi@daemonizer.de> <3c3edc91-7d22-289f-575b-9fd3c2ec4bc8@suse.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2033718.9jYyLHQttZ"; micalg="pgp-sha512"; protocol="application/pgp-signature" --nextPart2033718.9jYyLHQttZ Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Montag, 21. Dezember 2020 10:01:14 CET Jan Beulich wrote: > On 18.12.2020 21:42, Maximilian Engelhardt wrote: > > --- a/docs/Makefile > > +++ b/docs/Makefile > > @@ -3,7 +3,13 @@ include $(XEN_ROOT)/Config.mk > > > > -include $(XEN_ROOT)/config/Docs.mk > > > > VERSION := $(shell $(MAKE) -C $(XEN_ROOT)/xen --no-print-directory > > xenversion)> > > -DATE := $(shell date +%Y-%m-%d) > > + > > +DATE_FMT := +%Y-%m-%d > > +ifdef SOURCE_DATE_EPOCH > > +DATE := $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" > > 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" > > 2>/dev/null || date -u "$(DATE_FMT)") > Looking at the doc for a (deliberately) old "date", I can't find > any mention of the -d "@..." syntax. I take it the command would > fail on that system. It would then go on to try the -r variant, > which has entirely different meaning on GNU (Linux) systems. > > docs/ being subject to configuring, why don't you determine the > capabilities of "date" there and invoke just the one command > that was found suitable for the system? > > Jan Hi Jan, I did some research. The -d "@..." syntax was introduced about 2005. Testing a live CD from 2006 (KNOPPIX_V5.0.1CD-2006-06-01-EN.iso) it was supported there. The documentation about this syntax has only been added in 2011 to the date command. I'm wondering if anybody running such an old system wants to use SOURCE_DATE_EPOCH. However, I came up with a patch to determine which suitable date version is available and only call that, as you suggested. I will post the new patch soon. Maxi --nextPart2033718.9jYyLHQttZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEQ8gZ7vwsPje0uPkIgepkfSQr0hUFAl/ja+QACgkQgepkfSQr 0hW5+g/+L51OAqHpwGZtFGlFb0eJxdq10ARcuU/iiB3dwyRVXAyMAhrBsMa288IH m7ZnBGV8MMhp/OVY5CeR+L0y5x+H6UhxvvSesqxcP617ngi8SKtPHSbadsA1gV5Z bkMUuZI8h4RfkyUxx1u18doF1IUGlXRu4/wujrUzLloY8XUp06x+x2dehNQJ9aj/ kMH5UNZbqPUOnCxcvjZwGxlWIyH45iIwTWgdrUzXhIXOhzueA9egudL8/07/cOss e6UK+BlmXGJb+jFZyYds1EN0SZxbgAIuNGz0iAKvzRwmz3zQL6lqQByNeZ4YZaeD ec8qdSNgbQj7aitV4XtuSaKvXZ11Lwiaus4FiEeo4/I1CntuzFieBFvQFGY6gEOE kBKNfMycSKheZ8xk6dFUPZSdXC17TWvOHqEQqEh4MyIug4LO0lbkXuyLE0F0geAx kcsjPpCxoHy7dmTSdPQIdn4bYK1ufpKFiQSPvPoUEQ+XKpd2UMIBnR3BNwsb8/ey g+s8YVyxsPEozvyKNvNzfCIq2DzqrDWI/nQyv1CWxuT+nb98VzwWxwX0CJCPSPee qOSWB5abRT+zR5X9I+nkpEahQLTxcn92jr5Sk1+oVBjTdOOUqVdJJv7kqisJEPcG sWiHUeJVhlq4r2iwcjGK6S0f4Okfd2vVKEZ42Rb/RODnoGK7Fpw= =DFB4 -----END PGP SIGNATURE----- --nextPart2033718.9jYyLHQttZ--