Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: mail-filter/mapson/, mail-filter/mapson/files/
Date: Fri, 26 May 2017 21:01:17
Message-Id: 1495832297.2fa577ac669729cbad4233e54d97185b2705e4d1.soap@gentoo
1 commit: 2fa577ac669729cbad4233e54d97185b2705e4d1
2 Author: Peter Levine <plevine457 <AT> gmail <DOT> com>
3 AuthorDate: Sun May 21 19:23:33 2017 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Fri May 26 20:58:17 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2fa577ac
7
8 mail-filter/mapson: Fix building with GCC-6
9
10 Bug: https://bugs.gentoo.org/show_bug.cgi?id=594382
11 Package-Manager: Portage-2.3.5, Repoman-2.3.2
12 Closes: https://github.com/gentoo/gentoo/pull/4690
13
14 mail-filter/mapson/files/mapson-3.3-gcc6.patch | 287 +++++++++++++++++++++++++
15 mail-filter/mapson/mapson-3.3.ebuild | 6 +-
16 2 files changed, 292 insertions(+), 1 deletion(-)
17
18 diff --git a/mail-filter/mapson/files/mapson-3.3-gcc6.patch b/mail-filter/mapson/files/mapson-3.3-gcc6.patch
19 new file mode 100644
20 index 00000000000..d43c2cb95ea
21 --- /dev/null
22 +++ b/mail-filter/mapson/files/mapson-3.3-gcc6.patch
23 @@ -0,0 +1,287 @@
24 +--- a/accept-confirmation.cpp
25 ++++ b/accept-confirmation.cpp
26 +@@ -52,7 +52,7 @@
27 + for (rc = read(fd, tmp, sizeof(tmp)); rc > 0; rc = read(fd, tmp, sizeof(tmp)))
28 + mail.append(tmp, rc);
29 + if (rc < 0)
30 +- throw system_error(string("Failed to read mail file '") + filename + "'");
31 ++ throw mapson_system_error(string("Failed to read mail file '") + filename + "'");
32 + deliver(mail);
33 + unlink(filename.c_str());
34 + }
35 +--- a/address-db.cpp
36 ++++ b/address-db.cpp
37 +@@ -26,7 +26,7 @@
38 +
39 + fd = open(filename.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
40 + if (fd < 0)
41 +- throw system_error(string("Can't open address db '") +
42 ++ throw mapson_system_error(string("Can't open address db '") +
43 + filename + "' for reading");
44 + fd_sentry sentry(fd);
45 +
46 +@@ -36,7 +36,7 @@
47 + lock.l_start = 0;
48 + lock.l_len = 0;
49 + if (fcntl(fd, F_SETLKW, &lock) != 0)
50 +- throw system_error(string("Can't lock file '") + filename + "'");
51 ++ throw mapson_system_error(string("Can't lock file '") + filename + "'");
52 +
53 + // Read the file into memory.
54 +
55 +@@ -47,7 +47,7 @@
56 + rc = read(fd, buffer, sizeof(buffer)))
57 + data.append(buffer, rc);
58 + if (rc < 0)
59 +- throw system_error(string("Failed to read address db '") +
60 ++ throw mapson_system_error(string("Failed to read address db '") +
61 + filename + "' into memory");
62 +
63 + // Success. Don't close the file descriptor.
64 +@@ -107,7 +107,7 @@
65 + {
66 + ssize_t rc = write(fd, data.data()+len, data.size()-len);
67 + if (rc < 0)
68 +- throw system_error(string("Failed writing to the address db '") + filename + "'");
69 ++ throw mapson_system_error(string("Failed writing to the address db '") + filename + "'");
70 + else
71 + len += rc;
72 + }
73 +--- a/config.cpp
74 ++++ b/config.cpp
75 +@@ -70,9 +70,9 @@
76 + string tmp = string(name) + "=" + value;
77 + char* env = strdup(tmp.c_str());
78 + if (env == 0)
79 +- throw system_error("strdup() failed");
80 ++ throw mapson_system_error("strdup() failed");
81 + if (putenv(env) != 0)
82 +- throw system_error("putenv() failed");
83 ++ throw mapson_system_error("putenv() failed");
84 + }
85 + }
86 +
87 +@@ -84,7 +84,7 @@
88 +
89 + pwd_sentry sentry(getpwuid(getuid()));
90 + if (sentry.pwd == 0)
91 +- throw system_error("Can't get my user name");
92 ++ throw mapson_system_error("Can't get my user name");
93 + log_file.assign(sentry.pwd->pw_dir).append("/.mapson/log");
94 + spool_dir.assign(sentry.pwd->pw_dir).append("/.mapson/spool");
95 + address_db.assign(sentry.pwd->pw_dir).append("/.mapson/address-db");
96 +--- a/deliver.cpp
97 ++++ b/deliver.cpp
98 +@@ -31,11 +31,11 @@
99 +
100 + FILE* fh = popen(config->mailbox.c_str()+1, "w");
101 + if (fh == NULL)
102 +- throw system_error(string("Can't start delivery pipe '") + config->mailbox + "'");
103 ++ throw mapson_system_error(string("Can't start delivery pipe '") + config->mailbox + "'");
104 + int len = fwrite(mail.data(), mail.size(), 1, fh);
105 + pclose(fh);
106 + if (len != 1)
107 +- throw system_error(string("Failed to pipe to MTA process '") + config->mailbox + "'");
108 ++ throw mapson_system_error(string("Failed to pipe to MTA process '") + config->mailbox + "'");
109 + }
110 + else
111 + {
112 +@@ -43,7 +43,7 @@
113 +
114 + int fd = open(config->mailbox.c_str(), O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
115 + if (fd < 0)
116 +- throw system_error(string("Can't open mailbox file '") + config->mailbox + "' for writing");
117 ++ throw mapson_system_error(string("Can't open mailbox file '") + config->mailbox + "' for writing");
118 + fd_sentry sentry(fd);
119 +
120 + struct flock lock;
121 +@@ -52,13 +52,13 @@
122 + lock.l_start = 0;
123 + lock.l_len = 0;
124 + if (fcntl(fd, F_SETLKW, &lock) != 0)
125 +- throw system_error(string("Can't lock file '") + config->mailbox + "'");
126 ++ throw mapson_system_error(string("Can't lock file '") + config->mailbox + "'");
127 +
128 + for (size_t len = 0; len < mail.size(); )
129 + {
130 + ssize_t rc = write(fd, mail.data()+len, mail.size()-len);
131 + if (rc < 0)
132 +- throw system_error(string("Failed writing to the mailbox file '") + config->mailbox + "'");
133 ++ throw mapson_system_error(string("Failed writing to the mailbox file '") + config->mailbox + "'");
134 + else
135 + len += rc;
136 + }
137 +--- a/lines2regex.cpp
138 ++++ b/lines2regex.cpp
139 +@@ -29,7 +29,7 @@
140 + if (errno == ENOENT)
141 + return "";
142 + else
143 +- throw system_error(string("Can't open regex db '") +
144 ++ throw mapson_system_error(string("Can't open regex db '") +
145 + filename + "' for reading");
146 + }
147 + fd_sentry sentry(fd);
148 +@@ -40,7 +40,7 @@
149 + lock.l_start = 0;
150 + lock.l_len = 0;
151 + if (fcntl(fd, F_SETLKW, &lock) != 0)
152 +- throw system_error(string("Can't lock file '") + filename + "'");
153 ++ throw mapson_system_error(string("Can't lock file '") + filename + "'");
154 +
155 + // Read the file into memory.
156 +
157 +@@ -52,7 +52,7 @@
158 + rc = read(fd, buffer, sizeof(buffer)))
159 + data.append(buffer, rc);
160 + if (rc < 0)
161 +- throw system_error(string("Failed to read regex db '") +
162 ++ throw mapson_system_error(string("Failed to read regex db '") +
163 + filename + "' into memory");
164 +
165 + // Walk through the lines and compile the regexes.
166 +--- a/log.cpp
167 ++++ b/log.cpp
168 +@@ -30,10 +30,10 @@
169 + char buf[64];
170 + time_t tstamp = time(0);
171 + if (tstamp == static_cast<time_t>(-1))
172 +- throw system_error("time(2) failed");
173 ++ throw mapson_system_error("time(2) failed");
174 + struct tm* tmtime = localtime(&tstamp);
175 + if (tmtime == 0)
176 +- throw system_error("localtime(3) failed");
177 ++ throw mapson_system_error("localtime(3) failed");
178 + strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tmtime);
179 + return buf;
180 + }
181 +@@ -42,7 +42,7 @@
182 + {
183 + fileh.file = fopen(file, "a");
184 + if (fileh.file == 0)
185 +- throw system_error(string("Could not open log file ") + file);
186 ++ throw mapson_system_error(string("Could not open log file ") + file);
187 +
188 + struct flock lock;
189 + lock.l_type = F_WRLCK;
190 +@@ -50,7 +50,7 @@
191 + lock.l_start = 0;
192 + lock.l_len = 0;
193 + if (fcntl(fileno(fileh.file), F_SETLKW, &lock) != 0)
194 +- throw system_error(string("Can't lock file '") + file + "'");
195 ++ throw mapson_system_error(string("Can't lock file '") + file + "'");
196 + }
197 +
198 + void _debug(const char* fmt, ...)
199 +--- a/mapson.cpp
200 ++++ b/mapson.cpp
201 +@@ -62,7 +62,7 @@
202 +
203 + fd = open(argv[i], O_RDONLY, 0);
204 + if (fd < 0)
205 +- throw system_error("Can't open file for reading");
206 ++ throw mapson_system_error("Can't open file for reading");
207 + fd_sentry sentry(fd);
208 + string mail;
209 + for (rc = read(fd, buffer, sizeof(buffer));
210 +@@ -72,7 +72,7 @@
211 + mail.append(buffer, rc);
212 + }
213 + if (rc < 0)
214 +- throw system_error("Failed to read from file");
215 ++ throw mapson_system_error("Failed to read from file");
216 +
217 + // Extract the mail addresses.
218 +
219 +@@ -196,7 +196,7 @@
220 + mail.append(buffer, rc);
221 + }
222 + if (rc < 0)
223 +- throw system_error("Failed to read mail from standard input");
224 ++ throw mapson_system_error("Failed to read mail from standard input");
225 +
226 + // Check whether the mail contains a valid cookie. If it does,
227 + // mail will be replaced with the original e-mail, that was
228 +--- a/parse-config-file.cpp
229 ++++ b/parse-config-file.cpp
230 +@@ -55,7 +55,7 @@
231 +
232 + std::ifstream file(filename);
233 + if (!file)
234 +- throw system_error(std::string("parse_config_file() failed to open '") + filename + "'");
235 ++ throw mapson_system_error(std::string("parse_config_file() failed to open '") + filename + "'");
236 +
237 + // Now we read line by line and process each one seperately.
238 +
239 +--- a/request-confirmation.cpp
240 ++++ b/request-confirmation.cpp
241 +@@ -157,7 +157,7 @@
242 + string filename = config->request_for_confirmation_file;
243 + int fd = multi_open(filename, O_RDONLY, S_IRUSR | S_IWUSR);
244 + if (fd < 0)
245 +- throw system_error(string("Can't open request-mail template file '") + filename + "' for reading");
246 ++ throw mapson_system_error(string("Can't open request-mail template file '") + filename + "' for reading");
247 + fd_sentry sentry(fd);
248 +
249 + // Read the file into memory.
250 +@@ -167,7 +167,7 @@
251 + for (rc = read(fd, buffer, sizeof(buffer)); rc > 0; rc = read(fd, buffer, sizeof(buffer)))
252 + mail_template.append(buffer, rc);
253 + if (rc < 0)
254 +- throw system_error(string("Failed to read request-mail template file '") + filename + "' into memory");
255 ++ throw mapson_system_error(string("Failed to read request-mail template file '") + filename + "' into memory");
256 +
257 + // Expand variables in the template.
258 +
259 +@@ -180,11 +180,11 @@
260 + debug(("Executing mail transport agent '%s'.", config->mta.c_str()));
261 + FILE* fh = popen(config->mta.c_str(), "w");
262 + if (fh == NULL)
263 +- throw system_error(string("Can't start MTA '") + config->mta + "'");
264 ++ throw mapson_system_error(string("Can't start MTA '") + config->mta + "'");
265 + if (fwrite(mail_template.data(), mail_template.size(), 1, fh) != 1)
266 + {
267 + pclose(fh);
268 +- throw system_error(string("Failed to pipe to MTA process '") + config->mta + "'");
269 ++ throw mapson_system_error(string("Failed to pipe to MTA process '") + config->mta + "'");
270 + }
271 + pclose(fh);
272 + }
273 +--- a/spool.cpp
274 ++++ b/spool.cpp
275 +@@ -44,13 +44,13 @@
276 + info("Spooling e-mail '%s' as '%s'.", config->message_id.c_str(), filename.c_str());
277 + int fd = open(filename.c_str(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
278 + if (fd < 0)
279 +- throw system_error(string("Can't open spool file '") + filename + "' for writing");
280 ++ throw mapson_system_error(string("Can't open spool file '") + filename + "' for writing");
281 + fd_sentry sentry(fd);
282 + for (size_t len = 0; len < mail.size(); )
283 + {
284 + ssize_t rc = write(fd, mail.data()+len, mail.size()-len);
285 + if (rc < 0)
286 +- throw system_error(string("Failed writing to the spool file '") + filename + "'");
287 ++ throw mapson_system_error(string("Failed writing to the spool file '") + filename + "'");
288 + else
289 + len += rc;
290 + }
291 +--- a/system-error.hpp
292 ++++ b/system-error.hpp
293 +@@ -23,14 +23,14 @@
294 + #include <string>
295 + #include <cstring>
296 +
297 +-class system_error : public std::runtime_error
298 ++class mapson_system_error : public std::runtime_error
299 + {
300 + public:
301 +- system_error() : runtime_error(str())
302 ++ mapson_system_error() : runtime_error(str())
303 + {
304 + }
305 +
306 +- explicit system_error(std::string const & msg)
307 ++ explicit mapson_system_error(std::string const & msg)
308 + : runtime_error(msg + ": " + str())
309 + {
310 + }
311
312 diff --git a/mail-filter/mapson/mapson-3.3.ebuild b/mail-filter/mapson/mapson-3.3.ebuild
313 index 99a0464b6fb..5c6ce7bac66 100644
314 --- a/mail-filter/mapson/mapson-3.3.ebuild
315 +++ b/mail-filter/mapson/mapson-3.3.ebuild
316 @@ -1,4 +1,4 @@
317 -# Copyright 1999-2013 Gentoo Foundation
318 +# Copyright 1999-2017 Gentoo Foundation
319 # Distributed under the terms of the GNU General Public License v2
320
321 EAPI=4
322 @@ -16,6 +16,10 @@ IUSE="debug"
323 RDEPEND="virtual/mta"
324 DEPEND="${RDEPEND}"
325
326 +src_prepare() {
327 + epatch "${FILESDIR}"/${P}-gcc6.patch
328 +}
329 +
330 src_configure() {
331 econf $(use_with debug)
332 }