Blame Scripts/Functions/Path/path_doCopy.sh

407d66
#!/bin/bash
407d66
#
6ecc07
# path_doCopy.sh -- This function duplicates files inside the working
6ecc07
# copy using subversion commands.
407d66
#
ff008e
# Copyright (C) 2009-2011 Alain Reguera Delgado
fa95b1
#
fa95b1
# This program is free software; you can redistribute it and/or modify
fa95b1
# it under the terms of the GNU General Public License as published by
dcd347
# the Free Software Foundation; either version 2 of the License, or (at
dcd347
# your option) any later version.
fa95b1
#
74a058
# This program is distributed in the hope that it will be useful, but
74a058
# WITHOUT ANY WARRANTY; without even the implied warranty of
407d66
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
407d66
# General Public License for more details.
407d66
#
407d66
# You should have received a copy of the GNU General Public License
407d66
# along with this program; if not, write to the Free Software
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
407d66
# ----------------------------------------------------------------------
407d66
# $Id$
407d66
# ----------------------------------------------------------------------
407d66
407d66
function path_doCopy {
407d66
c1853c
    # Verify target directory.
c1853c
    cli_checkRepoDirTarget
8ba5a0
ff008e
    # Print action preamble.
ff008e
    cli_printActionPreamble "${FLAG_TO}" 'doCreate' 'AsResponseLine'
ff008e
    
ff008e
    # Verify relation between source and target locations. We cannot
ff008e
    # duplicate an entry if its parent directory doesn't exist as
ff008e
    # entry inside the working copy.
ff008e
    if [[ -f ${ACTIONVAL} ]];then
850ed3
        if [[ ! -d $(dirname "${FLAG_TO}") ]];then
850ed3
           mkdir -p $(dirname "${FLAG_TO}")
ff008e
        fi
850ed3
        svn add $(dirname "${FLAG_TO}") --quiet
ff008e
    fi
6ecc07
ff008e
    # Print action message.
ff008e
    cli_printMessage "${FLAG_TO}" 'AsCreatingLine'
6ecc07
ff008e
    # Copy parent directory.
ff008e
    svn copy ${ACTIONVAL} ${FLAG_TO} --quiet
6ecc07
ff008e
    # Verify syncronization flag.
ff008e
    if [[ $FLAG_SYNC == 'true' ]];then
6ecc07
ff008e
        # Copy parallel directories.
ff008e
        . /home/centos/bin/centos-art manual --copy="$ACTIONVAL" --to="$FLAG_TO"
ff008e
        . /home/centos/bin/centos-art render --copy="$ACTIONVAL" --to="$FLAG_TO"
ff008e
        . /home/centos/bin/centos-art locale --copy="$ACTIONVAL" --to="$FLAG_TO"
8ba5a0
ff008e
    fi
407d66
407d66
}