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: Mon,  9 Oct 2017 17:31:09 +0000 (UTC)	[thread overview]
Message-ID: <1507569001.ef92bc885bcd57c6c129aeb65242d5f295d5f7bf.ulm@gentoo> (raw)

commit:     ef92bc885bcd57c6c129aeb65242d5f295d5f7bf
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: Mon Oct  9 17:10:01 2017 +0000
URL:        https://gitweb.gentoo.org/proj/pms.git/commit/?id=ef92bc88

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 c68fffa..9f3f8be 100644
--- a/eapi-differences.tex
+++ b/eapi-differences.tex
@@ -41,6 +41,9 @@ of this document for a complete table of previous EAPIs.
 \bottomrule
 \endlastfoot
 
+\t{ver_*} functions & \compactfeatureref{ver-functions} &
+    No & No & No & No & Yes \\
+
 \t{package.mask} directory & \compactfeatureref{package-mask-dir} &
     No & No & No & No & Yes \\
 
@@ -383,6 +386,7 @@ EAPI 7 is EAPI 6 with the following changes:
 \item \t{package.mask}, \t{package.use}, \t{use.*} and \t{package.use.*} in a profile can be
     directories, \featureref{profile-file-dirs}.
 \item \t{dohtml} banned, \featureref{banned-commands}.
+\item Version manipulation and comparison functions added, \featureref{ver-functions}.
 \end{compactitem}
 
 \ChangeWhenAddingAnEAPI{7}

diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
index 495a4ce..5b65477 100644
--- a/pkg-mgr-commands.tex
+++ b/pkg-mgr-commands.tex
@@ -817,6 +817,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-functions}
+Those functions provide routines to work with version strings. Their availability per EAPI is listed
+in table~\ref{tab:version-functions}.
+
+For the purpose of version manipulation functions, the specification provides a method for splitting
+an arbitrary version string (not necessarily conforming to \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 a combination of
+uppercase and lowercase letters (\t{[a-zA-Z]+}). A version separator is either a string of any other
+characters (\t{[\textasciicircum 0-9a-zA-Z]}) 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-null 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 functions support ranges, the range is specified as a non-negative integer, optionally
+followed by a hyphen (\t{-}), which in turn is optionally followed by another non-negative 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 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 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 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, it takes a LHS version string,
+    followed by an operator, followed by RHS version string. In the 2-argument form, the first
+    version string is omitted and \t{\$\{PVR\}} is used as LHS version string. Returns 0
+    if the specified relation between LHS and RHS version strings is true.
+
+    The operator can be \t{-lt}, \t{-le}, \t{-eq}, \t{-ne}, \t{-ge} and \t{-gt} to test whether
+    LHS is respectively older than, older or equal, equal, not equal, newer or equal, and newer
+    than RHS. Both version strings must conform to the version specification
+    at~\ref{sec:version-spec}, the comparison is done using algorithm~\ref{alg:version-comparison}.
+\end{description}
+
+\ChangeWhenAddingAnEAPI{7}
+\begin{centertable}{EAPIs supporting version manipulation commands}
+    \label{tab:version-functions}
+    \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:[~2017-10-09 17:31 UTC|newest]

Thread overview: 207+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 17:31 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-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-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=1507569001.ef92bc885bcd57c6c129aeb65242d5f295d5f7bf.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