[couchdb/f20] Add patch12

Warren Togami wtogami at fedoraproject.org
Thu Jul 3 17:47:32 UTC 2014


commit 7809748288d6f5ef374806a5790cc3a271c8120f
Author: Warren Togami <wtogami at gmail.com>
Date:   Thu Jul 3 07:47:08 2014 -1000

    Add patch12

 ...passing-directories-as-the-config-sources.patch |   51 ++++++++++++++++++++
 couchdb.spec                                       |    8 ++--
 2 files changed, 55 insertions(+), 4 deletions(-)
---
diff --git a/couchdb-0012-Allow-passing-directories-as-the-config-sources.patch b/couchdb-0012-Allow-passing-directories-as-the-config-sources.patch
new file mode 100644
index 0000000..9343887
--- /dev/null
+++ b/couchdb-0012-Allow-passing-directories-as-the-config-sources.patch
@@ -0,0 +1,51 @@
+From bf4d5d86af5eff7c13a3ec0aac365ba7be141618 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Thu, 3 Jul 2014 15:45:30 +0400
+Subject: [PATCH 12/12] Allow passing directories as the config sources
+
+We should allow passing the entire directories as the config sources. In
+this case CouchDB will traverse the given directories and load every
+*.ini file found.
+
+E.g.
+
+"... -couch_ini /etc/couchdb/default.d/ /etc/couchdb/local.d/ /path/to/extra/couchdb/default.ini /path/to/extra/couchdb/local.ini ..."
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ src/couchdb/couch_app.erl | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/src/couchdb/couch_app.erl b/src/couchdb/couch_app.erl
+index 42411a8..7a4cdc3 100644
+--- a/src/couchdb/couch_app.erl
++++ b/src/couchdb/couch_app.erl
+@@ -15,6 +15,7 @@
+ -behaviour(application).
+ 
+ -include("couch_db.hrl").
++-include_lib("kernel/include/file.hrl").
+ 
+ -export([start/2, stop/1]).
+ 
+@@ -37,7 +38,17 @@ get_ini_files(Default) ->
+     {ok, [[]]} ->
+         Default;
+     {ok, [Values]} ->
++        lists:foldl(
++        fun (V, AccIn) ->
++              case file:read_file_info(V) of
++                  {ok, #file_info{type = regular}} -> AccIn ++ [V];
++                  {ok, #file_info{type = directory}} -> AccIn ++ filelib:wildcard(V ++ "/*.ini");
++                  _ -> AccIn
++              end
++        end,
++        [],
+         Values
++    )
+     end.
+ 
+ start_apps([]) ->
+-- 
+1.9.3
+
diff --git a/couchdb.spec b/couchdb.spec
index 6dd09e9..7af10c1 100644
--- a/couchdb.spec
+++ b/couchdb.spec
@@ -8,7 +8,7 @@
 
 Name:           couchdb
 Version:        1.6.0
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        A document database server, accessible via a RESTful JSON API
 
 Group:          Applications/Databases
@@ -105,13 +105,13 @@ JavaScript acting as the default view definition language.
 %patch7 -p1 -b .fix_respawn
 %if 0%{?fedora}%{?el7}
 %patch8 -p1 -b .r16b01
+%patch11 -p1 -b .redundant_logging
+%patch12 -p1 -b .ini_dirs
 %endif
 %patch9 -p1 -b .renamed
 %if 0%{?fedora} > 20
 %patch10 -p1 -b .default_instead_of_bsd
 %endif
-%patch11 -p1 -b .redundant_logging
-%patch12 -p1 -b .ini_dirs
 #gzip -d -k ./share/doc/build/latex/CouchDB.pdf.gz
 
 # Remove bundled libraries
@@ -235,7 +235,7 @@ fi
 
 
 %changelog
-* Wed Jul 02 2014 Warren Togami <wtogami at gmail.com> - 1.6.0-4
+* Thu Jul 02 2014 Warren Togami <wtogami at gmail.com> - 1.6.0-5
 - silence stdout/stderr to prevent redundant flooding of /var/log/messages
   CouchDB already logs these messages to /var/log/couchdb/couch.log
   Instead print the log filename to stdout, in case a user who ran it


More information about the scm-commits mailing list