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
This commit is contained in:
Andreas Jaeger 2014-08-15 22:45:35 +02:00
parent f8d8886cc0
commit edb4ff4998
3 changed files with 21 additions and 6 deletions

View File

@ -1,6 +1,11 @@
Release notes Release notes
============= =============
0.18.1
------
* Fix ``doc-tools-check-languages`` to handle all repositories and
setups.
0.18 0.18
---- ----

View File

@ -18,7 +18,7 @@ function setup_directories {
language=$1 language=$1
for directory in ${DIRECTORIES["$language"]} ; do for directory in ${DIRECTORIES["$language"]} ; do
echo " $directory" echo " $directory"
openstack-generate-docbook -l $language -b $directory openstack-generate-docbook -l $language -b $directory -r $DOC_DIR
done done
} }
@ -29,7 +29,9 @@ function setup_language {
echo "=======================" echo "======================="
echo " Directories:" echo " Directories:"
setup_directories $language 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") args+=("--publish")
fi fi
args+=("--check-build" "-l $language") args+=("--check-build" "-l $language")
for book in "${BOOKS["$language"]}"; do for book in ${BOOKS["$language"]}; do
args+=("--only-book $book") args+=("--only-book $book")
done done
@ -90,7 +92,8 @@ fi
source $CONF_FILE source $CONF_FILE
if [[ -z $(declare -p BOOKS 2> /dev/null | grep 'declare -A BOOKS') || \ 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" echo "Error: the configuration file '$CONF_FILE' is invalid"
exit 1 exit 1
fi fi

View File

@ -1,13 +1,20 @@
# Example configuration for the languages 'ja' and 'fr'. # Example configuration for the languages 'ja' and 'fr'.
# directories to be set up # Directories to set up
declare -A DIRECTORIES=( declare -A DIRECTORIES=(
["ja"]="common glossary high-availability-guide image-guide install-guide user-guide user-guide-admin" ["ja"]="common glossary high-availability-guide image-guide install-guide user-guide user-guide-admin"
["fr"]="common glossary user-guide" ["fr"]="common glossary user-guide"
) )
# books to be built # Books to build
declare -A BOOKS=( declare -A BOOKS=(
["ja"]="high-availability-guide image-guide install-guide user-guide user-guide-admin" ["ja"]="high-availability-guide image-guide install-guide user-guide user-guide-admin"
["fr"]="user-guide" ["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/"