|
|
f8fb31 |
#!/bin/bash
|
|
|
f8fb31 |
#
|
|
|
0211a4 |
# help_deleteCrossReferences.sh -- This function looks inside
|
|
|
e9dba2 |
# texinfo source files, from section level on, and removes all cross
|
|
|
e9dba2 |
|
|
|
0211a4 |
# function in coordination with help_deleteEntry function, in order
|
|
|
e9dba2 |
|
|
|
e9dba2 |
# manual, syncronized.
|
|
|
f8fb31 |
#
|
|
|
9f5f2e |
# Copyright (C) 2009-2011 Alain Reguera Delgado
|
|
|
f8fb31 |
#
|
|
|
f8fb31 |
# This program is free software; you can redistribute it and/or
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
#
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
# General Public License for more details.
|
|
|
f8fb31 |
#
|
|
|
f8fb31 |
|
|
|
f8fb31 |
# along with this program; if not, write to the Free Software
|
|
|
f8fb31 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
f8fb31 |
# USA.
|
|
|
f8fb31 |
#
|
|
|
f8fb31 |
# ----------------------------------------------------------------------
|
|
|
f8fb31 |
# $Id$
|
|
|
f8fb31 |
# ----------------------------------------------------------------------
|
|
|
f8fb31 |
|
|
|
0211a4 |
function help_deleteCrossReferences {
|
|
|
f8fb31 |
|
|
|
f8fb31 |
local -a PATTERN
|
|
|
f8fb31 |
local -a REPLACE
|
|
|
f2c0f9 |
local LOCATION=''
|
|
|
f8fb31 |
|
|
|
f2c0f9 |
|
|
|
f2c0f9 |
|
|
|
f2c0f9 |
|
|
|
f2c0f9 |
if [[ "$1" != '' ]];then
|
|
|
f2c0f9 |
LOCATION="$1"
|
|
|
f2c0f9 |
else
|
|
|
f2c0f9 |
LOCATION="$ENTRY"
|
|
|
f2c0f9 |
fi
|
|
|
f2c0f9 |
|
|
|
f2c0f9 |
|
|
|
f2c0f9 |
local NODE=$(echo "$LOCATION" \
|
|
|
5285d6 |
| cut -d / -f8- \
|
|
|
f8fb31 |
| tr '/' ' ' \
|
|
|
54ea1a |
| sed -r \
|
|
|
54ea1a |
-e "s/(chapter-intro\.texi|\.texi)$//" \
|
|
|
54ea1a |
-e 's! !( |\\n)!g')
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
PATTERN[0]="@(pxref|xref|ref)\{(${NODE})\}"
|
|
|
f8fb31 |
PATTERN[1]="^(\* ${NODE}:(.*)?:(.*)?)$"
|
|
|
f8fb31 |
|
|
|
f8fb31 |
# Define replacement string for missing entries. It is convenient
|
|
|
f8fb31 |
# to keep missing entries in documentation for documentation team
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
REPLACE[0]='--- @strong{'`gettext "Removed"`'}(\1:\2) ---'
|
|
|
f8fb31 |
REPLACE[1]='@comment --- '`gettext "Removed"`'(\1) ---'
|
|
|
f8fb31 |
|
|
|
54ea1a |
|
|
|
759d18 |
local ENTRIES=$(cli_getFilesList "${MANUAL_BASEDIR}" '.*\.texi')
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
467208 |
cli_printActionPreamble "$ENTRIES" '' ''
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
54ea1a |
# than one line to be set. By default, GNU sed does not matches
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
f2c0f9 |
|
|
|
f2c0f9 |
|
|
|
f2c0f9 |
|
|
|
54ea1a |
sed -r -i ":a;N;s!${PATTERN[0]}!${REPLACE[0]}!g;ba" ${ENTRIES}
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
54ea1a |
sed -r -i "s!${PATTERN[1]}!${REPLACE[1]}!" ${ENTRIES}
|
|
|
f8fb31 |
|
|
|
f8fb31 |
}
|