|
|
f8fb31 |
#!/bin/bash
|
|
|
f8fb31 |
#
|
|
|
742c46 |
# manual_deleteCrossReferences.sh -- This function looks inside
|
|
|
e9dba2 |
# texinfo source files, from section level on, and removes all cross
|
|
|
e9dba2 |
|
|
|
742c46 |
# function in coordination with manual_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 |
|
|
|
742c46 |
function manual_deleteCrossReferences {
|
|
|
f8fb31 |
|
|
|
f8fb31 |
local -a PATTERN
|
|
|
f8fb31 |
local -a REPLACE
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
local NODE=$(echo "$ENTRY" \
|
|
|
f8fb31 |
| cut -d / -f10- \
|
|
|
f8fb31 |
| tr '/' ' ' \
|
|
|
f8fb31 |
| sed -r "s/(${MANUALS_FILE[7]}|\.texi)$//")
|
|
|
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 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
sed -r -i \
|
|
|
f8fb31 |
-e "s!${PATTERN[0]}!${REPLACE[0]}!Mg" \
|
|
|
f8fb31 |
-e "s!${PATTERN[1]}!${REPLACE[1]}!g" \
|
|
|
f8fb31 |
$(find ${MANUALS_DIR[2]} -mindepth 3 -name '*.texi')
|
|
|
f8fb31 |
|
|
|
f8fb31 |
}
|