From patchwork Wed May 26 14:57:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 29606 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 60BC227BC81; Wed, 26 May 2021 15:59:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6FEB427BC78 for ; Wed, 26 May 2021 15:59:13 +0100 (BST) Received: from localhost ([::1]:50238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llv04-0003AX-Eg for patchwork@mira.cbaines.net; Wed, 26 May 2021 10:59:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lluzu-00038N-Fx for guix-patches@gnu.org; Wed, 26 May 2021 10:59:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38185) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lluzu-0001Mr-1z for guix-patches@gnu.org; Wed, 26 May 2021 10:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lluzu-0000fe-1Z for guix-patches@gnu.org; Wed, 26 May 2021 10:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48667] [PATCH] doc: Expound on how to specify the version of a package. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 May 2021 14:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48667 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48667@debbugs.gnu.org Cc: Nicolas Goaziou Received: via spool by 48667-submit@debbugs.gnu.org id=B48667.16220410892517 (code B ref 48667); Wed, 26 May 2021 14:59:01 +0000 Received: (at 48667) by debbugs.gnu.org; 26 May 2021 14:58:09 +0000 Received: from localhost ([127.0.0.1]:49731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lluz2-0000eV-LF for submit@debbugs.gnu.org; Wed, 26 May 2021 10:58:08 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:55384 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lluyz-0000dx-MO for 48667@debbugs.gnu.org; Wed, 26 May 2021 10:58:06 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1622041077; bh=ryvYajiLCaJfjws2LFHWPL+zSzcYfeaQ4lH/j/+AIy8=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Gf1K+sZKDTSmX5Ljzr4ApU3VmVbCQfjH6GAdl9rBODzeyfAUUp7nBcK9JXDkeqQAm o9uYu21lGOTkLYkeQRpZ4Vn7vX/dKu28FCVVU0ttHieOG+AB4sHfFiQ47qYDqG7TDu +qGHzKQ6upifWlnbNcaeMcgG8Nwa/W8o7BrRkqqU= In-Reply-To: <06217762b07f95d2ba2d40277d010647a926df68.1622019402.git.public@yoctocell.xyz> References: <06217762b07f95d2ba2d40277d010647a926df68.1622019402.git.public@yoctocell.xyz> Message-Id: <7a6a9bffa80fdfaa1e14015614cb638ff8cc7441.1622040691.git.public@yoctocell.xyz> Date: Wed, 26 May 2021 16:57:57 +0200 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" X-getmail-retrieved-from-mailbox: Patches * doc/guix.texi (package Reference): Describe how packages that lack a release or are pinned to an unreleased version should specify the ‘version’ field. Add documentation for the ‘git-version’ procedure. --- Changes since v1: * Remove the case for “version 0”. * Use @var{} instead of @code{} when appropriate, and @lisp instead of @example. * Be more specific about what to set COMMIT to. Git/Mercurial and SVN/Bzr should be handled differently. doc/guix.texi | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) base-commit: 3f2a4b098039bd374c76d524223de3c6c475f23e diff --git a/doc/guix.texi b/doc/guix.texi index e8b0485f78..9338136ebe 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -89,6 +89,7 @@ Copyright @copyright{} 2020 Jonathan Brielmaier@* Copyright @copyright{} 2020 Edgar Vincent@* Copyright @copyright{} 2021 Maxime Devos@* Copyright @copyright{} 2021 B. Wilson@* +Copyright @copyright{} 2021 Xinglu Chen@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -6651,7 +6652,21 @@ This is the data type representing a package recipe. The name of the package, as a string. @item @code{version} -The version of the package, as a string. +The version of the package, as a string. If there are no releases of +the package, or a unreleased version is desired, the version should +contain @samp{@var{VERSION}-@var{REVISION}.@var{COMMIT}}. @var{VERSION} +is the version of the package, and @var{REVISION} is the revision of the +Guix package (@code{0} if it is a new package). Whenever the package is +updated to a newer version the revision should also be bumped to reflect +the fact that package has been updated. If the fetch method for the +package is @code{git-fetch} or @code{hg-fetch} (@pxref{origin +Reference}), @var{COMMIT} should be the @dfn{commit} or @dfn{changeset} +corresponding to the version, it should only contain 7 characters. If +the fetch method is @code{git-fetch}, there is the @code{git-version} +procedure (see below) that makes it easier to specify the version. +Packages which use @code{svn-fetch} or @code{bzr-fetch} should set +@var{COMMIT} to the same value as the @code{revision} field in +@code{svn-reference} or @code{bzr-reference}. @item @code{source} An object telling how the source code for the package should be @@ -6757,6 +6772,15 @@ automatically corrected. @end table @end deftp +@deffn {Scheme Procedure} git-version @var{VERSION} @var{REVISION} @var{COMMIT} +Return the version string for packages using @code{git-fetch}. + +@lisp +(git-version "0.2.3" "0" "93818c936ee7e2f1ba1b315578bde363a7d43d05") +@result{} "0.2.3-0.93818c9" +@end lisp +@end deffn + @deffn {Scheme Syntax} this-package When used in the @emph{lexical scope} of a package field definition, this identifier resolves to the package being defined.