From 09f5e2aa03a84e256ae3b04a38b51110c654006e Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 16 Feb 2021 18:46:27 +0100 Subject: [PATCH] Improve support for rebar3 in "make translations" --- Makefile.in | 2 +- tools/prepare-tr.sh | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Makefile.in b/Makefile.in index 62623ee16..bb5001f85 100644 --- a/Makefile.in +++ b/Makefile.in @@ -149,7 +149,7 @@ options: all tools/opt_types.sh ejabberd_option $(EBINDIR) translations: - tools/prepare-tr.sh + tools/prepare-tr.sh $(DEPSDIR) edoc: $(ERL) -noinput +B -eval \ diff --git a/tools/prepare-tr.sh b/tools/prepare-tr.sh index 35c406e39..1eeaaa64c 100755 --- a/tools/prepare-tr.sh +++ b/tools/prepare-tr.sh @@ -10,7 +10,7 @@ extract_lang_src2pot () { - ./tools/extract-tr.sh src deps/xmpp/src > $PO_DIR/ejabberd.pot + ./tools/extract-tr.sh src $DEPS_DIR/xmpp/src > $PO_DIR/ejabberd.pot } extract_lang_popot2po () @@ -103,19 +103,16 @@ extract_lang_updateall () EJA_DIR=`pwd` PROJECT=ejabberd +DEPS_DIR=$1 MSGS_DIR=$EJA_DIR/priv/msgs LOG=/tmp/ejabberd-translate-errors.log -if [ -f $EJA_DIR/deps/ejabberd_po/src/ejabberd.pot ]; then - PO_DIR=$EJA_DIR/deps/ejabberd_po/src/ -else - if [ -f $EJA_DIR/_build/default/lib/ejabberd_po/src/ejabberd.pot ]; then - PO_DIR=$EJA_DIR/_build/default/lib/ejabberd_po/src - else - echo "Couldn't find the required ejabberd_po repository." - echo "Run: ./configure --enable-tools; ./rebar get-deps" - exit 1 - fi +PO_DIR=$EJA_DIR/$DEPS_DIR/ejabberd_po/src/ +if [ ! -f $EJA_DIR/$DEPS_DIR/ejabberd_po/src/ejabberd.pot ]; then + echo "Couldn't find the required ejabberd_po repository in" + echo " $PO_DIR" + echo "Run: ./configure --enable-tools; ./rebar get-deps" + exit 1 fi -echo "Using PO files found in $PO_DIR." +echo "Using PO files from $PO_DIR." extract_lang_updateall