This is an automated email from the ASF dual-hosted git repository. wohali pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/couchdb-pkg.git
The following commit(s) were added to refs/heads/master by this push: new 524b801 [deb] Set n=1 on singlenode, closes #15 524b801 is described below commit 524b8013b14093ccd2099449714df501cc826a00 Author: Joan Touzet <woh...@apache.org> AuthorDate: Mon Jun 11 10:38:02 2018 -0700 [deb] Set n=1 on singlenode, closes #15 --- debian/couchdb.postinst | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/debian/couchdb.postinst b/debian/couchdb.postinst index 830b3cd..772f544 100644 --- a/debian/couchdb.postinst +++ b/debian/couchdb.postinst @@ -30,7 +30,7 @@ setadminpass() { /opt/couchdb/etc/default.d/*.ini \ /opt/couchdb/etc/local.ini \ /opt/couchdb/etc/local.d/*.ini; do - if grep -q '^admin = ' $i >/dev/null 2>&1; then + if grep -q '^admin \?= ' $i >/dev/null 2>&1; then return 0 fi done @@ -62,7 +62,7 @@ setbindaddress() { for i in /opt/couchdb/etc/default.d/*.ini \ /opt/couchdb/etc/local.ini \ /opt/couchdb/etc/local.d/*.ini; do - if grep -q '^bind_address = ' $i >/dev/null 2>&1; then + if grep -q '^bind_address \?= ' $i >/dev/null 2>&1; then return 0 fi done @@ -76,6 +76,25 @@ bind_address = '"${bindaddr}"' echo "${bindinifile}" > /opt/couchdb/etc/default.d/10-bind-address.ini } +setsinglenode() { + # don't overwrite an n value already in an ini file + # other than default.ini + for i in /opt/couchdb/etc/default.d/*.ini \ + /opt/couchdb/etc/local.ini \ + /opt/couchdb/etc/local.d/*.ini; do + if grep -q '^n \?= ' $i >/dev/null 2>&1; then + return 0 + fi + done + + singlenodeinifile=' +# Package-introduced single node file +[cluster] +n = 1 +' + echo "${singlenodeinifile}" > /opt/couchdb/etc/default.d/5-single-node.ini +} + createdb() { # see if db already exists; if not, create DB db=$1 @@ -142,6 +161,7 @@ case $1 in ;; standalone) setbindaddress + setsinglenode if ! setadminpass; then password_error="yes" fi -- To stop receiving notification emails like this one, please contact woh...@apache.org.