Blame Scripts/Functions/Prepare/prepare.sh

4c79b5
#!/bin/bash
4c79b5
#
8e457b
# prepare.sh -- This function prepares your workstation for using the
8e457b
# centos-art command-line.
4c79b5
#
3b0984
# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG
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
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c79b5
# General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with this program; if not, write to the Free Software
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
7ac5a5
#
4c79b5
# ----------------------------------------------------------------------
3b853a
# $Id$
4c79b5
# ----------------------------------------------------------------------
4c79b5
111205
function prepare {
4c79b5
38d53d
    # Initialize action name variable. Here is where we store the
38d53d
    # name of the actions that will be executed based on the options
38d53d
    # passed in the command-line.
38d53d
    local ACTIONNAM=''
38d53d
    local ACTIONNAMS=''
8e457b
38d53d
    # Define absolute path to directory holding prepare's
38d53d
    # configuration files.
38d53d
    PREPARE_CONFIG_DIR=${FUNCDIR}/${FUNCDIRNAM}/Config
8e457b
8e457b
    # Interpret arguments and options passed through command-line.
6449f4
    prepare_getOptions
4c79b5
8e457b
    # Redefine positional parameters using ARGUMENTS. At this point,
8e457b
    # option arguments have been removed from ARGUMENTS variable and
8e457b
    # only non-option arguments remain in it. 
8e457b
    eval set -- "$ARGUMENTS"
8e457b
8e457b
    # Define action name. It does matter what option be passed to
8e457b
    # centos-art, there are many different actions to perform based on
8e457b
    # the option passed (e.g., `--packages', `--links',
8e457b
    # `--environment', etc.).  In that sake, we defined action name
6449f4
    # inside prepare_getOptions, at the moment of interpreting
8e457b
    # options.
8e457b
8e457b
    # Define action value. There is no action value in this function,
8e457b
    # but action name values only. There is no need for non-option
8e457b
    # arguments here since we are doing fixed verifications only in
8e457b
    # predifined paths.
8e457b
38d53d
    # Execute action names.
38d53d
    for ACTIONNAM in $ACTIONNAMS;do
38d53d
        ${ACTIONNAM}
38d53d
    done
8e457b
4c79b5
}