| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function manual_updateMenu { |
| |
| |
| local ACTION="$1" |
| |
| |
| |
| local MENULINE=$(echo "$ENTRY" \ |
| | cut -d / -f10- \ |
| | tr '/' ' ' \ |
| | sed -r "s/(${MANUALS_FILE[7]}|\.texi)$//") |
| |
| |
| MENULINE="* $MENULINE::" |
| |
| |
| |
| local MENU=$(cat $ENTRYCHAPTER/${MANUALS_FILE[8]} \ |
| | egrep -v '^[[:space:]]*$' | egrep -v '^@(end )?menu') |
| |
| |
| case $ACTION in |
| 'remove-entry' ) |
| |
| MENU=$(echo "$MENU" | egrep -v "$MENULINE") |
| ;; |
| 'update-entry' | * ) |
| |
| |
| |
| MENU="$MENU |
| $MENULINE" |
| ;; |
| esac |
| |
| |
| |
| |
| MENU=$(echo "$MENU" | egrep -v '^[[:space:]]*$' | sort | uniq ) |
| |
| |
| |
| MENU="@menu |
| $MENU |
| @end menu" |
| |
| |
| MENU=$(echo "$MENU" | sed -r 's!^[[:space:]]+!!g') |
| |
| |
| echo "$MENU" > $ENTRYCHAPTER/${MANUALS_FILE[8]} |
| |
| } |