public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sergei Trofimovich" <slyfox@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/re2c/, dev-util/re2c/files/
Date: Tue, 28 Aug 2018 19:23:53 +0000 (UTC)	[thread overview]
Message-ID: <1535484208.26cd98b3b63437489b1b30a6948f30a6978e0abc.slyfox@gentoo> (raw)

commit:     26cd98b3b63437489b1b30a6948f30a6978e0abc
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 28 19:23:28 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue Aug 28 19:23:28 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26cd98b3

dev-util/re2c: fix -V option handling, bug #664752

Patch by Mike Gilbert \o/

Repored-by: Thomas Deutschmann
Closes: https://bugs.gentoo.org/664752
Bug: https://github.com/skvadrik/re2c/issues/211
Fixed-by: Mike Gilbert
Package-Manager: Portage-2.3.48, Repoman-2.3.10

 dev-util/re2c/files/re2c-1.1-dash-V.patch          | 49 ++++++++++++++++++++++
 .../re2c/{re2c-1.1.ebuild => re2c-1.1-r1.ebuild}   |  4 ++
 2 files changed, 53 insertions(+)

diff --git a/dev-util/re2c/files/re2c-1.1-dash-V.patch b/dev-util/re2c/files/re2c-1.1-dash-V.patch
new file mode 100644
index 00000000000..77c3d80dd12
--- /dev/null
+++ b/dev-util/re2c/files/re2c-1.1-dash-V.patch
@@ -0,0 +1,49 @@
+From 84a7bf8585c500572a8ad19f9458f31d34abbcdc Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Tue, 28 Aug 2018 12:01:07 -0400
+Subject: [PATCH] Rewrite vernum function
+
+Fixes: https://github.com/skvadrik/re2c/issues/211
+---
+ re2c/src/conf/msg.cc | 27 +++++++++++++--------------
+ 1 file changed, 13 insertions(+), 14 deletions(-)
+
+--- a/src/conf/msg.cc
++++ b/src/conf/msg.cc
+@@ -102,23 +102,22 @@ void usage()
+ void vernum ()
+ {
+     std::string vernum (PACKAGE_VERSION);
+-    if (vernum[1] == '.')
+-    {
+-        vernum.insert(0, "0");
+-    }
+-    vernum.erase(2, 1);
+-    if (vernum[3] == '.')
+-    {
+-        vernum.insert(2, "0");
+-    }
+-    vernum.erase(4, 1);
+-    if (vernum.length() < 6 || vernum[5] < '0' || vernum[5] > '9')
++    std::string parts[3];
++    unsigned p = 0;
++
++    for (unsigned i = 0; p < 3 && i < vernum.length (); i++)
+     {
+-        vernum.insert(4, "0");
++        if (vernum[i] == '.')
++            p++;
++        else
++            parts[p].push_back (vernum[i]);
+     }
+-    vernum.resize(6, '0');
+ 
+-    printf ("%s\n", vernum.c_str ());
++    for (p = 0; p < 3; p++)
++        while (parts[p].length () < 2)
++            parts[p].insert (0, 1, '0');
++
++    printf ("%s%s%s\n", parts[0].c_str (), parts[1].c_str (), parts[2].c_str ());
+ }
+ 
+ void version ()

diff --git a/dev-util/re2c/re2c-1.1.ebuild b/dev-util/re2c/re2c-1.1-r1.ebuild
similarity index 94%
rename from dev-util/re2c/re2c-1.1.ebuild
rename to dev-util/re2c/re2c-1.1-r1.ebuild
index bd4ecbe5865..0599306ecfc 100644
--- a/dev-util/re2c/re2c-1.1.ebuild
+++ b/dev-util/re2c/re2c-1.1-r1.ebuild
@@ -13,6 +13,10 @@ LICENSE="public-domain"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
 
+PATCHES=(
+	"${FILESDIR}"/${P}-dash-V.patch
+)
+
 src_prepare() {
 	default
 	export ac_cv_path_BISON="no"


             reply	other threads:[~2018-08-28 19:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28 19:23 Sergei Trofimovich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-05-03  9:14 [gentoo-commits] repo/gentoo:master commit in: dev-util/re2c/, dev-util/re2c/files/ Sergei Trofimovich
2020-04-19 19:11 Sergei Trofimovich

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=1535484208.26cd98b3b63437489b1b30a6948f30a6978e0abc.slyfox@gentoo \
    --to=slyfox@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