6 changed files with 107 additions and 53 deletions
@ -1,17 +0,0 @@ |
|||||
diff -u -r ../newsbeuter-2.9/src/utils.cpp ./src/utils.cpp
|
|
||||
--- ../newsbeuter-2.9/src/utils.cpp 2015-02-19 11:56:59.000000000 +0100
|
|
||||
+++ ./src/utils.cpp 2017-07-01 00:13:42.783350794 +0200
|
|
||||
@@ -37,6 +41,13 @@
|
|
||||
#include <openssl/crypto.h> |
|
||||
#endif |
|
||||
|
|
||||
+#ifdef __ANDROID__
|
|
||||
+#include <sys/file.h>
|
|
||||
+inline int lockf(int fd, int cmd, off_t) {
|
|
||||
+ return flock(fd, cmd);
|
|
||||
+}
|
|
||||
+#endif
|
|
||||
+
|
|
||||
namespace newsbeuter { |
|
||||
|
|
||||
std::vector<std::string> utils::tokenize_quoted(const std::string& str, std::string delimiters) { |
|
@ -1,43 +1,65 @@ |
|||||
diff -u -r ../newsboat-2.10.1/Makefile ./Makefile
|
diff -u -r ../newsboat-2.10.2/Makefile ./Makefile
|
||||
--- ../newsboat-2.10.1/Makefile 2017-09-22 22:01:50.000000000 +0200
|
--- ../newsboat-2.10.2/Makefile 2017-12-25 18:49:35.000000000 +0100
|
||||
+++ ./Makefile 2017-11-03 23:23:52.980621011 +0100
|
+++ ./Makefile 2017-12-27 00:19:11.167077932 +0100
|
||||
@@ -21,8 +21,8 @@
|
@@ -9,6 +9,7 @@
|
||||
|
|
||||
|
# compiler |
||||
|
CXX?=c++ |
||||
|
+CXX_host?=c++
|
||||
|
|
||||
|
# compiler and linker flags |
||||
|
DEFINES=-DLOCALEDIR=\"$(localedir)\" |
||||
|
@@ -20,8 +21,8 @@
|
||||
|
|
||||
WARNFLAGS=-Werror -Wall -Wextra -Wunreachable-code |
WARNFLAGS=-Werror -Wall -Wextra -Wunreachable-code |
||||
INCLUDES=-Iinclude -Istfl -Ifilter -I. -Irss |
INCLUDES=-Iinclude -Istfl -Ifilter -I. -Irss |
||||
BARE_CXXFLAGS=-std=c++11 -ggdb $(INCLUDES) |
-BARE_CXXFLAGS=-std=c++11 -ggdb $(INCLUDES)
|
||||
-CXXFLAGS+=$(BARE_CXXFLAGS) $(WARNFLAGS) $(DEFINES)
|
-CXXFLAGS+=$(BARE_CXXFLAGS) $(WARNFLAGS) $(DEFINES)
|
||||
-LDFLAGS+=-L. -fprofile-arcs -ftest-coverage
|
+BARE_CXXFLAGS=-std=c++11 $(INCLUDES)
|
||||
+CXXFLAGS+=$(BARE_CXXFLAGS) $(WARNFLAGS) $(DEFINES) $(CPPFLAGS) -Wno-error=sign-compare -Wno-error=unused-lambda-capture
|
+CXXFLAGS+=$(BARE_CXXFLAGS) $(WARNFLAGS) $(DEFINES) $(CPPFLAGS)
|
||||
+LDFLAGS+=-L.
|
LDFLAGS+=-L. |
||||
|
|
||||
PACKAGE=newsboat |
PACKAGE=newsboat |
||||
|
@@ -46,7 +47,7 @@
|
||||
@@ -45,7 +45,7 @@
|
NEWSBOAT=newsboat |
||||
NEWSBEUTER=newsboat |
NEWSBOAT_SOURCES:=$(shell cat mk/newsboat.deps) |
||||
NEWSBEUTER_SOURCES:=$(shell cat mk/newsbeuter.deps) |
NEWSBOAT_OBJS:=$(patsubst %.cpp,%.o,$(NEWSBOAT_SOURCES)) |
||||
NEWSBEUTER_OBJS:=$(patsubst %.cpp,%.o,$(NEWSBEUTER_SOURCES)) |
-NEWSBOAT_LIBS=-lboat -lfilter -lpthread -lrsspp
|
||||
-NEWSBEUTER_LIBS=-lbeuter -lfilter -lpthread -lrsspp
|
+NEWSBOAT_LIBS=-lboat -lfilter -lrsspp -landroid-glob
|
||||
+NEWSBEUTER_LIBS=-lbeuter -lfilter -lrsspp -landroid-glob
|
|
||||
|
|
||||
RSSPPLIB_SOURCES=$(sort $(wildcard rss/*.cpp)) |
RSSPPLIB_SOURCES=$(sort $(wildcard rss/*.cpp)) |
||||
RSSPPLIB_OBJS=$(patsubst rss/%.cpp,rss/%.o,$(RSSPPLIB_SOURCES)) |
RSSPPLIB_OBJS=$(patsubst rss/%.cpp,rss/%.o,$(RSSPPLIB_SOURCES)) |
||||
@@ -55,7 +55,7 @@
|
@@ -56,7 +57,7 @@
|
||||
PODBEUTER=podboat |
PODBOAT=podboat |
||||
PODBEUTER_SOURCES:=$(shell cat mk/podbeuter.deps) |
PODBOAT_SOURCES:=$(shell cat mk/podboat.deps) |
||||
PODBEUTER_OBJS:=$(patsubst %.cpp,%.o,$(PODBEUTER_SOURCES)) |
PODBOAT_OBJS:=$(patsubst %.cpp,%.o,$(PODBOAT_SOURCES)) |
||||
-PODBEUTER_LIBS=-lbeuter -lpthread
|
-PODBOAT_LIBS=-lboat -lpthread
|
||||
+PODBEUTER_LIBS=-lbeuter
|
+PODBOAT_LIBS=-lboat
|
||||
|
|
||||
ifeq (, $(filter Linux GNU GNU/%, $(shell uname -s))) |
ifeq (, $(filter Linux GNU GNU/%, $(shell uname -s))) |
||||
NEWSBEUTER_LIBS+=-liconv -lintl |
NEWSBOAT_LIBS+=-liconv -lintl |
||||
@@ -67,8 +67,8 @@
|
@@ -167,13 +168,13 @@
|
||||
INSTALL=install |
echo "td > pre { margin: 0; white-space: pre-wrap; }" >> doc/xhtml/docbook-xsl.css |
||||
A2X=a2x |
|
||||
MSGFMT=msgfmt |
doc/generate: doc/generate.cpp doc/split.h |
||||
-RANLIB=ranlib
|
- $(CXX) $(CXXFLAGS) -o doc/generate doc/generate.cpp
|
||||
-AR=ar
|
+ $(CXX_host) -o doc/generate doc/generate.cpp
|
||||
+RANLIB?=ranlib
|
|
||||
+AR?=ar
|
doc/newsboat-cfgcmds.txt: doc/generate doc/configcommands.dsv |
||||
CHMOD=chmod |
doc/generate doc/configcommands.dsv > doc/newsboat-cfgcmds.txt |
||||
|
|
||||
STFLHDRS:=$(patsubst %.stfl,%.h,$(wildcard stfl/*.stfl)) |
doc/generate2: doc/generate2.cpp |
||||
|
- $(CXX) $(CXXFLAGS) -o doc/generate2 doc/generate2.cpp
|
||||
|
+ $(CXX_host) -o doc/generate2 doc/generate2.cpp
|
||||
|
|
||||
|
doc/newsboat-keycmds.txt: doc/generate2 doc/keycmds.dsv |
||||
|
doc/generate2 doc/keycmds.dsv > doc/newsboat-keycmds.txt |
||||
|
@@ -190,7 +191,7 @@
|
||||
|
$(A2X) -f manpage doc/manpage-podboat.txt |
||||
|
|
||||
|
doc/gen-example-config: doc/gen-example-config.cpp doc/split.h |
||||
|
- $(CXX) $(CXXFLAGS) -o doc/gen-example-config doc/gen-example-config.cpp
|
||||
|
+ $(CXX_host) -o doc/gen-example-config doc/gen-example-config.cpp
|
||||
|
|
||||
|
doc/example-config: doc/gen-example-config doc/configcommands.dsv |
||||
|
cat doc/configcommands.dsv | doc/gen-example-config > doc/example-config |
||||
|
@ -0,0 +1,26 @@ |
|||||
|
diff -u -r ../newsboat-2.10.2/src/fslock.cpp ./src/fslock.cpp
|
||||
|
--- ../newsboat-2.10.2/src/fslock.cpp 2017-12-25 18:49:35.000000000 +0100
|
||||
|
+++ ./src/fslock.cpp 2017-12-26 23:47:20.520356104 +0100
|
||||
|
@@ -5,6 +5,10 @@
|
||||
|
#include <fcntl.h> |
||||
|
#include <string.h> |
||||
|
|
||||
|
+#ifdef __ANDROID__
|
||||
|
+#include <sys/file.h>
|
||||
|
+#endif
|
||||
|
+
|
||||
|
#include <logger.h> |
||||
|
|
||||
|
namespace newsboat { |
||||
|
@@ -40,7 +44,11 @@
|
||||
|
} |
||||
|
|
||||
|
// then we lock it (returns immediately if locking is not possible) |
||||
|
+#ifdef __ANDROID__
|
||||
|
+ if (flock(fd, LOCK_EX) == 0) {
|
||||
|
+#else
|
||||
|
if (lockf(fd, F_TLOCK, 0) == 0) { |
||||
|
+#endif
|
||||
|
LOG(level::DEBUG, "FSLock: locked `%s', writing PID...", new_lock_filepath); |
||||
|
std::string pidtext = std::to_string(getpid()); |
||||
|
// locking successful -> truncate file and write own PID into it |
@ -0,0 +1,12 @@ |
|||||
|
diff -u -r ../newsboat-2.10.2/src/inoreader_api.cpp ./src/inoreader_api.cpp
|
||||
|
--- ../newsboat-2.10.2/src/inoreader_api.cpp 2017-12-25 18:49:35.000000000 +0100
|
||||
|
+++ ./src/inoreader_api.cpp 2017-12-27 00:18:36.167450052 +0100
|
||||
|
@@ -136,7 +136,7 @@
|
||||
|
|
||||
|
json_object_object_get_ex(sub, "categories", &node); |
||||
|
struct array_list * categories = json_object_get_array(node); |
||||
|
- for (int i = 0; i < array_list_length(categories); i++) {
|
||||
|
+ for (size_t i = 0; i < array_list_length(categories); i++) {
|
||||
|
json_object* cat = json_object_array_get_idx(node, i); |
||||
|
json_object* label_node {}; |
||||
|
json_object_object_get_ex(cat, "label", &label_node); |
@ -0,0 +1,12 @@ |
|||||
|
diff -u -r ../newsboat-2.10.2/src/oldreader_api.cpp ./src/oldreader_api.cpp
|
||||
|
--- ../newsboat-2.10.2/src/oldreader_api.cpp 2017-12-25 18:49:35.000000000 +0100
|
||||
|
+++ ./src/oldreader_api.cpp 2017-12-26 23:50:14.802426368 +0100
|
||||
|
@@ -134,7 +134,7 @@
|
||||
|
|
||||
|
json_object_object_get_ex(sub, "categories", &node); |
||||
|
struct array_list * categories = json_object_get_array(node); |
||||
|
- for (int i = 0; i < array_list_length(categories); i++) {
|
||||
|
+ for (size_t i = 0; i < array_list_length(categories); i++) {
|
||||
|
json_object* cat = json_object_array_get_idx(node, i); |
||||
|
json_object* label_node {}; |
||||
|
json_object_object_get_ex(cat, "label", &label_node); |
Loading…
Reference in new issue