|
Alain Reguera Delgado |
8f60cb |
#!/bin/bash
|
|
Alain Reguera Delgado |
8f60cb |
#
|
|
Alain Reguera Delgado |
8f60cb |
# texinfo_createStructure.sh -- This function creates the
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
# reference.
|
|
Alain Reguera Delgado |
8f60cb |
#
|
|
Alain Reguera Delgado |
8f60cb |
# Copyright (C) 2009-2013 The CentOS Project
|
|
Alain Reguera Delgado |
8f60cb |
#
|
|
Alain Reguera Delgado |
8f60cb |
# This program is free software; you can redistribute it and/or modify
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
#
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
# General Public License for more details.
|
|
Alain Reguera Delgado |
8f60cb |
#
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
# along with this program; if not, write to the Free Software
|
|
Alain Reguera Delgado |
8f60cb |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
Alain Reguera Delgado |
8f60cb |
#
|
|
Alain Reguera Delgado |
8f60cb |
# ----------------------------------------------------------------------
|
|
Alain Reguera Delgado |
8f60cb |
# $Id$
|
|
Alain Reguera Delgado |
8f60cb |
# ----------------------------------------------------------------------
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
function texinfo_createStructure {
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
if [[ -f ${MANUAL_BASEFILE}.${MANUAL_EXTENSION} ]];then
|
|
Alain Reguera Delgado |
8f60cb |
return
|
|
Alain Reguera Delgado |
8f60cb |
else
|
|
Alain Reguera Delgado |
8f60cb |
cli_printMessage "`eval_gettext "The following documentation manual doesn't exist:"`" --as-stdout-line
|
|
Alain Reguera Delgado |
8f60cb |
cli_printMessage "${MANUAL_BASEFILE}.${MANUAL_EXTENSION}" --as-response-line
|
|
Alain Reguera Delgado |
8f60cb |
cli_printMessage "`gettext "Do you want to create it now?"`"
|
|
Alain Reguera Delgado |
8f60cb |
fi
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
local MANUAL_TITLE=''
|
|
Alain Reguera Delgado |
8f60cb |
local MANUAL_SUBTITLE=''
|
|
Alain Reguera Delgado |
8f60cb |
local MANUAL_ABSTRACT=''
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
cli_printMessage "`gettext "Enter manual's title"`" --as-request-line
|
|
Alain Reguera Delgado |
8f60cb |
read MANUAL_TITLE
|
|
Alain Reguera Delgado |
8f60cb |
cli_printMessage "`gettext "Enter manual's subtitle"`" --as-request-line
|
|
Alain Reguera Delgado |
8f60cb |
read MANUAL_SUBTITLE
|
|
Alain Reguera Delgado |
8f60cb |
cli_printMessage "`gettext "Enter manual's abstract"`" --as-request-line
|
|
Alain Reguera Delgado |
8f60cb |
read MANUAL_ABSTRACT
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
if [[ $MANUAL_TITLE == '' ]];then
|
|
Alain Reguera Delgado |
8f60cb |
cli_printMessage "`gettext "The manual title cannot be empty."`" --as-error-line
|
|
Alain Reguera Delgado |
8f60cb |
fi
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
# Create manual's top-level directory using default version
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
if [[ ! -d ${MANUAL_BASEDIR} ]];then
|
|
Alain Reguera Delgado |
8f60cb |
cli_printMessage "${MANUAL_BASEDIR}" --as-creating-line
|
|
Alain Reguera Delgado |
8f60cb |
cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_BASEDIR}
|
|
Alain Reguera Delgado |
8f60cb |
fi
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
cli_printMessage "${MANUAL_BASEDIR_L10N}" --as-creating-line
|
|
Alain Reguera Delgado |
8f60cb |
cli_runFnEnvironment vcs --quiet --mkdir ${MANUAL_BASEDIR_L10N}
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
local FILE=''
|
|
Alain Reguera Delgado |
8f60cb |
local FILES=$(cli_getFilesList "${MANUAL_TEMPLATE_L10N}" \
|
|
Alain Reguera Delgado |
8f60cb |
--maxdepth='1' \
|
|
Alain Reguera Delgado |
8f60cb |
--pattern="^.+/manual((-menu|-nodes|-index)?\.${MANUAL_EXTENSION}|\.conf)$")
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
# documentation manual is defined in the format format. Assuming
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
for FILE in $FILES;do
|
|
Alain Reguera Delgado |
8f60cb |
if [[ ! -f ${MANUAL_BASEDIR_L10N}/$(basename ${FILE}) ]];then
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
cli_checkFiles ${FILE} --is-versioned
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
local DST=${MANUAL_BASEDIR_L10N}/$(basename ${FILE} \
|
|
Alain Reguera Delgado |
8f60cb |
| sed -r "s!manual!${MANUAL_NAME}!")
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
cli_printMessage "${DST}" --as-creating-line
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
# Copy using subversion to register this action.
|
|
Alain Reguera Delgado |
8f60cb |
cli_runFnEnvironment vcs --quiet --copy ${FILE} ${DST}
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
cli_expandTMarkers ${DST}
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
sed -r -i -e "s!=MANUAL_NAME=!${MANUAL_NAME}!g" \
|
|
Alain Reguera Delgado |
8f60cb |
-e "s!=MANUAL_TITLE=!${MANUAL_TITLE}!g" \
|
|
Alain Reguera Delgado |
8f60cb |
-e "s!=MANUAL_SUBTITLE=!${MANUAL_SUBTITLE}!g" \
|
|
Alain Reguera Delgado |
8f60cb |
-e "s!=MANUAL_ABSTRACT=!${MANUAL_ABSTRACT}!g" $DST
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
fi
|
|
Alain Reguera Delgado |
8f60cb |
done
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
texinfo_createStructureChapters
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
MANUAL_CHANGED_DIRS=${MANUAL_BASEDIR}
|
|
Alain Reguera Delgado |
8f60cb |
|
|
Alain Reguera Delgado |
8f60cb |
}
|