From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id QI5HOsRfH1/7OwAA0tVLHw (envelope-from ) for ; Mon, 27 Jul 2020 23:14:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 8Bz+NcRfH18PCgAAbx9fmQ (envelope-from ) for ; Mon, 27 Jul 2020 23:14:12 +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 CAE9F9404CB for ; Mon, 27 Jul 2020 23:14:11 +0000 (UTC) Received: from localhost ([::1]:58790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k0CJu-0005eM-E0 for larch@yhetil.org; Mon, 27 Jul 2020 19:14:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k0CJm-0005e7-Sw for bug-guix@gnu.org; Mon, 27 Jul 2020 19:14:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44472) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k0CJm-00054g-KA for bug-guix@gnu.org; Mon, 27 Jul 2020 19:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k0CJm-0006IQ-GL for bug-guix@gnu.org; Mon, 27 Jul 2020 19:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#42212: [PATCH v2 1/1] Use nearest tag as the version string in documentation. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 27 Jul 2020 23:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42212 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Arun Isaac Received: via spool by 42212-submit@debbugs.gnu.org id=B42212.159589164024181 (code B ref 42212); Mon, 27 Jul 2020 23:14:02 +0000 Received: (at 42212) by debbugs.gnu.org; 27 Jul 2020 23:14:00 +0000 Received: from localhost ([127.0.0.1]:56017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0CJk-0006Hs-Fl for submit@debbugs.gnu.org; Mon, 27 Jul 2020 19:14:00 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:40718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0CJi-0006HZ-9u for 42212@debbugs.gnu.org; Mon, 27 Jul 2020 19:13:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MfS3FTER9Mmh30t/Gity0ZsCJ7HcN1gGLMTMkP4rAmM=; b=f5aEXetSPu9FGbGnxsJLDs93BX 0tMjorgCU2pEbMItDij2kJ2dJ7ZgDxarXY538aektpfn/T6tfqL/Rzj85s6iJIPugf70S3w3mhi5g IDLLu/EijmHu7VfCQs6qpemJHYIb8Tur0Qd3SJMaD5l2mU1wRnk4niJGDoBk/7nmGxQo=; Received: from [192.168.2.1] (helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1k0CJK-001hFY-89; Tue, 28 Jul 2020 04:43:34 +0530 From: Arun Isaac Date: Tue, 28 Jul 2020 04:43:31 +0530 Message-Id: <20200727231332.10489-2-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <87ft9mqsd2.fsf@gnu.org> References: <87ft9mqsd2.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 42212@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=systemreboot.net header.s=default header.b=f5aEXetS; dmarc=fail reason="SPF not aligned (relaxed)" header.from=systemreboot.net (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: 1.09 X-TUID: c3iDNkg0mGLf * guix/channels.scm (latest-channel-instance): Write nearest tag into .version of the checkout. * guix/self.scm (info-manual): Use nearest tag from .version as the version string while generating documentation. --- guix/channels.scm | 13 ++++++++++++- guix/self.scm | 10 ++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/guix/channels.scm b/guix/channels.scm index ad2442f50e..e8941bb28e 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020 Arun Isaac ;;; ;;; This file is part of GNU Guix. ;;; @@ -393,7 +394,17 @@ thus potentially malicious code.")))))))) (when (guix-channel? channel) ;; Apply the relevant subset of PATCHES directly in CHECKOUT. This is ;; safe to do because 'switch-to-ref' eventually does a hard reset. - (apply-patches checkout commit patches)) + (apply-patches checkout commit patches) + + ;; Write into .version, the nearest tag without the "v" prefix. + (call-with-output-file (string-append checkout "/.version") + (lambda (port) + (display (substring + (describe-format + (describe-workdir (repository-open checkout)) + (make-describe-format-options #:abbreviated-size 0)) + 1) + port)))) (let* ((name (url+commit->name (channel-url channel) commit)) (checkout (add-to-store store name #t "sha256" checkout diff --git a/guix/self.scm b/guix/self.scm index f70b1ecdd8..58ca4386f1 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2020 Arun Isaac ;;; ;;; This file is part of GNU Guix. ;;; @@ -459,16 +460,17 @@ a list of extra files, such as '(\"contributing\")." (with-imported-modules '((guix build utils)) #~(begin (use-modules (guix build utils) + (rnrs io ports) (ice-9 match)) (mkdir #$output) - ;; Create 'version.texi'. - ;; XXX: Can we use a more meaningful version string yet one that - ;; doesn't change at each commit? + ;; Create 'version.texi'. Use nearest tag written in .version as the + ;; version string. (call-with-output-file "version.texi" (lambda (port) - (let ((version "0.0-git")) + (let* ((version (call-with-input-file (string-append #$source "/.version") + get-string-all))) (format port " @set UPDATED 1 January 1970 @set UPDATED-MONTH January 1970 -- 2.26.2