From edb4ff499811f1c23de136025f96cc032037474f Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 15 Aug 2014 22:45:35 +0200 Subject: [PATCH] Fix doc-tools-check-language Fix quoting so strings are split. Add config variables so that api-site repository can be used. Change-Id: I345e6a8557ad91c8a5941139873cd2c23a27f199 --- RELEASE_NOTES.rst | 5 +++++ bin/doc-tools-check-languages | 11 +++++++---- bin/doc-tools-check-languages.conf | 11 +++++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index 669d00fe..bc3f2157 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -1,6 +1,11 @@ Release notes ============= +0.18.1 +------ +* Fix ``doc-tools-check-languages`` to handle all repositories and + setups. + 0.18 ---- diff --git a/bin/doc-tools-check-languages b/bin/doc-tools-check-languages index 93335073..7cf4e09d 100755 --- a/bin/doc-tools-check-languages +++ b/bin/doc-tools-check-languages @@ -18,7 +18,7 @@ function setup_directories { language=$1 for directory in ${DIRECTORIES["$language"]} ; do echo " $directory" - openstack-generate-docbook -l $language -b $directory + openstack-generate-docbook -l $language -b $directory -r $DOC_DIR done } @@ -29,7 +29,9 @@ function setup_language { echo "=======================" echo " Directories:" setup_directories $language - cp doc/pom.xml generated/$language/pom.xml + if [ -n "$POM_FILE" ] ; then + cp $POM_FILE generated/$language/pom.xml + fi } @@ -47,7 +49,7 @@ function test_language { args+=("--publish") fi args+=("--check-build" "-l $language") - for book in "${BOOKS["$language"]}"; do + for book in ${BOOKS["$language"]}; do args+=("--only-book $book") done @@ -90,7 +92,8 @@ fi source $CONF_FILE if [[ -z $(declare -p BOOKS 2> /dev/null | grep 'declare -A BOOKS') || \ - -z $(declare -p DIRECTORIES 2> /dev/null | grep 'declare -A DIRECTORIES') ]]; then + -z $(declare -p DIRECTORIES 2> /dev/null | grep 'declare -A DIRECTORIES') || \ + -z $DOC_DIR ]]; then echo "Error: the configuration file '$CONF_FILE' is invalid" exit 1 fi diff --git a/bin/doc-tools-check-languages.conf b/bin/doc-tools-check-languages.conf index b7501149..1b91ac4e 100644 --- a/bin/doc-tools-check-languages.conf +++ b/bin/doc-tools-check-languages.conf @@ -1,13 +1,20 @@ # Example configuration for the languages 'ja' and 'fr'. -# directories to be set up +# Directories to set up declare -A DIRECTORIES=( ["ja"]="common glossary high-availability-guide image-guide install-guide user-guide user-guide-admin" ["fr"]="common glossary user-guide" ) -# books to be built +# Books to build declare -A BOOKS=( ["ja"]="high-availability-guide image-guide install-guide user-guide user-guide-admin" ["fr"]="user-guide" ) + +# Where does the top-level pom live? +# Set to empty to not copy it. +POM_FILE=doc/pom.xml + +# Location of doc dir +DOC_DIR="doc/"