summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--news/newsbeuter/Makefile4
-rw-r--r--news/newsbeuter/distinfo4
-rw-r--r--news/newsbeuter/patches/patch-include_configcontainer.h20
-rw-r--r--news/newsbeuter/patches/patch-src_configcontainer.cpp77
4 files changed, 102 insertions, 3 deletions
diff --git a/news/newsbeuter/Makefile b/news/newsbeuter/Makefile
index 8e9d845f65d..4c9189513ac 100644
--- a/news/newsbeuter/Makefile
+++ b/news/newsbeuter/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.4 2016/12/04 05:17:39 ryoon Exp $
+# $NetBSD: Makefile,v 1.5 2016/12/16 00:00:25 joerg Exp $
DISTNAME= newsbeuter-2.9
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= news
MASTER_SITES= http://www.newsbeuter.org/downloads/
diff --git a/news/newsbeuter/distinfo b/news/newsbeuter/distinfo
index 10f44f52e00..a9dd4e8f0b9 100644
--- a/news/newsbeuter/distinfo
+++ b/news/newsbeuter/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.1 2016/05/24 09:27:09 leot Exp $
+$NetBSD: distinfo,v 1.2 2016/12/16 00:00:25 joerg Exp $
SHA1 (newsbeuter-2.9.tar.gz) = e0d61cda874ea9b77ed27f2edfea50a6ea471894
RMD160 (newsbeuter-2.9.tar.gz) = b93adbf5305191c40f3e4b2d770d9984bb7c32e3
@@ -6,4 +6,6 @@ SHA512 (newsbeuter-2.9.tar.gz) = b173008c8c8d3729f8ccef3ce62645a05c1803fb842d5c0
Size (newsbeuter-2.9.tar.gz) = 432763 bytes
SHA1 (patch-Makefile) = 53d6ddfa518a1a371428afdf36745028530b30de
SHA1 (patch-config.sh) = e5d4adf96cae46c8febf818ff03b4f598a865945
+SHA1 (patch-include_configcontainer.h) = 54c7756cf29550c60181c3cdf52e9178183b78ed
+SHA1 (patch-src_configcontainer.cpp) = 3f799235a4d36acbfa3938ed68abd48776eb143f
SHA1 (patch-src_controller.cpp) = 927b11064deac38acbb577aa0d3f750f72c0e55a
diff --git a/news/newsbeuter/patches/patch-include_configcontainer.h b/news/newsbeuter/patches/patch-include_configcontainer.h
new file mode 100644
index 00000000000..8b3c08d1d5f
--- /dev/null
+++ b/news/newsbeuter/patches/patch-include_configcontainer.h
@@ -0,0 +1,20 @@
+$NetBSD: patch-include_configcontainer.h,v 1.1 2016/12/16 00:00:25 joerg Exp $
+
+Avoid unnecessary string copies.
+
+Passing non-POD types to variadic functions is UB, so use C++11 rvalues
+and proper typing.
+
+--- include/configcontainer.h.orig 2016-12-15 14:37:54.279263729 +0000
++++ include/configcontainer.h
+@@ -8,8 +8,8 @@ namespace newsbeuter {
+
+ struct configdata {
+ enum configdata_type { INVALID, BOOL, INT, STR, PATH, ALIAS, ENUM };
+- configdata(std::string v = "", configdata_type t = INVALID, bool m = false) : value(v), default_value(v), type(t), multi_option(m) { }
+- configdata(std::string v, ...);
++ configdata(const std::string &v = "", configdata_type t = INVALID, bool m = false) : value(v), default_value(v), type(t), multi_option(m) { }
++ configdata(const std::string &v, std::set<std::string> &&);
+ std::string value;
+ std::string default_value;
+ configdata_type type;
diff --git a/news/newsbeuter/patches/patch-src_configcontainer.cpp b/news/newsbeuter/patches/patch-src_configcontainer.cpp
new file mode 100644
index 00000000000..f4119bea99d
--- /dev/null
+++ b/news/newsbeuter/patches/patch-src_configcontainer.cpp
@@ -0,0 +1,77 @@
+$NetBSD: patch-src_configcontainer.cpp,v 1.1 2016/12/16 00:00:25 joerg Exp $
+
+Passing non-POD types to variadic functions is UB, so use C++11 rvalues
+and proper typing.
+
+--- src/configcontainer.cpp.orig 2016-12-15 14:37:26.527419424 +0000
++++ src/configcontainer.cpp
+@@ -15,20 +15,8 @@
+
+ namespace newsbeuter {
+
+-configdata::configdata(std::string v, ...) : value(v), default_value(v), type(ENUM) {
+- va_list ap;
+- va_start(ap, v);
+-
+- const char * arg;
+-
+- do {
+- arg = va_arg(ap, const char *);
+- if (arg) {
+- enum_values.insert(arg);
+- }
+- } while (arg != NULL);
+-
+- va_end(ap);
++configdata::configdata(const std::string &v, std::set<std::string> &&enumv) : value(v), default_value(v), type(ENUM) {
++ enum_values = std::move(enumv);
+ }
+
+ configcontainer::configcontainer() {
+@@ -51,8 +39,8 @@ configcontainer::configcontainer() {
+ config_data["cache-file"] = configdata("", configdata::PATH);
+ config_data["proxy"] = configdata("", configdata::STR);
+ config_data["proxy-auth"] = configdata("", configdata::STR);
+- config_data["proxy-auth-method"] = configdata("any", "any", "basic", "digest", "digest_ie", "gssnegotiate", "ntlm", "anysafe", NULL);
+- config_data["http-auth-method"] = configdata("any", "any", "basic", "digest", "digest_ie", "gssnegotiate", "ntlm", "anysafe", NULL);
++ config_data["proxy-auth-method"] = configdata("any", std::set<std::string>({"any", "basic", "digest", "digest_ie", "gssnegotiate", "ntlm", "anysafe"}));
++ config_data["http-auth-method"] = configdata("any", std::set<std::string>({"any", "basic", "digest", "digest_ie", "gssnegotiate", "ntlm", "anysafe"}));
+ config_data["confirm-exit"] = configdata("no", configdata::BOOL);
+ config_data["error-log"] = configdata("", configdata::PATH);
+ config_data["notify-screen"] = configdata("no", configdata::BOOL);
+@@ -62,7 +50,7 @@ configcontainer::configcontainer() {
+ config_data["notify-program"] = configdata("", configdata::PATH);
+ config_data["notify-format"] = configdata(_("newsbeuter: finished reload, %f unread feeds (%n unread articles total)"), configdata::STR);
+ config_data["datetime-format"] = configdata("%b %d", configdata::STR);
+- config_data["urls-source"] = configdata("local", "local", "opml", "oldreader", "ttrss", "newsblur", "feedhq", NULL); // enum
++ config_data["urls-source"] = configdata("local", std::set<std::string>({"local", "opml", "oldreader", "ttrss", "newsblur", "feedhq"})); // enum
+ config_data["bookmark-cmd"] = configdata("", configdata::STR);
+ config_data["opml-url"] = configdata("", configdata::STR, true);
+ config_data["html-renderer"] = configdata("internal", configdata::PATH);
+@@ -90,7 +78,7 @@ configcontainer::configcontainer() {
+ config_data["history-limit"] = configdata("100", configdata::INT);
+ config_data["prepopulate-query-feeds"] = configdata("false", configdata::BOOL);
+ config_data["goto-first-unread"] = configdata("true", configdata::BOOL);
+- config_data["proxy-type"] = configdata("http", "http", "socks4", "socks4a", "socks5", NULL); // enum
++ config_data["proxy-type"] = configdata("http", std::set<std::string>({"http", "socks4", "socks4a", "socks5"})); // enum
+ config_data["oldreader-login"] = configdata("", configdata::STR);
+ config_data["oldreader-password"] = configdata("", configdata::STR);
+ config_data["oldreader-passwordfile"] = configdata("", configdata::PATH);
+@@ -106,7 +94,7 @@ configcontainer::configcontainer() {
+ config_data["feedhq-show-special-feeds"] = configdata("true", configdata::BOOL);
+ config_data["feedhq-min-items"] = configdata("20", configdata::INT);
+ config_data["feedhq-url"] = configdata("https://feedhq.org/", configdata::STR);
+- config_data["ignore-mode"] = configdata("download", "download", "display", NULL); // enum
++ config_data["ignore-mode"] = configdata("download", std::set<std::string>({"download", "display"})); // enum
+ config_data["max-download-speed"] = configdata("0", configdata::INT);
+ config_data["cookie-cache"] = configdata("", configdata::PATH);
+ config_data["download-full-page"] = configdata("false", configdata::BOOL);
+@@ -115,7 +103,7 @@ configcontainer::configcontainer() {
+ config_data["ttrss-password"] = configdata("", configdata::STR);
+ config_data["ttrss-passwordfile"] = configdata("", configdata::PATH);
+ config_data["ttrss-url"] = configdata("", configdata::STR);
+- config_data["ttrss-mode"] = configdata("multi", "single", "multi", NULL); // enum
++ config_data["ttrss-mode"] = configdata("multi", std::set<std::string>({"single", "multi"})); // enum
+ config_data["ttrss-flag-star"] = configdata("", configdata::STR);
+ config_data["ttrss-flag-publish"] = configdata("", configdata::STR);
+ config_data["newsblur-login"] = configdata("", configdata::STR);