Skip to content
Permalink
Browse files
debian: fix pkg x2
1. Do not fail postinst script if installing standalone and CouchDB
   fails to start (e.g., in Docker, where there is no init). Print
   a warning about being unable to create _users/_replicator instead.

2. Do not double-depend on libmozjs185-1.0 (was preventing successful
   installation.)
  • Loading branch information
wohali committed May 29, 2018
1 parent 37c806e commit 066661ec8f0ab7b6e9258c89df695b06a0fe39cf
Showing 2 changed files with 16 additions and 2 deletions.
@@ -91,10 +91,24 @@ createdb() {
if curl -s "${url}/${db}" | grep -q "${db}"; then
return 0
fi
curl -s -X PUT "${url}/${db}" >/dev/null 2>&1
curl -s -X PUT "${url}/${db}" >/dev/null 2>&1 || warnfail
return $?
}

warnfail() {
# print a warning and exit without error
cat <<EOF
WARNING: Unable to create standalone system databases.
CouchDB may not have started correctly (no init?)
Once CouchDB has started correctly, run the following:
curl -X PUT http://<admin-user>:<admin-pass>@127.0.0.1:5984/_users
curl -X PUT http://<admin-user>:<admin-pass>@127.0.0.1:5984/_replicator
EOF
exit 0
}

case $1 in
configure)
if dpkg --compare-versions "$2" lt-nl 1.2.0-2ubuntu1; then
@@ -38,7 +38,7 @@ get-orig-source:

# this allows us to use a fake/equivs libmozjs185-1.0 in automated testing
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
dh_shlibdeps -- --ignore-missing-info -xlibmozjs185-1.0

# bintray doesn't support xz uploads :(
override_dh_builddeb:

0 comments on commit 066661e

Please sign in to comment.