| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function manual_removeEntry { |
| |
| |
| local ENTRIES='' |
| local ENTRIES_COUNTER=0 |
| local LOCATION='' |
| |
| |
| cli_commitRepoChanges "$ENTRY" |
| |
| |
| if [[ ! -f $ENTRY ]];then |
| cli_printMessage "`gettext "The following entry doesn't exist:"`" |
| cli_printMessage "$ENTRY" "AsResponseLine" |
| cli_printMessage "$(caller)" "AsToKnowMoreLine" |
| fi |
| |
| # Define entries. Start with the one being processed currently. |
| ENTRIES=$ENTRY |
| |
| # Define root location to look for entries. |
| LOCATION=$(echo $ENTRY | sed -r 's!\.texi$!!') |
| |
| # Re-define location to match the chapter's root directory. This |
| |
| |
| if [[ $ENTRY =~ "${MANUALS_FILE[7]}$" ]];then |
| LOCATION=$(dirname $ENTRY) |
| fi |
| |
| |
| |
| |
| |
| |
| |
| if [[ -d $LOCATION ]];then |
| for ENTRY in $(find $LOCATION -name '*.texi');do |
| ENTRIES="$ENTRIES $ENTRY $(dirname $ENTRY)" |
| ENTRIES_COUNTER=$(($ENTRIES_COUNTER + 1)) |
| done |
| fi |
| |
| |
| ENTRIES=$(echo "$ENTRIES" | tr ' ' "\n" | sort -r | uniq) |
| |
| |
| cli_printMessage "`ngettext "The following entry will be removed:" \ |
| "The following entries will be removed:" \ |
| $ENTRIES_COUNTER`" |
| |
| |
| for ENTRY in $ENTRIES;do |
| cli_printMessage "$ENTRY" "AsResponseLine" |
| done |
| |
| cli_printMessage "`gettext "Do you want to continue?"`" "AsYesOrNoRequestLine" |
| |
| |
| for ENTRY in $ENTRIES;do |
| |
| |
| cli_printMessage "$ENTRY" "AsRemovingLine" |
| |
| |
| |
| |
| |
| if [[ "$(cli_getRepoStatus "$ENTRY")" == ' ' ]];then |
| |
| |
| |
| |
| |
| svn del "$ENTRY" --quiet |
| |
| elif [[ "$(cli_getRepoStatus "$ENTRY")" == '?' ]];then |
| |
| |
| |
| |
| |
| |
| if [[ -d "$ENTRY" ]];then |
| rm -r "$ENTRY" |
| else |
| rm "$ENTRY" |
| fi |
| |
| else |
| |
| |
| |
| |
| |
| cli_printMessage "`gettext "The documentation entry cannot be removed."`" 'AsErrorLine' |
| cli_printMessage "$(caller)" 'AsToKnowMoreLine' |
| |
| fi |
| |
| |
| |
| manual_updateMenu "remove-entry" |
| manual_updateNodes |
| |
| |
| manual_removeCrossReferences |
| |
| done |
| |
| |
| |
| |
| if [[ ! -d $ENTRYCHAPTER ]];then |
| manual_updateChaptersMenu 'remove-entry' |
| manual_updateChaptersNodes |
| fi |
| |
| |
| manual_updateOutputFiles |
| |
| } |