Blame Scripts/centos-art.sh/Functions/Manual/manual_copyEntry.sh

2bd980
#!/bin/bash
2bd980
#
87a0f9
# manual_copyEntry.sh -- This function copies documentation entries and
56f126
# update documentation structure to reflect changes.
2bd980
#
9f5f2e
# Copyright (C) 2009-2011 Alain Reguera Delgado
2bd980
# 
2bd980
# This program is free software; you can redistribute it and/or
2bd980
# modify it under the terms of the GNU General Public License as
2bd980
# published by the Free Software Foundation; either version 2 of the
2bd980
# License, or (at your option) any later version.
2bd980
# 
2bd980
# This program is distributed in the hope that it will be useful, but
2bd980
# WITHOUT ANY WARRANTY; without even the implied warranty of
2bd980
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2bd980
# General Public License for more details.
2bd980
#
2bd980
# You should have received a copy of the GNU General Public License
2bd980
# along with this program; if not, write to the Free Software
2bd980
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
2bd980
# USA.
2bd980
# 
2bd980
# ----------------------------------------------------------------------
2bd980
# $Id$
2bd980
# ----------------------------------------------------------------------
2bd980
87a0f9
function manual_copyEntry {
56f126
56f126
    # Verify target directory.
56f126
    cli_checkRepoDirTarget
56f126
56f126
    # Transform FLAG_TO path into a documentation entry.
56f126
    FLAG_TO=$(manual_getEntry "${FLAG_TO}")
56f126
56f126
    # Print action preamble.
f46717
    cli_printActionPreamble "${FLAG_TO}" 'doCreate' 'AsResponseLine'
56f126
56f126
    # Print action message.
56f126
    cli_printMessage "$FLAG_TO" 'AsCreatingLine'
56f126
56f126
    # Copy documentation entry.
56f126
    svn cp "${ENTRY}" "${FLAG_TO}" --quiet
56f126
56f126
    # Redefine documentation ENTRY variable in order to update
56f126
    # documentation structure based on the new documentation entry
56f126
    # specified by FLAG_TO path. At this point the new documentation
56f126
    # entry should be created and available inside the working copy,
56f126
    # so we are safe to update documentation structure using the new
56f126
    # documentation entry as regular documentation entry.
56f126
    ENTRY="${FLAG_TO}"
2bd980
2bd980
    # Update Texinfo menu information.
2bd980
    manual_updateMenu
2bd980
2bd980
    # Update Texinfo nodes information.
2bd980
    manual_updateNodes
2bd980
2bd980
    # Update Texinfo cross-reference information.
2bd980
    manual_restoreCrossReferences
2bd980
2bd980
}