From 3385aacbfe0fe9a64af00f8fe273b079ae1cbee8 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Mar 01 2011 15:58:00 +0000 Subject: Update manual_deleteEntry.sh. --- diff --git a/Scripts/Bash/centos-art/Functions/Manual/manual_deleteEntry.sh b/Scripts/Bash/centos-art/Functions/Manual/manual_deleteEntry.sh index fac78da..8dce138 100755 --- a/Scripts/Bash/centos-art/Functions/Manual/manual_deleteEntry.sh +++ b/Scripts/Bash/centos-art/Functions/Manual/manual_deleteEntry.sh @@ -26,68 +26,56 @@ function manual_deleteEntry { + local ENTRY_SRC=${ENTRY} local ENTRIES='' - - # Check if the entry has been already removed. - cli_checkFiles $ENTRY 'f' + local ENTRY='' + local ENTRY_DEP='' # Initiate list of entries to remove using the entry specified in # the command line. - ENTRIES=${ENTRY} + ENTRIES=${ENTRY_SRC} # Verify existence of dependent entries. Dependent entries are # stored inside a directory with the same name of the entry you # are trying to remove. if [[ -d ${ENTRY_DIR}/${ENTRY_FILE} ]];then - # If such directory doesn't exists, the related entry doesn't - # have dependent entries, but if it exists is because there is - # at least one dependent entry inside it, in this case add - # dependent all dependent entries. This is required in order - # for menus, nodes and cross-references to be updated correctly. + # Add dependent files to list of entries. ENTRIES="${ENTRIES} $(cli_getFilesList "${ENTRY_DIR}/${ENTRY_FILE}" ".*\.texi")" - # Also, add the directory that stores dependent entries. This - # is required since directories by themselves are not - # considered entries by themselves and so they aren't put on - # the list of entries. We don't want to have dependent - # directories still there, when there is no parent entry for - # them. - ENTRIES="${ENTRIES} ${ENTRY_DIR}/${ENTRY_FILE}" + # Add dependent directories to list of entries. Be aware of + # nested directories. + for ENTRY in ${ENTRIES};do + ENTRY_DEP=$(echo $ENTRY | sed -r "s/\.texi$//") + if [[ -d $ENTRY_DEP ]];then + ENTRIES="${ENTRIES} ${ENTRY_DEP}" + fi + done fi # Prepare list of entries for action preamble. - ENTRIES=$(echo $ENTRIES | tr ' ' "\n" | sort | uniq) + ENTRIES=$(echo ${ENTRIES} | tr ' ' "\n" | sort -r | uniq) # Print action preamble. cli_printActionPreamble "$ENTRIES" 'doDelete' 'AsResponseLine' - # Process list of entries in order to remove files. - for ENTRY in $ENTRIES;do - - # Print action message. - cli_printMessage "$ENTRY" "AsDeletingLine" - - # Remove documentation entry using regular subversion - # commands. Do not use regular rm command here, use - # subversion del command instead. Otherwise, even the file is - # removed, it will be brought back when the final - # cli_commitRepoChange be executed. Remember there is a - # subversion update there, no matter what you remove using - # regular commands, when you do update the directory structure - # on the working copy the removed files (not removed in the - # repository, nor marked to be removed) are brought down to - # the working copy again. - svn del "$ENTRY" --quiet - - done + # Remove documentation entry using regular subversion commands. + # Do not use regular rm command here, use subversion del command + # instead. Otherwise, even the file is removed, it will be brought + # back when the final cli_commitRepoChange be executed. Remember + # there is a subversion update there, no matter what you remove + # using regular commands, when you do update the directory + # structure on the working copy the removed files (not removed in + # the repository, nor marked to be removed) are brought down to + # the working copy again. + svn del ${ENTRIES} --quiet # Print separator line. cli_printMessage '-' 'AsSeparatorLine' # Print action message. - cli_printMessage "Updating definition of menus, nodes and cross-references." 'AsResponseLine' + cli_printMessage "Updating manual menus, nodes and cross-references." 'AsResponseLine' # Process list of entries in order to update menus, nodes and # cross references. Since we are verifying entry status before @@ -100,7 +88,14 @@ function manual_deleteEntry { # different way but removing files first using status verification # and later go through entities list again to update menus, nodes # and cross references from remaining files. - for ENTRY in $ENTRIES;do + for ENTRY in ${ENTRIES};do + + # Use entry files only. Directories are used to store + # dependent entries. Directories are not considered entries on + # themselves. + if [[ ! -f $ENTRY ]];then + continue + fi # Update menu and node definitions from manual sections to # reflect the changes. @@ -121,10 +116,4 @@ function manual_deleteEntry { manual_updateChaptersNodes fi - # Print separator line. - cli_printMessage '-' 'AsSeparatorLine' - - # Rebuild output files to propagate recent changes. - manual_updateOutputFiles - }