Blame Automation/Scripts/tcar_printVersion.sh

Alain Reguera Delgado ddf7d2
#!/bin/bash
Alain Reguera Delgado ddf7d2
######################################################################
Alain Reguera Delgado ddf7d2
#
Alain Reguera Delgado eb3010
#   tcar_printVersion.sh -- This function standardizes the way
Alain Reguera Delgado ddf7d2
#   centos-art.sh script prints version about itself.
Alain Reguera Delgado ddf7d2
#
Alain Reguera Delgado 0e5ba0
#   Written by:
Alain Reguera Delgado ddf7d2
#   * Alain Reguera Delgado <al@centos.org.cu>, 2009-2013
Alain Reguera Delgado ddf7d2
#
Alain Reguera Delgado 0e5ba0
# Copyright (C) 2009-2013 The CentOS Artwork SIG
Alain Reguera Delgado ddf7d2
#
Alain Reguera Delgado ddf7d2
# This program is free software; you can redistribute it and/or modify
Alain Reguera Delgado ddf7d2
# it under the terms of the GNU General Public License as published by
Alain Reguera Delgado ddf7d2
# the Free Software Foundation; either version 2 of the License, or (at
Alain Reguera Delgado ddf7d2
# your option) any later version.
Alain Reguera Delgado ddf7d2
#
Alain Reguera Delgado ddf7d2
# This program is distributed in the hope that it will be useful, but
Alain Reguera Delgado ddf7d2
# WITHOUT ANY WARRANTY; without even the implied warranty of
Alain Reguera Delgado ddf7d2
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Alain Reguera Delgado ddf7d2
# General Public License for more details.
Alain Reguera Delgado ddf7d2
#
Alain Reguera Delgado ddf7d2
# You should have received a copy of the GNU General Public License
Alain Reguera Delgado ddf7d2
# along with this program; if not, write to the Free Software
Alain Reguera Delgado ddf7d2
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Alain Reguera Delgado ddf7d2
#
Alain Reguera Delgado ddf7d2
######################################################################
Alain Reguera Delgado ddf7d2
Alain Reguera Delgado eb3010
function tcar_printVersion {
Alain Reguera Delgado ddf7d2
Alain Reguera Delgado 06ab0f
    local PROGRAM_NAME=${1:-${TCAR_SCRIPT_NAME}}
Alain Reguera Delgado 06ab0f
    local YEAR=$(tcar_printCopyrightInfo --year)
Alain Reguera Delgado 06ab0f
    local HOLDER=$(tcar_printCopyrightInfo --holder)
Alain Reguera Delgado 06ab0f
Alain Reguera Delgado 06ab0f
    if [[ ${PROGRAM_NAME} == ${TCAR_SCRIPT_NAME} ]];then
Alain Reguera Delgado 06ab0f
        tcar_printMessage "${TCAR_SCRIPT_NAME} ${TCAR_SCRIPT_VERSION}" --as-stdout-line
Alain Reguera Delgado 06ab0f
    else
Alain Reguera Delgado 06ab0f
        tcar_printMessage "${PROGRAM_NAME} (${TCAR_SCRIPT_NAME}) ${TCAR_SCRIPT_VERSION}" --as-stdout-line
Alain Reguera Delgado 06ab0f
    fi
Alain Reguera Delgado 06ab0f
    tcar_printMessage "Copyright (C) ${YEAR} ${HOLDER}" --as-stdout-line
Alain Reguera Delgado 06ab0f
    tcar_printMessage "`eval_gettext "\\\$PROGRAM_NAME comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of \\\$PROGRAM_NAME under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING."`" --as-stdout-line | fold --width=66 --spaces
Alain Reguera Delgado 06ab0f
Alain Reguera Delgado ddf7d2
    exit 0
Alain Reguera Delgado ddf7d2
Alain Reguera Delgado ddf7d2
}