Hello community,

here is the log from the commit of package apr-util for openSUSE:Factory 
checked in at 2020-09-10 22:44:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/apr-util (Old)
 and      /work/SRC/openSUSE:Factory/.apr-util.new.4249 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "apr-util"

Thu Sep 10 22:44:40 2020 rev:10 rq:831666 version:1.6.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/apr-util/apr-util.changes        2019-12-23 
22:43:34.821980041 +0100
+++ /work/SRC/openSUSE:Factory/.apr-util.new.4249/apr-util.changes      
2020-09-10 22:44:50.499646700 +0200
@@ -1,0 +2,9 @@
+Tue Sep  1 11:33:52 UTC 2020 - [email protected]
+
+- drop dependency on Berkeley DB [jsc#SLE-12211], gdbm DBM connector
+  is now built instead and sdbm works as well
+* added patches
+  https://svn.apache.org/viewvc?view=revision&revision=1825312
+  + apr-util-apr_dbm_gdbm-fix-handling-of-error-codes.patch
+
+-------------------------------------------------------------------

New:
----
  apr-util-apr_dbm_gdbm-fix-handling-of-error-codes.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ apr-util.spec ++++++
--- /var/tmp/diff_new_pack.gTZp0R/_old  2020-09-10 22:44:53.243649229 +0200
+++ /var/tmp/diff_new_pack.gTZp0R/_new  2020-09-10 22:44:53.247649232 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package apr-util
 #
-# Copyright (c) 2019 SUSE LLC
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -34,10 +34,12 @@
 Patch3:         apr-util-mariadb-10.2.patch
 # PATCH-FIX-OPENSUSE apr-util-postgresql.patch [email protected] -- Fix build with 
PostgreSQL 11
 Patch4:         apr-util-postgresql.patch
+# https://svn.apache.org/viewvc?view=revision&revision=1825312
+Patch5:         apr-util-apr_dbm_gdbm-fix-handling-of-error-codes.patch
 BuildRequires:  apr-devel
 BuildRequires:  autoconf
-BuildRequires:  db-devel
 BuildRequires:  doxygen
+BuildRequires:  gdbm-devel
 BuildRequires:  libexpat-devel
 BuildRequires:  libtool
 BuildRequires:  libuuid-devel
@@ -73,7 +75,7 @@
 Obsoletes:      %{libname}-devel < %{version}-%{release}
 Requires:       %{libname} = %{version}
 Requires:       apr-devel
-Requires:       db-devel
+Requires:       gdbm-devel
 Requires:       libexpat-devel
 Requires:       openldap2-devel
 
@@ -114,6 +116,7 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 %build
 echo 'HTML_TIMESTAMP=NO' >> docs/doxygen.conf
@@ -129,9 +132,9 @@
     --with-apr=%{_bindir}/apr-1-config \
     --with-expat=%{_prefix} \
     --with-ldap \
-    --with-berkeley-db \
     --with-mysql \
-    --without-gdbm
+    --with-pgsql \
+    --with-gdbm
 make %{?_smp_mflags} CFLAGS="%{optflags} -DOPENSSL_LOAD_CONF 
-fvisibility=hidden"
 make %{?_smp_mflags} dox
 
@@ -165,7 +168,7 @@
 %{_libdir}/libaprutil-%{apuver}.so.*
 %dir %{dso_libdir}
 %{dso_libdir}/apr_ldap*
-%{dso_libdir}/apr_dbm_db*
+%{dso_libdir}/apr_dbm_gdbm*
 %{dso_libdir}/apr_crypto_openssl*
 
 %files -n %{libname}-dbd-mysql

++++++ apr-util-apr_dbm_gdbm-fix-handling-of-error-codes.patch ++++++
--- 1.6.x/dbm/apr_dbm_gdbm.c    2018/02/25 16:36:31     1825311
+++ 1.6.x/dbm/apr_dbm_gdbm.c    2018/02/25 16:41:11     1825312
@@ -36,8 +36,20 @@
 static apr_status_t g2s(int gerr)
 {
     if (gerr == -1) {
-        /* ### need to fix this */
-        return APR_EGENERAL;
+        if (gdbm_errno == GDBM_NO_ERROR)
+           return APR_SUCCESS;
+        return APR_OS_START_USEERR + gdbm_errno;
+    }
+
+    return APR_SUCCESS;
+}
+
+static apr_status_t gdat2s(datum d)
+{
+    if (d.dptr == NULL) {
+        if (gdbm_errno == GDBM_NO_ERROR || gdbm_errno == GDBM_ITEM_NOT_FOUND)
+           return APR_SUCCESS;
+        return APR_OS_START_USEERR + gdbm_errno;
     }
 
     return APR_SUCCESS;
@@ -53,22 +65,14 @@
 
 static apr_status_t set_error(apr_dbm_t *dbm, apr_status_t dbm_said)
 {
-    apr_status_t rv = APR_SUCCESS;
-
-    /* ### ignore whatever the DBM said (dbm_said); ask it explicitly */
+    dbm->errcode = dbm_said;
 
-    if ((dbm->errcode = gdbm_errno) == GDBM_NO_ERROR) {
+    if (dbm_said == APR_SUCCESS)
         dbm->errmsg = NULL;
-    }
-    else {
-        dbm->errmsg = gdbm_strerror(gdbm_errno);
-        rv = APR_EGENERAL;        /* ### need something better */
-    }
-
-    /* captured it. clear it now. */
-    gdbm_errno = GDBM_NO_ERROR;
+    else
+        dbm->errmsg = gdbm_strerror(dbm_said - APR_OS_START_USEERR);
 
-    return rv;
+    return dbm_said;
 }
 
 /* --------------------------------------------------------------------------
@@ -107,7 +111,7 @@
                      NULL);
 
     if (file == NULL)
-        return APR_EGENERAL;      /* ### need a better error */
+        return APR_OS_START_USEERR + gdbm_errno;
 
     /* we have an open database... return it */
     *pdb = apr_pcalloc(pool, sizeof(**pdb));
@@ -141,10 +145,12 @@
     if (pvalue->dptr)
         apr_pool_cleanup_register(dbm->pool, pvalue->dptr, datum_cleanup,
                                   apr_pool_cleanup_null);
+    else
+        pvalue->dsize = 0;
 
     /* store the error info into DBM, and return a status code. Also, note
        that *pvalue should have been cleared on error. */
-    return set_error(dbm, APR_SUCCESS);
+    return set_error(dbm, gdat2s(rd));
 }
 
 static apr_status_t vt_gdbm_store(apr_dbm_t *dbm, apr_datum_t key,
@@ -201,9 +207,11 @@
     if (pkey->dptr)
         apr_pool_cleanup_register(dbm->pool, pkey->dptr, datum_cleanup,
                                   apr_pool_cleanup_null);
+    else
+        pkey->dsize = 0;
 
     /* store any error info into DBM, and return a status code. */
-    return set_error(dbm, APR_SUCCESS);
+    return set_error(dbm, gdat2s(rd));
 }
 
 static apr_status_t vt_gdbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey)
@@ -221,9 +229,11 @@
     if (pkey->dptr)
         apr_pool_cleanup_register(dbm->pool, pkey->dptr, datum_cleanup,
                                   apr_pool_cleanup_null);
+    else
+        pkey->dsize = 0;
 
     /* store any error info into DBM, and return a status code. */
-    return set_error(dbm, APR_SUCCESS);
+    return set_error(dbm, gdat2s(rd));
 }
 
 static void vt_gdbm_freedatum(apr_dbm_t *dbm, apr_datum_t data)


Reply via email to