Blame Scripts/Bash/Functions/cli_getRepoDirParallel.sh

328582
#!/bin/bash
328582
#
328582
# cli_getRepoDirParallel.sh -- This function returns the parallel
328582
# directory of path passed through action value variable. This
328582
# function implements the parallel directory conceptual idea.
328582
#
72c8a5
# Copyright (C) 2009-2011  Alain Reguera Delgado
328582
# 
72c8a5
# This program is free software; you can redistribute it and/or
72c8a5
# modify it under the terms of the GNU General Public License as
72c8a5
# published by the Free Software Foundation; either version 2 of the
72c8a5
# License, or (at your option) any later version.
328582
# 
328582
# This program is distributed in the hope that it will be useful, but
328582
# WITHOUT ANY WARRANTY; without even the implied warranty of
328582
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
328582
# General Public License for more details.
328582
#
328582
# You should have received a copy of the GNU General Public License
328582
# along with this program; if not, write to the Free Software
328582
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
328582
# USA.
328582
# 
328582
# ----------------------------------------------------------------------
328582
# $Id$
328582
# ----------------------------------------------------------------------
328582
328582
function cli_getRepoDirParallel {
328582
328582
    # Initialize bond string.
328582
    local BOND=$1
328582
328582
    # Initialize parallel directory using first argument.
328582
    local DIR=$2
328582
328582
    # Remove top level directory from action value to create the bond.
328582
    BOND=$(echo $BOND | sed -r "s!^.+/(trunk|branches|tags)/!!")
328582
328582
    # Concatenate parallel-directory base location and bond
328582
    # information in order to produce the final parallel-directory
328582
    # path.
328582
    echo $DIR/$BOND
328582
328582
}