| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function texinfo_updateChapterMenu { |
| |
| 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 '^\* (Licenses|Index)::$') |
| fi |
| |
| |
| case $ACTION in |
| |
| --delete-entry ) |
| |
| MENUCHAPTERS=$(echo "${MENUCHAPTERS}" \ |
| | egrep -v '^\* '"${MANUAL_CHAPTER_NAME}"'::[[:print:]]*$') |
| ;; |
| |
| --add-entry | * ) |
| |
| |
| |
| |
| |
| |
| MENUCHAPTERS="$(echo "${MENUCHAPTERS}" \ |
| | egrep -v '\* '"${MANUAL_CHAPTER_NAME}"'::[[:print:]]*$') |
| * ${MANUAL_CHAPTER_NAME}::" |
| ;; |
| esac |
| |
| |
| |
| |
| MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ |
| | egrep -v '^[[:space:]]*$') |
| |
| |
| |
| |
| |
| |
| |
| |
| MENUCHAPTERS="@menu |
| ${MENUCHAPTERS} |
| * Licenses:: |
| * Index:: |
| @end menu" |
| |
| |
| MENUCHAPTERS=$(echo "${MENUCHAPTERS}" | sed -r 's!^[[:space:]]+!!' \ |
| | egrep -v '^[[:space:]]*$') |
| |
| |
| echo "${MENUCHAPTERS}" > ${MANUAL_BASEFILE}-menu.${MANUAL_EXTENSION} |
| |
| } |