|
|
f8fb31 |
#!/bin/bash
|
|
|
f8fb31 |
#
|
|
|
993f6a |
# texinfo_deleteCrossReferences.sh -- This function looks inside
|
|
|
e9dba2 |
# texinfo source files, from section level on, and removes all cross
|
|
|
e9dba2 |
|
|
|
993f6a |
# function in coordination with texinfo_deleteEntry function, in order
|
|
|
e9dba2 |
|
|
|
e9dba2 |
# manual, syncronized.
|
|
|
f8fb31 |
#
|
|
|
3b0984 |
# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG
|
|
|
fa95b1 |
#
|
|
|
fa95b1 |
# This program is free software; you can redistribute it and/or modify
|
|
|
fa95b1 |
|
|
|
dcd347 |
|
|
|
dcd347 |
|
|
|
fa95b1 |
#
|
|
|
74a058 |
|
|
|
74a058 |
|
|
|
f8fb31 |
|
|
|
f8fb31 |
# General Public License for more details.
|
|
|
f8fb31 |
#
|
|
|
f8fb31 |
|
|
|
f8fb31 |
# along with this program; if not, write to the Free Software
|
|
|
dcd347 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
7ac5a5 |
#
|
|
|
f8fb31 |
# ----------------------------------------------------------------------
|
|
|
f8fb31 |
# $Id$
|
|
|
f8fb31 |
# ----------------------------------------------------------------------
|
|
|
f8fb31 |
|
|
|
993f6a |
function texinfo_deleteCrossReferences {
|
|
|
f8fb31 |
|
|
|
f8fb31 |
local -a PATTERN
|
|
|
f8fb31 |
local -a REPLACE
|
|
|
f8fb31 |
|
|
|
4191e8 |
|
|
|
4191e8 |
local MANUAL_ENTRY="$1"
|
|
|
4191e8 |
|
|
|
4191e8 |
|
|
|
4191e8 |
|
|
|
4191e8 |
if [[ $MANUAL_ENTRY == '' ]];then
|
|
|
4191e8 |
cli_printMessage "`gettext "The first positional parameter cannot be empty."`" --as-error-line
|
|
|
f2c0f9 |
fi
|
|
|
f2c0f9 |
|
|
|
f2c0f9 |
|
|
|
448d34 |
local NODE=$(${MANUAL_BACKEND}_getNode "$MANUAL_ENTRY")
|
|
|
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 |
|
|
|
9fa13b |
local MANUAL_ENTRIES=$(cli_getFilesList ${MANUAL_BASEDIR} \
|
|
|
9fa13b |
--pattern=".*\.${MANUAL_EXTENSION}")
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
54ea1a |
# than one line to be set. By default, GNU sed does not matches
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
f2c0f9 |
|
|
|
f2c0f9 |
|
|
|
f2c0f9 |
|
|
|
4191e8 |
|
|
|
4191e8 |
|
|
|
4191e8 |
|
|
|
4191e8 |
|
|
|
4191e8 |
|
|
|
4191e8 |
|
|
|
4191e8 |
|
|
|
4191e8 |
|
|
|
4191e8 |
|
|
|
4191e8 |
|
|
|
4191e8 |
|
|
|
4191e8 |
# `Manualss', `Manualsss', and so on for each interaction.
|
|
|
4191e8 |
sed -r -i ":a;N;s!\<${PATTERN[0]}\>!${REPLACE[0]}!g;ba" ${MANUAL_ENTRIES}
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
54ea1a |
|
|
|
4191e8 |
|
|
|
4191e8 |
sed -r -i "s!\<${PATTERN[1]}\>!${REPLACE[1]}!" ${MANUAL_ENTRIES}
|
|
|
f8fb31 |
|
|
|
f8fb31 |
}
|