From 6ce1ce98b7073fd45b09cbb43bb825e7352271f6 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Thu, 26 Jul 2012 11:21:30 +0200 Subject: [PATCH] issue #130: arango-password did not work with --enable-relative=devel --- Makefile.am | 9 +++++++++ Makefile.in | 18 ++++++++++++------ bin/arango-password.in | 6 ++++-- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3adaf1fa2e..c9a730f8aa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -337,12 +337,21 @@ built-sources: build.h errorfiles $(JAVASCRIPT_HEADER) ################################################################################ bin/arango-password: bin/arango-password.in +if ENABLE_RELATIVE_DEVEL + sed \ + -e 's%@SBINDIR@%bin%g' \ + -e 's%@DATABASE@%${TRI_DATABASE_DIR}%g' \ + -e 's%@STATICFILES@%${TRI_PKGDATA_DIR}%g' \ + $< > $@ + chmod 755 $@ +else sed \ -e 's%@SBINDIR@%${TRI_SBIN_DIR}%g' \ -e 's%@DATABASE@%${TRI_DATABASE_DIR}%g' \ -e 's%@STATICFILES@%${TRI_PKGDATA_DIR}%g' \ $< > $@ chmod 755 $@ +endif CLEANUP += bin/arango-password diff --git a/Makefile.in b/Makefile.in index fc9d30d401..1ca1a1425a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -5369,12 +5369,18 @@ built-sources: build.h errorfiles $(JAVASCRIPT_HEADER) ################################################################################ bin/arango-password: bin/arango-password.in - sed \ - -e 's%@SBINDIR@%${TRI_SBIN_DIR}%g' \ - -e 's%@DATABASE@%${TRI_DATABASE_DIR}%g' \ - -e 's%@STATICFILES@%${TRI_PKGDATA_DIR}%g' \ - $< > $@ - chmod 755 $@ +@ENABLE_RELATIVE_DEVEL_TRUE@ sed \ +@ENABLE_RELATIVE_DEVEL_TRUE@ -e 's%@SBINDIR@%bin%g' \ +@ENABLE_RELATIVE_DEVEL_TRUE@ -e 's%@DATABASE@%${TRI_DATABASE_DIR}%g' \ +@ENABLE_RELATIVE_DEVEL_TRUE@ -e 's%@STATICFILES@%${TRI_PKGDATA_DIR}%g' \ +@ENABLE_RELATIVE_DEVEL_TRUE@ $< > $@ +@ENABLE_RELATIVE_DEVEL_TRUE@ chmod 755 $@ +@ENABLE_RELATIVE_DEVEL_FALSE@ sed \ +@ENABLE_RELATIVE_DEVEL_FALSE@ -e 's%@SBINDIR@%${TRI_SBIN_DIR}%g' \ +@ENABLE_RELATIVE_DEVEL_FALSE@ -e 's%@DATABASE@%${TRI_DATABASE_DIR}%g' \ +@ENABLE_RELATIVE_DEVEL_FALSE@ -e 's%@STATICFILES@%${TRI_PKGDATA_DIR}%g' \ +@ENABLE_RELATIVE_DEVEL_FALSE@ $< > $@ +@ENABLE_RELATIVE_DEVEL_FALSE@ chmod 755 $@ @ENABLE_MRUBY_TRUE@.setup-mr-directories: @ENABLE_MRUBY_TRUE@ @test -d mr || mkdir mr diff --git a/bin/arango-password.in b/bin/arango-password.in index 5a4e7c842f..428018214b 100755 --- a/bin/arango-password.in +++ b/bin/arango-password.in @@ -1,5 +1,7 @@ #!/bin/bash +# Placeholders starting with @ will be replaced by make + ARANGOD="@SBINDIR@/arangod" DATABASE="@DATABASE@" SCRIPT="@STATICFILES@/js/server/arango-password.js" @@ -9,7 +11,7 @@ if [ "$#" -lt 1 ]; then exit 1 fi -if [ "$1" == "--database" ]; then +if [ "$1" == "--database" ] || [ "$1" == "--database.directory" ] ; then if [ "$#" -lt 3 ]; then echo "usage: $0 [--database ] []" exit 1 @@ -21,7 +23,7 @@ if [ "$1" == "--database" ]; then fi if test ! -d "$DATABASE"; then - echo "$0: database directory '$DATABASE' does not exit" + echo "$0: database directory '$DATABASE' does not exist" exit 1 fi