Add switcher for common directory

To migrate common directory for rst files from common-rst to common,
Add a switcher for common directory as a temporary trick.
When find a rst file in common directory,
we use "common" directory as priority.
This switcher will be removed after all migration works finish.

Change-Id: I7ba517136807513f982e66010906b97621f844fc
This commit is contained in:
KATO Tomoyuki 2016-01-20 23:24:00 +09:00
parent 8d1b667c44
commit 83a7248a32
2 changed files with 19 additions and 4 deletions

View File

@ -67,7 +67,13 @@ done
if [ "$GLOSSARY" -eq "1" ] ; then
echo "Generating Glossary"
tools/glossary2rst.py doc/common-rst/glossary.rst
# Use "common" directory as common if exists while migration
if [[ -e doc/common/conventions.rst ]] ; then
COMMON="common"
else
COMMON="common-rst"
fi
tools/glossary2rst.py doc/${COMMON}/glossary.rst
fi
if [ -z "$BUILD" ] ; then

View File

@ -57,16 +57,25 @@ function build_rst {
if [ ${book} = "install-guide" ] ; then
TAG="-t obs -t rdo -t ubuntu -t debian"
fi
# Use "common" directory as common if exists while migration
if [[ -e ${DOC_DIR}common/conventions.rst ]] ; then
COMMON="common"
else
COMMON="common-rst"
fi
LOCALE_DIR="${DOC_DIR}${book}/source/locale/"
COMMON_DIR="${DOC_DIR}common-rst/source/locale/"
COMMON_DIR="${DOC_DIR}${COMMON}/source/locale/"
tox -evenv "sphinx-build -j $NUMBER_OF_CORES -q -E -W -b gettext $TAG \
${DOC_DIR}${book}/source/ ${LOCALE_DIR}"
# Merge the common-rst po file in
if [[ -e ${COMMON_DIR}${language}/LC_MESSAGES/common-rst.po ]] ; then
if [[ -e ${COMMON_DIR}${language}/LC_MESSAGES/${COMMON}.po ]] ; then
msgcat --use-first -o ${LOCALE_DIR}${language}/${book}.po \
${LOCALE_DIR}${language}/LC_MESSAGES/${book}.po \
${COMMON_DIR}${language}/LC_MESSAGES/common-rst.po
${COMMON_DIR}${language}/LC_MESSAGES/${COMMON}.po
mv -f ${LOCALE_DIR}${language}/${book}.po \
${LOCALE_DIR}${language}/LC_MESSAGES/${book}.po
fi