1 |
commit: 1d491df62fb432335e681eeff99acfc7ff10927e |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 13 16:35:36 2018 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 13 16:36:17 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d491df6 |
7 |
|
8 |
dev-libs/apr-util: fix gdbm error handling |
9 |
|
10 |
Package-Manager: Portage-2.3.49, Repoman-2.3.10 |
11 |
|
12 |
...il-1.6.1-r2.ebuild => apr-util-1.6.1-r3.ebuild} | 6 ++ |
13 |
.../apr-util-1.6.1-fix-gdbm-error-handling.patch | 79 ++++++++++++++++++++++ |
14 |
2 files changed, 85 insertions(+) |
15 |
|
16 |
diff --git a/dev-libs/apr-util/apr-util-1.6.1-r2.ebuild b/dev-libs/apr-util/apr-util-1.6.1-r3.ebuild |
17 |
similarity index 96% |
18 |
rename from dev-libs/apr-util/apr-util-1.6.1-r2.ebuild |
19 |
rename to dev-libs/apr-util/apr-util-1.6.1-r3.ebuild |
20 |
index 251a895865a..6fa6e9f9d95 100644 |
21 |
--- a/dev-libs/apr-util/apr-util-1.6.1-r2.ebuild |
22 |
+++ b/dev-libs/apr-util/apr-util-1.6.1-r3.ebuild |
23 |
@@ -48,6 +48,7 @@ DOCS=(CHANGES NOTICE README) |
24 |
|
25 |
PATCHES=( |
26 |
"${FILESDIR}"/${PN}-1.5.3-sysroot.patch #385775 |
27 |
+ "${FILESDIR}"/${PN}-1.6.1-fix-gdbm-error-handling.patch |
28 |
) |
29 |
|
30 |
src_prepare() { |
31 |
@@ -116,6 +117,11 @@ src_compile() { |
32 |
use doc && emake dox |
33 |
} |
34 |
|
35 |
+src_test() { |
36 |
+ # Building tests in parallel is broken |
37 |
+ emake -j1 check |
38 |
+} |
39 |
+ |
40 |
src_install() { |
41 |
default |
42 |
|
43 |
|
44 |
diff --git a/dev-libs/apr-util/files/apr-util-1.6.1-fix-gdbm-error-handling.patch b/dev-libs/apr-util/files/apr-util-1.6.1-fix-gdbm-error-handling.patch |
45 |
new file mode 100644 |
46 |
index 00000000000..92a4738e66a |
47 |
--- /dev/null |
48 |
+++ b/dev-libs/apr-util/files/apr-util-1.6.1-fix-gdbm-error-handling.patch |
49 |
@@ -0,0 +1,79 @@ |
50 |
+# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=889170 |
51 |
+# needs to be submitted upstream |
52 |
+--- apr-util.orig/dbm/apr_dbm_gdbm.c |
53 |
++++ apr-util/dbm/apr_dbm_gdbm.c |
54 |
+@@ -36,13 +36,22 @@ |
55 |
+ static apr_status_t g2s(int gerr) |
56 |
+ { |
57 |
+ if (gerr == -1) { |
58 |
+- /* ### need to fix this */ |
59 |
+- return APR_EGENERAL; |
60 |
++ return APR_OS_START_USEERR + gdbm_errno; |
61 |
+ } |
62 |
+ |
63 |
+ return APR_SUCCESS; |
64 |
+ } |
65 |
+ |
66 |
++static apr_status_t gdat2s(datum d) |
67 |
++{ |
68 |
++ if (d.dptr == NULL) { |
69 |
++ return APR_OS_START_USEERR + gdbm_errno; |
70 |
++ } |
71 |
++ |
72 |
++ return APR_SUCCESS; |
73 |
++} |
74 |
++ |
75 |
++ |
76 |
+ static apr_status_t datum_cleanup(void *dptr) |
77 |
+ { |
78 |
+ if (dptr) |
79 |
+@@ -55,19 +64,15 @@ static apr_status_t set_error(apr_dbm_t |
80 |
+ { |
81 |
+ apr_status_t rv = APR_SUCCESS; |
82 |
+ |
83 |
+- /* ### ignore whatever the DBM said (dbm_said); ask it explicitly */ |
84 |
+- |
85 |
+- if ((dbm->errcode = gdbm_errno) == GDBM_NO_ERROR) { |
86 |
++ if (dbm_said == APR_SUCCESS) { |
87 |
++ dbm->errcode = GDBM_NO_ERROR; |
88 |
+ dbm->errmsg = NULL; |
89 |
+ } |
90 |
+ else { |
91 |
++ dbm->errcode = dbm_said; |
92 |
+ dbm->errmsg = gdbm_strerror(gdbm_errno); |
93 |
+- rv = APR_EGENERAL; /* ### need something better */ |
94 |
+ } |
95 |
+ |
96 |
+- /* captured it. clear it now. */ |
97 |
+- gdbm_errno = GDBM_NO_ERROR; |
98 |
+- |
99 |
+ return rv; |
100 |
+ } |
101 |
+ |
102 |
+@@ -144,7 +149,7 @@ static apr_status_t vt_gdbm_fetch(apr_db |
103 |
+ |
104 |
+ /* store the error info into DBM, and return a status code. Also, note |
105 |
+ that *pvalue should have been cleared on error. */ |
106 |
+- return set_error(dbm, APR_SUCCESS); |
107 |
++ return set_error(dbm, gdat2s(rd)); |
108 |
+ } |
109 |
+ |
110 |
+ static apr_status_t vt_gdbm_store(apr_dbm_t *dbm, apr_datum_t key, |
111 |
+@@ -203,7 +208,7 @@ static apr_status_t vt_gdbm_firstkey(apr |
112 |
+ apr_pool_cleanup_null); |
113 |
+ |
114 |
+ /* store any error info into DBM, and return a status code. */ |
115 |
+- return set_error(dbm, APR_SUCCESS); |
116 |
++ return set_error(dbm, gdat2s(rd)); |
117 |
+ } |
118 |
+ |
119 |
+ static apr_status_t vt_gdbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey) |
120 |
+@@ -223,7 +228,7 @@ static apr_status_t vt_gdbm_nextkey(apr_ |
121 |
+ apr_pool_cleanup_null); |
122 |
+ |
123 |
+ /* store any error info into DBM, and return a status code. */ |
124 |
+- return set_error(dbm, APR_SUCCESS); |
125 |
++ return set_error(dbm, gdat2s(rd)); |
126 |
+ } |
127 |
+ |
128 |
+ static void vt_gdbm_freedatum(apr_dbm_t *dbm, apr_datum_t data) |