You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2015/09/09 18:39:08 UTC
[1/2] couchdb commit: updated
refs/heads/set-hostname-during-configure to 23a0c2b
Repository: couchdb
Updated Branches:
refs/heads/set-hostname-during-configure 3153c6ce0 -> 23a0c2bab
add mandatory --cookie option to ./configure, simplify hostname setting
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/f7f9472a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/f7f9472a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/f7f9472a
Branch: refs/heads/set-hostname-during-configure
Commit: f7f9472a6f965f8fd9d57bed6d7d0bad1bb0870e
Parents: 3153c6c
Author: Jan Lehnardt <ja...@apache.org>
Authored: Wed Sep 9 18:36:39 2015 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Wed Sep 9 18:36:39 2015 +0200
----------------------------------------------------------------------
configure | 27 ++++++++++++++++++++++++++-
rel/overlay/etc/vm.args | 4 ++--
2 files changed, 28 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/f7f9472a/configure
----------------------------------------------------------------------
diff --git a/configure b/configure
index e7edd90..2db6634 100755
--- a/configure
+++ b/configure
@@ -46,6 +46,7 @@ DATABASEDIR=
VIEWDIR=
LOGDIR=
COUCHDB_USER=`whoami`
+COOKIE=
display_help () {
cat << EOF
@@ -66,6 +67,7 @@ Options:
--disable-fauxton do not build Fauxton
--disable-docs do not build any documentation or manpages
--skip-deps do not update erlang dependencies
+ --cookie set the Erlang cookie value needed to talk to other nodes
Installation directories:
@@ -470,6 +472,24 @@ parse_opts() {
exit 1
;;
+ --cookie)
+ if [ -n "$2" ]; then
+ eval COOKIE=$2
+ shift 2
+ continue
+ else
+ printf 'ERROR: "--cookie" requires a non-empty argument.\n' >&2
+ exit 1
+ fi
+ ;;
+ --cookie=?*)
+ eval COOKIE=${1#*=}
+ ;;
+ --cookie=)
+ printf 'ERROR: "--cookie" requires a non-empty argument.\n' >&2
+ exit 1
+ ;;
+
--) # End of options
shift
break
@@ -539,6 +559,10 @@ parse_opts() {
if test -z "$PDFDIR"; then
PDFDIR="$DOCDIR/pdf";
fi
+ if test -z "$COOKIE"; then
+ echo "The --cookie is required. If you don’t want to set up a cluster, use $0 --cookie=monster"
+ exit 3
+ fi
}
parse_opts $@
@@ -581,7 +605,8 @@ cat > rel/couchdb.config << EOF
{log_file, "$LOG_FILE"}.
{fauxton_root, "$DATAROOTDIR/couchdb/www"}.
{user, "$COUCHDB_USER"}.
-{node_name, "-name $FQDN"}.
+{node_name, "$FQDN"}.
+{cookie, "$COOKIE"}.
{cluster_port, 5984}.
{backend_port, 5986}.
EOF
http://git-wip-us.apache.org/repos/asf/couchdb/blob/f7f9472a/rel/overlay/etc/vm.args
----------------------------------------------------------------------
diff --git a/rel/overlay/etc/vm.args b/rel/overlay/etc/vm.args
index b69ad82..cd7abc2 100644
--- a/rel/overlay/etc/vm.args
+++ b/rel/overlay/etc/vm.args
@@ -14,12 +14,12 @@
# (specified using -sname) or it can by fully qualified (-name). There can be
# no communication between nodes running with the -sname flag and those running
# with the -name flag.
-{{node_name}}
+-name {{node_name}}
# All nodes must share the same magic cookie for distributed Erlang to work.
# Comment out this line if you synchronized the cookies by other means (using
# the ~/.erlang.cookie file, for example).
--setcookie monster
+-setcookie {{cookie}}
# Tell kernel and SASL not to log anything
-kernel error_logger silent
[2/2] couchdb commit: updated
refs/heads/set-hostname-during-configure to 23a0c2b
Posted by ja...@apache.org.
explicit exit values for ./configure
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/23a0c2ba
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/23a0c2ba
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/23a0c2ba
Branch: refs/heads/set-hostname-during-configure
Commit: 23a0c2babffcba249202f26476d316e99a3675f3
Parents: f7f9472
Author: Jan Lehnardt <ja...@apache.org>
Authored: Wed Sep 9 18:38:58 2015 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Wed Sep 9 18:38:58 2015 +0200
----------------------------------------------------------------------
configure | 90 ++++++++++++++++++++++++++++++----------------------------
1 file changed, 47 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/23a0c2ba/configure
----------------------------------------------------------------------
diff --git a/configure b/configure
index 2db6634..8292f7a 100755
--- a/configure
+++ b/configure
@@ -48,6 +48,10 @@ LOGDIR=
COUCHDB_USER=`whoami`
COOKIE=
+EXIT_OK=0
+EXIT_INVALID_ARGUMENT=1
+EXIT_MISSING_ARGUMENT=2
+
display_help () {
cat << EOF
Usage: $basename [OPTION]
@@ -97,7 +101,7 @@ parse_opts() {
case $1 in
-h|--help)
display_help
- exit
+ exit $EXIT_OK
;;
--test)
@@ -137,7 +141,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--user" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--user=?*)
@@ -145,7 +149,7 @@ parse_opts() {
;;
--user=)
printf 'ERROR: "--user" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--prefix)
@@ -155,7 +159,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--prefix" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--prefix=?*)
@@ -163,7 +167,7 @@ parse_opts() {
;;
--prefix=)
printf 'ERROR: "--prefix" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--exec-prefix)
@@ -173,7 +177,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--exec-prefix" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--exec-prefix=?*)
@@ -181,7 +185,7 @@ parse_opts() {
;;
--exec-prefix=)
printf 'ERROR: "--exec-prefix" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--bindir)
@@ -191,7 +195,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--bindir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--bindir=?*)
@@ -199,7 +203,7 @@ parse_opts() {
;;
--bindir=)
printf 'ERROR: "--bindir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--libexecdir)
@@ -209,7 +213,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--libexecdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--libexecdir=?*)
@@ -217,7 +221,7 @@ parse_opts() {
;;
--libexecdir=)
printf 'ERROR: "--libexecdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--sysconfdir)
@@ -227,7 +231,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--sysconfdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--sysconfdir=?*)
@@ -235,7 +239,7 @@ parse_opts() {
;;
--sysconfdir=)
printf 'ERROR: "--sysconfdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--datarootdir)
@@ -245,7 +249,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--datarootdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--datarootdir=?*)
@@ -253,7 +257,7 @@ parse_opts() {
;;
--datarootdir=)
printf 'ERROR: "--datarootdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--datadir)
@@ -263,7 +267,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--datadir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--datadir=?*)
@@ -271,7 +275,7 @@ parse_opts() {
;;
--datadir=)
printf 'ERROR: "--datadir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--localstatedir)
@@ -281,7 +285,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--localstatedir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--localstatedir=?*)
@@ -289,7 +293,7 @@ parse_opts() {
;;
--localstatedir=)
printf 'ERROR: "--localstatedir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--runstatedir)
@@ -299,7 +303,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--runstatedir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--runstatedir=?*)
@@ -307,7 +311,7 @@ parse_opts() {
;;
--runstatedir=)
printf 'ERROR: "--runstatedir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--docdir)
@@ -317,7 +321,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--docdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--docdir=?*)
@@ -325,7 +329,7 @@ parse_opts() {
;;
--docdir=)
printf 'ERROR: "--docdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--mandir)
@@ -335,7 +339,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--mandir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--mandir=?*)
@@ -343,7 +347,7 @@ parse_opts() {
;;
--mandir=)
printf 'ERROR: "--mandir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--infodir)
@@ -353,7 +357,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--infodir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--infodir=?*)
@@ -361,7 +365,7 @@ parse_opts() {
;;
--infodir=)
printf 'ERROR: "--infodir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--libdir)
@@ -371,7 +375,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--libdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--libdir=?*)
@@ -379,7 +383,7 @@ parse_opts() {
;;
--libdir=)
printf 'ERROR: "--libdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--databasedir)
@@ -389,7 +393,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--databasedir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--databasedir=?*)
@@ -397,7 +401,7 @@ parse_opts() {
;;
--databasedir=)
printf 'ERROR: "--databasedir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--viewindexdir)
@@ -407,7 +411,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--viewindexdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--viewindexdir=?*)
@@ -415,7 +419,7 @@ parse_opts() {
;;
--viewindexdir=)
printf 'ERROR: "--viewindexdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--logdir)
@@ -425,7 +429,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--logdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--logdir=?*)
@@ -433,7 +437,7 @@ parse_opts() {
;;
--logdir=)
printf 'ERROR: "--logdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--htmldir)
@@ -443,7 +447,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--htmldir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--htmldir=?*)
@@ -451,7 +455,7 @@ parse_opts() {
;;
--htmldir=)
printf 'ERROR: "--htmldir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--pdfdir)
@@ -461,7 +465,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--pdfdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--pdfdir=?*)
@@ -469,7 +473,7 @@ parse_opts() {
;;
--pdfdir=)
printf 'ERROR: "--pdfdir" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--cookie)
@@ -479,7 +483,7 @@ parse_opts() {
continue
else
printf 'ERROR: "--cookie" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
fi
;;
--cookie=?*)
@@ -487,7 +491,7 @@ parse_opts() {
;;
--cookie=)
printf 'ERROR: "--cookie" requires a non-empty argument.\n' >&2
- exit 1
+ exit $EXIT_INVALID_ARGUMENT
;;
--) # End of options
@@ -561,7 +565,7 @@ parse_opts() {
fi
if test -z "$COOKIE"; then
echo "The --cookie is required. If you don’t want to set up a cluster, use $0 --cookie=monster"
- exit 3
+ exit $EXIT_MISSING_ARGUMENT
fi
}
@@ -573,7 +577,7 @@ if [ "$TEST" = "1" ]; then
echo $PREFIX $EXEC_PREFIX $BINDIR $LIBEXECDIR $SYSCONFDIR $DATAROOTDIR \
$DATADIR $LOCALSTATEDIR $RUNSTATEDIR $DOCDIR $LIBDIR $DATABASEDIR \
$VIEWDIR $LOGDIR $MANDIR $INFODIR $HTMLDIR $PDFDIR
- exit 0
+ exit $EXIT_OK
fi
# Translate ./configure variables to CouchDB variables