Blame Scripts/centos-art/Functions/cli_getRepoParallelDirs.sh

328582
#!/bin/bash
328582
#
179346
# cli_getRepoParallelDirs.sh -- This function returns the parallel
179346
# directories related to the first positional paramenter passed as
179346
# parent directory. 
328582
#
2fe9b7
# Copyright (C) 2009, 2010, 2011 The CentOS Project
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
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
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
7ac5a5
#
328582
# ----------------------------------------------------------------------
328582
# $Id$
328582
# ----------------------------------------------------------------------
328582
179346
function cli_getRepoParallelDirs {
328582
179346
    local BOND=''
179346
    local TDIR=''
179346
    local -a PDIRS
328582
179346
    # Define bond string using first positional parameter as
179346
    # reference.
179346
    if [[ "$1" != '' ]];then
179346
        BOND="$1"
179346
    elif [[ "$ACTIONVAL" != '' ]];then
179346
        BOND="$ACTIONVAL"
179346
    else
d92109
        cli_printMessage "`gettext "The bond string is required."`" --as-error-line
179346
    fi
328582
179346
    # Define repository top level directory.
179346
    TDIR=$(cli_getRepoTLDir ${BOND})
328582
179346
    # Define parallel directory base structures.
8c7287
    PDIRS[0]=Manuals/$(cli_getCurrentLocale)/Texinfo/Repository/$(cli_getRepoTLDir ${BOND} --relative)
179346
    PDIRS[1]=Scripts/Bash/Functions/Render/Config
a5d502
    PDIRS[2]=L10n
179346
179346
    # Redefine bond string without its top level directory structure.
e6e90a
    BOND=$(echo $BOND | sed -r "s,^${TDIR}/(.+)$,\1,")
179346
179346
    # Concatenate repository top level directory, parallel directory
179346
    # base structure, and bond information; in order to produce the
179346
    # final parallel directory path.
e6e90a
    for PDIR in "${PDIRS[@]}";do
179346
        echo ${TDIR}/${PDIR}/${BOND}
179346
    done
328582
328582
}