public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pms:eapi-7 commit in: /
Date: Thu,  5 Apr 2018 16:57:47 +0000 (UTC)	[thread overview]
Message-ID: <1522946897.c9c5a2f0cf7671d73a78a544d28c361ecd5a2b3c.ulm@gentoo> (raw)

commit:     c9c5a2f0cf7671d73a78a544d28c361ecd5a2b3c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 27 21:23:22 2017 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Apr  5 16:48:17 2018 +0000
URL:        https://gitweb.gentoo.org/proj/pms.git/commit/?id=c9c5a2f0

EAPI 7 has version manipulation and comparison functions

Bug: https://bugs.gentoo.org/482170

 eapi-differences.tex |  4 +++
 pkg-mgr-commands.tex | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+)

diff --git a/eapi-differences.tex b/eapi-differences.tex
index a203f89..a626b74 100644
--- a/eapi-differences.tex
+++ b/eapi-differences.tex
@@ -290,6 +290,9 @@ Controllable stripping & \compactfeatureref{dostrip} &
 \t{in_iuse} & \compactfeatureref{in-iuse} &
     No & No & No & Yes & Yes \\
 
+\t{ver_*} commands & \compactfeatureref{ver-commands} &
+    No & No & No & No & Yes \\
+
 \t{unpack} absolute paths & \compactfeatureref{unpack-absolute} &
     No & No & No & Yes & Yes \\
 
@@ -468,6 +471,7 @@ EAPI 7 is EAPI 6 with the following changes:
 \item \t{die} is guaranteed to work in a subshell, \featureref{subshell-die}.
 \item \t{domo} installs to \t{/usr}, \featureref{domo-path}.
 \item Controllable stripping and \t{dostrip}, \featureref{dostrip}.
+\item Version manipulation and comparison commands, \featureref{ver-commands}.
 \end{compactitem}
 
 \ChangeWhenAddingAnEAPI{7}

diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
index f84f13d..09515ef 100644
--- a/pkg-mgr-commands.tex
+++ b/pkg-mgr-commands.tex
@@ -922,6 +922,86 @@ These functions check whitespace-separated lists for a particular value.
 \item[hasq] Deprecated synonym for \t{has}.
 \end{description}
 
+\subsection{Version manipulation and comparison commands}
+\featurelabel{ver-commands}
+These commands provide utilities for working with version strings. Their availability per EAPI is
+listed in table~\ref{tab:version-commands}.
+
+For the purpose of version manipulation commands, the specification provides a method for splitting
+an arbitrary version string (not necessarily conforming to section~\ref{sec:version-spec}) into
+a series of version components and version separators.
+
+A version component consists either purely of digits (\t{[0-9]+}) or purely of uppercase and
+lowercase ASCII letters (\t{[A-Za-z]+}). A version separator is either a string of any other
+characters (\t{[\textasciicircum A-Za-z0-9]}) or it occurs at the transition between a sequence
+of digits and a sequence of letters, or vice versa. In the latter case, the version separator is
+an empty string.
+
+The version string is processed left-to-right, with the successive version components being assigned
+successive indices starting with 1. The separator following a version component is assigned
+the index of the preceding version component. If the first version component is preceded by
+a non-empty string of version separator characters, this separator is assigned the index 0.
+
+The version components are presumed present if not empty. The version separators between version
+components are always presumed present, even if they are empty. The version separators preceding
+the first version component and following the last are only presumed present if they are not empty.
+
+Whenever the commands support ranges, the range is specified as an unsigned integer, optionally
+followed by a hyphen (\t{-}), which in turn is optionally followed by another unsigned integer.
+
+A single integer specifies a single component or separator index. An integer followed by a hyphen
+specifies all components or separators starting with the one at the specified index. Two integers
+separated by a hyphen specify a range of versions starting at the index specified by the first
+and ending at the second, inclusively.
+
+\begin{description}
+\item[ver_cut] Takes a range as the first argument, and optionally a version string as the second.
+    Prints a substring of the version string starting at the version component specified as start
+    of the range and ending at the version component specified as end of the range. If the version
+    string is not specified, \t{\$\{PVR\}} is used.
+
+    If the range spans outside the present version components, the missing components and separators
+    are presumed empty. In particular, the range starting at zero includes the zeroth version
+    separator if present, and the range spanning past the last version component includes the suffix
+    following it if present. A range that does not intersect with any present version components
+    yields an empty string.
+
+\item[ver_rs] Takes one or more pairs of arguments, optionally followed by a version string.
+    Every argument pair specifies a range and a replacement string. Prints a version string after
+    performing the specified separator substitutions. If the version string is not specified,
+    \t{\$\{PVR\}} is used.
+
+    For every argument pair specified, each of the version separators present at indices specified
+    by the range is replaced with the replacement string, in order. If the range spans outside
+    the range of present version separators, it is silently truncated.
+
+\item[ver_test] Takes two or three arguments. In the 3-argument form, takes an LHS version string,
+    followed by an operator, followed by an RHS version string. In the 2-argument form, the first
+    version string is omitted and \t{\$\{PVR\}} is used as LHS version string. The operator can be
+    \t{-eq} (equal to), \t{-ne} (not equal to), \t{-gt} (greater than), \t{-ge} (greater than or
+    equal to), \t{-lt} (less than) or \t{-le} (less than or equal to). Returns shell true (0) if
+    the specified relation between the LHS and RHS version strings is fulfilled.
+
+    Both version strings must conform to the version specification in
+    section~\ref{sec:version-spec}. Comparison is done using algorithm~\ref{alg:version-comparison}.
+\end{description}
+
+\ChangeWhenAddingAnEAPI{7}
+\begin{centertable}{EAPIs supporting version manipulation commands}
+    \label{tab:version-commands}
+    \begin{tabular}{llll}
+      \toprule
+      \multicolumn{1}{c}{\textbf{EAPI}} &
+      \multicolumn{1}{c}{\textbf{\t{ver_cut}?}} &
+      \multicolumn{1}{c}{\textbf{\t{ver_rs}?}} &
+      \multicolumn{1}{c}{\textbf{\t{ver_test}?}} \\
+      \midrule
+      0, 1, 2, 3, 4, 5, 6 & No  & No  & No  \\
+      7                   & Yes & Yes & Yes \\
+      \bottomrule
+    \end{tabular}
+\end{centertable}
+
 \subsection{Misc commands}
 The following commands are always available in the ebuild environment, but don't really fit in any
 of the above categories. Ebuilds must not run any of these commands once the current phase function


             reply	other threads:[~2018-04-05 16:57 UTC|newest]

Thread overview: 207+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05 16:57 Ulrich Müller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-04-30 22:13 [gentoo-commits] proj/pms:eapi-7 commit in: / Ulrich Müller
2018-04-26 20:16 Ulrich Müller
2018-04-26 20:16 Ulrich Müller
2018-04-26  6:30 Ulrich Müller
2018-04-05 16:57 Ulrich Müller
2018-04-05 16:57 Ulrich Müller
2018-03-09 16:51 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-24 12:58 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2018-02-18 13:36 Ulrich Müller
2017-11-12 19:14 Ulrich Müller
2017-11-09 20:57 Michał Górny
2017-11-09 16:51 Michał Górny
2017-11-07 18:22 Ulrich Müller
2017-11-07 17:23 Ulrich Müller
2017-11-07 17:23 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-09 17:31 Ulrich Müller
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 20:25 Michał Górny
2017-10-04 17:44 Michał Górny
2017-10-04 17:36 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:48 Michał Górny
2017-10-04 16:42 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:25 Michał Górny
2017-10-04 16:10 Michał Górny
2017-10-01  7:11 Michał Górny
2017-10-01  7:11 Michał Górny
2017-10-01  7:11 Michał Górny
2017-09-29 14:33 Michał Górny
2017-09-29 14:33 Michał Górny
2017-09-29 14:03 Michał Górny
2017-09-29 14:03 Michał Górny
2017-09-29 13:42 Michał Górny
2017-09-29  3:17 Michał Górny
2017-09-29  3:17 Michał Górny
2017-09-29  3:17 Michał Górny
2017-09-28 20:53 Michał Górny
2017-09-28 20:53 Michał Górny
2017-09-28 20:53 Michał Górny
2017-09-28 20:53 Michał Górny
2017-09-28 20:53 Michał Górny
2017-09-28 20:53 Michał Górny
2017-09-28 17:51 Michał Górny
2017-09-28 16:58 Michał Górny
2017-09-28 16:58 Michał Górny
2017-09-28 16:58 Michał Górny
2017-09-28 16:58 Michał Górny
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:12 Ulrich Müller
2017-04-10 18:11 [gentoo-commits] proj/pms:master " Ulrich Müller
2017-04-10 18:12 ` [gentoo-commits] proj/pms:eapi-7 " Ulrich Müller
2017-04-09  8:47 [gentoo-commits] proj/pms:master " Ulrich Müller
2017-04-10 18:12 ` [gentoo-commits] proj/pms:eapi-7 " Ulrich Müller
2017-03-29  5:12 [gentoo-commits] proj/pms:master " Ulrich Müller
2017-04-10 18:12 ` [gentoo-commits] proj/pms:eapi-7 " Ulrich Müller
2017-03-20 19:28 [gentoo-commits] proj/pms:master " Ulrich Müller
2017-04-10 18:12 ` [gentoo-commits] proj/pms:eapi-7 " Ulrich Müller
2017-03-18  7:23 [gentoo-commits] proj/pms:master " Ulrich Müller
2017-04-10 18:12 ` [gentoo-commits] proj/pms:eapi-7 " Ulrich Müller
2017-03-12 15:33 [gentoo-commits] proj/pms:master " Ulrich Müller
2017-04-10 18:12 ` [gentoo-commits] proj/pms:eapi-7 " Ulrich Müller
2017-02-23  7:46 [gentoo-commits] proj/pms:master " Ulrich Müller
2017-04-10 18:12 ` [gentoo-commits] proj/pms:eapi-7 " Ulrich Müller
2017-02-11  7:58 [gentoo-commits] proj/pms:master " Ulrich Müller
2017-04-10 18:12 ` [gentoo-commits] proj/pms:eapi-7 " Ulrich Müller
2017-02-11  7:58 [gentoo-commits] proj/pms:master " Ulrich Müller
2017-04-10 18:12 ` [gentoo-commits] proj/pms:eapi-7 " Ulrich Müller
2017-02-08 20:15 [gentoo-commits] proj/pms:master " Ulrich Müller
2017-04-10 18:12 ` [gentoo-commits] proj/pms:eapi-7 " Ulrich Müller
2016-11-29  7:33 [gentoo-commits] proj/pms:master " Ulrich Müller
2017-04-10 18:12 ` [gentoo-commits] proj/pms:eapi-7 " Ulrich Müller
2015-12-05 20:15 Ulrich Müller
2015-12-05 20:15 Ulrich Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1522946897.c9c5a2f0cf7671d73a78a544d28c361ecd5a2b3c.ulm@gentoo \
    --to=ulm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox