Blame Scripts/Functions/Prepare/prepare_doLinksSuffixes.sh

befe73
#!/bin/bash
befe73
#
befe73
# prepare_doLinksSuffixes.sh -- This function uses the first argument
befe73
# passed as reference to build the link suffix required by
befe73
# prepare_doLinks function.
befe73
#
2d3646
# Copyright (C) 2009, 2010, 2011 The CentOS Project
befe73
#
befe73
# This program is free software; you can redistribute it and/or modify
befe73
# it under the terms of the GNU General Public License as published by
befe73
# the Free Software Foundation; either version 2 of the License, or (at
befe73
# your option) any later version.
befe73
#
befe73
# This program is distributed in the hope that it will be useful, but
befe73
# WITHOUT ANY WARRANTY; without even the implied warranty of
befe73
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
befe73
# General Public License for more details.
befe73
#
befe73
# You should have received a copy of the GNU General Public License
befe73
# along with this program; if not, write to the Free Software
befe73
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
7ac5a5
#
befe73
# ----------------------------------------------------------------------
befe73
# $Id$
befe73
# ----------------------------------------------------------------------
befe73
befe73
function prepare_doLinksSuffixes {
befe73
befe73
    local FILE="$1"
befe73
    local SUFFIX='centos-'
befe73
6e9154
    if [[ "$FILE" =~ "$(cli_getPathComponent --motif-pattern)" ]];then
6e9154
        SUFFIX="${SUFFIX}$(cli_getRepoName $(cli_getPathComponent $FILE --motif-name) -f)-"
6e9154
        SUFFIX="${SUFFIX}$(cli_getPathComponent $FILE --motif-release)-"
befe73
    fi
befe73
befe73
    echo "${SUFFIX}"
befe73
befe73
}