| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function texinfo_updateChaptersMenu { |
| |
| local ACTION=$1 |
| local MENUCHAPTERS='' |
| |
| |
| |
| |
| |
| |
| if [[ -f ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} ]];then |
| MENUCHAPTERS=$(cat ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} \ |
| | egrep -v "^@(end )?menu$" | egrep -v '^\* Index::$') |
| fi |
| |
| |
| case $ACTION in |
| |
| 'remove-entry' ) |
| |
| MENUCHAPTERS=$(echo "${MENUCHAPTERS}" \ |
| | egrep -v "^\* ${MANUAL_CHAPTER_NAME}::[[:print:]]*$") |
| ;; |
| |
| 'update-entry' | * ) |
| |
| MENUCHAPTERS="${MENUCHAPTERS} |
| * ${MANUAL_CHAPTER_NAME}::" |
| ;; |
| esac |
| |
| |
| |
| |
| MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ |
| | egrep -v '^[[:space:]]*$') |
| |
| |
| |
| MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sort | uniq) |
| |
| |
| MENUCHAPTERS="@menu |
| ${MENUCHAPTERS} |
| * Index:: |
| @end menu" |
| |
| |
| MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ |
| | egrep -v '^[[:space:]]*$') |
| |
| |
| echo "${MENUCHAPTERS}" > ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} |
| |
| } |