1 |
commit: 26cd98b3b63437489b1b30a6948f30a6978e0abc |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Aug 28 19:23:28 2018 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 28 19:23:28 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26cd98b3 |
7 |
|
8 |
dev-util/re2c: fix -V option handling, bug #664752 |
9 |
|
10 |
Patch by Mike Gilbert \o/ |
11 |
|
12 |
Repored-by: Thomas Deutschmann |
13 |
Closes: https://bugs.gentoo.org/664752 |
14 |
Bug: https://github.com/skvadrik/re2c/issues/211 |
15 |
Fixed-by: Mike Gilbert |
16 |
Package-Manager: Portage-2.3.48, Repoman-2.3.10 |
17 |
|
18 |
dev-util/re2c/files/re2c-1.1-dash-V.patch | 49 ++++++++++++++++++++++ |
19 |
.../re2c/{re2c-1.1.ebuild => re2c-1.1-r1.ebuild} | 4 ++ |
20 |
2 files changed, 53 insertions(+) |
21 |
|
22 |
diff --git a/dev-util/re2c/files/re2c-1.1-dash-V.patch b/dev-util/re2c/files/re2c-1.1-dash-V.patch |
23 |
new file mode 100644 |
24 |
index 00000000000..77c3d80dd12 |
25 |
--- /dev/null |
26 |
+++ b/dev-util/re2c/files/re2c-1.1-dash-V.patch |
27 |
@@ -0,0 +1,49 @@ |
28 |
+From 84a7bf8585c500572a8ad19f9458f31d34abbcdc Mon Sep 17 00:00:00 2001 |
29 |
+From: Mike Gilbert <floppym@g.o> |
30 |
+Date: Tue, 28 Aug 2018 12:01:07 -0400 |
31 |
+Subject: [PATCH] Rewrite vernum function |
32 |
+ |
33 |
+Fixes: https://github.com/skvadrik/re2c/issues/211 |
34 |
+--- |
35 |
+ re2c/src/conf/msg.cc | 27 +++++++++++++-------------- |
36 |
+ 1 file changed, 13 insertions(+), 14 deletions(-) |
37 |
+ |
38 |
+--- a/src/conf/msg.cc |
39 |
++++ b/src/conf/msg.cc |
40 |
+@@ -102,23 +102,22 @@ void usage() |
41 |
+ void vernum () |
42 |
+ { |
43 |
+ std::string vernum (PACKAGE_VERSION); |
44 |
+- if (vernum[1] == '.') |
45 |
+- { |
46 |
+- vernum.insert(0, "0"); |
47 |
+- } |
48 |
+- vernum.erase(2, 1); |
49 |
+- if (vernum[3] == '.') |
50 |
+- { |
51 |
+- vernum.insert(2, "0"); |
52 |
+- } |
53 |
+- vernum.erase(4, 1); |
54 |
+- if (vernum.length() < 6 || vernum[5] < '0' || vernum[5] > '9') |
55 |
++ std::string parts[3]; |
56 |
++ unsigned p = 0; |
57 |
++ |
58 |
++ for (unsigned i = 0; p < 3 && i < vernum.length (); i++) |
59 |
+ { |
60 |
+- vernum.insert(4, "0"); |
61 |
++ if (vernum[i] == '.') |
62 |
++ p++; |
63 |
++ else |
64 |
++ parts[p].push_back (vernum[i]); |
65 |
+ } |
66 |
+- vernum.resize(6, '0'); |
67 |
+ |
68 |
+- printf ("%s\n", vernum.c_str ()); |
69 |
++ for (p = 0; p < 3; p++) |
70 |
++ while (parts[p].length () < 2) |
71 |
++ parts[p].insert (0, 1, '0'); |
72 |
++ |
73 |
++ printf ("%s%s%s\n", parts[0].c_str (), parts[1].c_str (), parts[2].c_str ()); |
74 |
+ } |
75 |
+ |
76 |
+ void version () |
77 |
|
78 |
diff --git a/dev-util/re2c/re2c-1.1.ebuild b/dev-util/re2c/re2c-1.1-r1.ebuild |
79 |
similarity index 94% |
80 |
rename from dev-util/re2c/re2c-1.1.ebuild |
81 |
rename to dev-util/re2c/re2c-1.1-r1.ebuild |
82 |
index bd4ecbe5865..0599306ecfc 100644 |
83 |
--- a/dev-util/re2c/re2c-1.1.ebuild |
84 |
+++ b/dev-util/re2c/re2c-1.1-r1.ebuild |
85 |
@@ -13,6 +13,10 @@ LICENSE="public-domain" |
86 |
SLOT="0" |
87 |
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" |
88 |
|
89 |
+PATCHES=( |
90 |
+ "${FILESDIR}"/${P}-dash-V.patch |
91 |
+) |
92 |
+ |
93 |
src_prepare() { |
94 |
default |
95 |
export ac_cv_path_BISON="no" |