Blame Scripts/Functions/Prepare/prepare_doEnvironment.sh

c29817
#!/bin/bash
c29817
#
1700f3
# prepare_doEnvironment.sh -- This function outputs a brief description
c29817
# of environment variables used by `centos-art.sh' script.
c29817
#
2d3646
# 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
c29817
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
c29817
# General Public License for more details.
c29817
#
c29817
# You should have received a copy of the GNU General Public License
c29817
# along with this program; if not, write to the Free Software
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
7ac5a5
#
c29817
# ----------------------------------------------------------------------
c29817
# $Id$
c29817
# ----------------------------------------------------------------------
c29817
1700f3
function prepare_doEnvironment {
c29817
409e1e
    # Verify `--packages' option.
eea485
    if [[ $FLAG_ENVIRONMENT == 'false' ]];then
409e1e
        return
409e1e
    fi
409e1e
eea485
    # Print action message.
c81fb1
    cli_printMessage "`gettext "Checking environment variables"`" 'AsBannerLine'
eea485
c29817
    local -a VARS
c29817
    local -a INFO
c29817
    local COUNT=0
c29817
c29817
    # Define name of environment variables used by centos-art.sh
c29817
    # script.
c29817
    VARS[0]='EDITOR'
c29817
    VARS[1]='TZ'
c29817
    VARS[2]='TEXTDOMAIN'
c29817
    VARS[3]='TEXTDOMAINDIR'
c29817
    VARS[4]='LANG'
c29817
c29817
    # Define description of environment variables.
c29817
    INFO[0]="`gettext "Default text editor"`"
c29817
    INFO[1]="`gettext "Default time zone representation"`"
c29817
    INFO[2]="`gettext "Default domain used to retrieve translated messages"`"
c29817
    INFO[3]="`gettext "Default directory used to retrive translated messages"`"
c29817
    INFO[4]="`gettext "Default locale information"`"
c29817
c29817
    until [[ $COUNT -eq ${#VARS[*]} ]];do
c29817
4b8e06
        # Let user to reduce output using regular expression as
c29817
        # reference.
558b58
        if [[ ${VARS[$COUNT]} =~ $FLAG_FILTER ]];then
c29817
c29817
            # Output list of environment variables using indirect
c29817
            # expansion (what a beautiful feature!) to output variable
c29817
            # value.
c29817
            cli_printMessage "${INFO[$COUNT]}:"
c29817
            cli_printMessage "${VARS[$COUNT]}=${!VARS[$COUNT]}" 'AsResponseLine'
c29817
c29817
        fi
c29817
c29817
        # Increment counter.
c29817
        COUNT=$(($COUNT + 1))
c29817
c29817
    done
c29817
c29817
}