public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:eapi7-ver commit in: eclass/, eclass/tests/
Date: Wed,  6 Sep 2017 13:40:49 +0000 (UTC)	[thread overview]
Message-ID: <1504704809.f6b294ffb09d2b118c3b12f7daa1b79ef53bfc0d.mgorny@gentoo> (raw)

commit:     f6b294ffb09d2b118c3b12f7daa1b79ef53bfc0d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Sep  6 13:33:29 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep  6 13:33:29 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6b294ff

eapi7-ver.eclass: Handle versions with preceding sep

 eclass/eapi7-ver.eclass   | 9 ++-------
 eclass/tests/eapi7-ver.sh | 3 ++-
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/eclass/eapi7-ver.eclass b/eclass/eapi7-ver.eclass
index e9f2c453514..e2458deeb7b 100644
--- a/eclass/eapi7-ver.eclass
+++ b/eclass/eapi7-ver.eclass
@@ -40,14 +40,9 @@ _version_parse_range() {
 _version_split() {
 	local v=$1 LC_ALL=C
 
-	comp=("")
+	comp=()
 
-	# get first component
-	[[ ${v} =~ ^([A-Za-z]*|[0-9]*) ]] || die
-	comp+=("${BASH_REMATCH[1]}")
-	v=${v:${#BASH_REMATCH[0]}}
-
-	# get remaining separators and components
+	# get separators and components
 	while [[ ${v} ]]; do
 		[[ ${v} =~ ^([^A-Za-z0-9]*)([A-Za-z]*|[0-9]*) ]] || die
 		comp+=("${BASH_REMATCH[@]:1:2}")

diff --git a/eclass/tests/eapi7-ver.sh b/eclass/tests/eapi7-ver.sh
index 769886fd6b1..0f3a1f37e86 100755
--- a/eclass/tests/eapi7-ver.sh
+++ b/eclass/tests/eapi7-ver.sh
@@ -29,13 +29,14 @@ teq 2.3 version_cut 2- 1.2.3
 teq 1.2.3 version_cut 1- 1.2.3
 teq 3b version_cut 3-4 1.2.3b_alpha4
 teq alpha version_cut 5 1.2.3b_alpha4
-#teq 1.2 version_cut 1-2 .1.2.3
+teq 1.2 version_cut 1-2 .1.2.3
 #teq .1.2 version_cut 0-2 .1.2.3
 teq 2.3 version_cut 2-3 1.2.3.
 teq 2.3. version_cut 2- 1.2.3.
 
 teq 1.23-b_alpha4 version_rs 3 - 2 "" 1.2.3b_alpha4
 teq a1b_2-c-3-d4e5 version_rs 3-5 _ 4-6 - a1b2c3d4e5
+teq .1-2.3 version_rs 1 - .1.2.3
 
 txf version_cut foo 1.2.3
 #txf version_rs 5-3 _ a1b2c3d4e5


             reply	other threads:[~2017-09-06 13:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-06 13:40 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-09-21 12:57 [gentoo-commits] repo/gentoo:eapi7-ver commit in: eclass/, eclass/tests/ Ulrich Müller
2017-09-21  7:04 Michał Górny
2017-09-06 15:22 Michał Górny
2017-09-06 13:40 Michał Górny

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=1504704809.f6b294ffb09d2b118c3b12f7daa1b79ef53bfc0d.mgorny@gentoo \
    --to=mgorny@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