| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function texinfo_updateStructureSection { |
| |
| local PATTERN="${1}" |
| |
| |
| |
| |
| if [[ $PATTERN =~ "${MANUAL_NAME}\.${MANUAL_EXTENSION}$" ]] \ |
| || [[ $PATTERN == '' ]]; then |
| PATTERN="/.+\.${MANUAL_EXTENSION}$" |
| fi |
| |
| local MANUAL_ENTRY='' |
| local MANUAL_ENTRIES='' |
| local ACTIONNAM_SECMENU='' |
| local ACTIONNAM_CROSREF='' |
| |
| |
| |
| case "$2" in |
| |
| --delete ) |
| |
| |
| |
| ACTIONNAM_SECMENU='texinfo_updateSectionMenu --delete-entry' |
| |
| |
| |
| ACTIONNAM_CROSREF='texinfo_deleteCrossReferences' |
| ;; |
| |
| --update | * ) |
| |
| |
| |
| ACTIONNAM_SECMENU='texinfo_updateSectionMenu --add-entry' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ACTIONNAM_CROSREF='texinfo_restoreCrossReferences' |
| ;; |
| |
| esac |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR_L10N} \ |
| --pattern="${PATTERN}" --mindepth="2" --maxdepth="2") |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| if [[ $MANUAL_ENTRIES == '' ]] && [[ $PATTERN =~ '^/[[:alnum:]./_-]+$' ]];then |
| MANUAL_ENTRIES=${PATTERN} |
| fi |
| |
| |
| |
| |
| if [[ $MANUAL_ENTRIES == '' ]];then |
| cli_printMessage "`gettext "There wasn't any section for processing found."`" --as-error-line |
| fi |
| |
| # Loop through target documentation entries in order to update the |
| # documentation structure (e.g., it is not enough with copying |
| # documentation entry files, it is also needed to update menu, |
| # nodes and related cross-references). |
| for MANUAL_ENTRY in ${MANUAL_ENTRIES};do |
| |
| # Define menu file based on manual entry. We use the menu file |
| # as reference to build the nodes files and update the menu |
| # file itself based on available section files. |
| local MENUFILE=$(dirname ${MANUAL_ENTRY} \ |
| | sed -r 's,/$,,')-menu.${MANUAL_EXTENSION} |
| |
| # Don't print action name here. Instead, make it integral part |
| |
| |
| |
| ${ACTIONNAM_SECMENU} |
| texinfo_updateSectionNodes |
| texinfo_makeSeeAlso "${MANUAL_ENTRY}" |
| ${ACTIONNAM_CROSREF} "${MANUAL_ENTRY}" |
| |
| done |
| |
| } |