From 658f2b52d2f92ed90e53e27e843af43b786e536f Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Apr 02 2011 03:23:33 +0000 Subject: Update help_renameCrossReferences.sh: - Do not relate separator character from source node when building target node. They both, the source node and the target node, may contain different information and even the procedure removed here works well to nodes that have the same number of words, that is not true for nodes that have different number of words. When the target node has less words than source node there is no problem, but when the target node has more words than source node what separator do we use ? mmm... I don't like that so replace source node with target node using an space to separate words on target node, no matter if source node uses a white space or a new line to separate words. --- diff --git a/Scripts/Functions/Help/help_renameCrossReferences.sh b/Scripts/Functions/Help/help_renameCrossReferences.sh index 479d794..9a0e7bb 100755 --- a/Scripts/Functions/Help/help_renameCrossReferences.sh +++ b/Scripts/Functions/Help/help_renameCrossReferences.sh @@ -37,31 +37,15 @@ function help_renameCrossReferences { | cut -d / -f8- \ | tr '/' ' ' \ | sed -r \ - -e "s/(chapter-intro\.texi|\.texi)$//" \ - -e 's! !( |\\n)!g') + -e "s/(chapter-intro\.texi|\.texi)$//") # Define node replacement for target documentation entry. - NODE_DST=$(echo "$FLAG_TO" \ + NODE_DST=$(echo "$ENTRY_DST" \ | cut -d / -f8- \ | tr '/' ' ' \ | sed -r \ -e "s/(chapter-intro\.texi|\.texi)$//") - # Sanitate node replacement for target documentation entry to make - # use of regular expression positional markers, so the word - # separator character found by node pattern could be used. - for NODE in $NODE_DST;do - if [[ $COUNT -eq 1 ]];then - NODE_DST="${NODE}\\${COUNT}" - else - NODE_DST="${NODE_DST}$(echo "${NODE}\\${COUNT}")" - fi - COUNT=$(($COUNT + 1)) - done - - # Remove last positional marker from node replacement. - NODE_DST=$(echo $NODE_DST | sed -r 's!\\[[:digit:]]$!!') - # Define list of entries to process. ENTRIES=$(cli_getFilesList "${MANUAL_BASEDIR}" '.*\.texi') @@ -82,7 +66,8 @@ function help_renameCrossReferences { # At this point, source documentation entry has been renamed from # source to target documentation entry, but they are still - # commented. So, restore target documentation entries. - help_restoreCrossReferences "${FLAG_TO}" + # commented. So, uncomment them restoring target documentation + # entries. + help_restoreCrossReferences "${ENTRY_DST}" }