Blame Manuals/Repository/en/Texinfo/trunk/Scripts/Bash.texi

076f77
@subsection Goals
076f77
076f77
The @file{trunk/Scripts/Bash} directory exists to organize the trunk
076f77
development line of @file{centos-art.sh} automation script.  The
076f77
@file{centos-art.sh} script standardizes frequent tasks inside your
076f77
working copy of CentOS Artwork Repository.
076f77
076f77
@subsection Description
076f77
076f77
The best way to understand @file{centos-art.sh} automation script is
076f77
studying its source code.  However, as start point, you may prefer to
076f77
read an introductory resume before diving into the source code
076f77
details.
076f77
076f77
The @file{centos-art.sh} script is written in Bash. Most tasks, inside
076f77
@file{centos-art.sh} script, have been organized in many specific
076f77
functionalities that you can invoke from the @command{centos-art}
076f77
command-line interface.
076f77
076f77
When you type the @command{centos-art} command in your terminal, the
076f77
operating system trys to execute that command. In order to execute the
076f77
command, the operating system needs to know where it is, so the
076f77
operating system uses the @var{PATH} environment variable to look for
076f77
that command location. If your system was prepared to use CentOS
076f77
Artwork Repository correctly (@pxref{trunk Scripts Bash Functions
076f77
Verify}), you should have a symbolic link inside @file{~/bin/}
076f77
directory that points to the @file{centos-art.sh} script file. As
076f77
@file{~/bin/} directory is, by default, inside @var{PATH} environment
076f77
variable, the execution of @command{centos-art} command runs the
076f77
@file{centos-art.sh} script.
076f77
076f77
When @file{centos-art.sh} script is executed, the first it does is
076f77
executing the @file{trunk/Scripts/Bash/initEnvironment.sh} script to
076f77
initialize global variables (e.g., @command{gettext} variables) and
076f77
global function scripts.  Global function scripts are located inside
076f77
@file{trunk/Scripts/Bash/Functions} directory and their file names
076f77
begin with @samp{cli}. Global function scripts provide common
076f77
functionalities that can be used anywhere inside @file{centos-art.sh}
076f77
script execution environment.
076f77
076f77
Once global variables and function scripts have been loaded,
076f77
@file{centos-art.sh} script executes the @command{cli} global function
076f77
from @file{cli.sh} function script to retrive command-line arguments
076f77
and define some default values that may be used later by specific
076f77
function scripts (@pxref{trunk Scripts Bash Functions}).
076f77
076f77
As convenction, the @file{centos-art.sh} command-line arguments have
076f77
the following format:
076f77
076f77
@verbatim
076f77
centos-art arg1 --arg2=val2 --arg3=val3
076f77
@end verbatim
076f77
076f77
In the above example, @samp{centos-art} is the command you use to
076f77
invoke @file{centos-art.sh} script. The @samp{arg1} is required and
076f77
represents the functionality you want to perform (e.g.,
076f77
@option{verify}, @option{render}, @option{locale}, @option{manual},
076f77
etc.). The remaining arguments are modifiers to @option{arg1}. The
076f77
@option{--arg2} definition is required and represets, specifically,
076f77
the action inside the functionality you want to perform.  The
076f77
@option{--arg3} and on, are optional.
076f77
076f77
Once command-line arguments have been retrived, the
076f77
@file{centos-art.sh} script loads specific functionalities using the
076f77
@file{cli_getFunctions.sh} function script. Only one specific
076f77
functionality can be loaded at one script execution I.e., you run
076f77
@command{centos-art.sh} script to run just one functionality.
076f77
076f77
@float Figure,fig:trunk/Scripts/Bash:Initialization
076f77
@verbatim
076f77
+----------------------------------------------------------------------+
076f77
| [centos@host]$ centos-art function --action='value' --option='value' |
076f77
+----------------------------------------------------------------------+
076f77
| ~/bin/centos-art --> ~/artwork/trunk/Scripts/Bash/centos-art.sh      |
076f77
+---v-----------------------------------------v------------------------+
076f77
    | centos-art.sh                           |
076f77
    +---v---------------------------------v---+
076f77
    .   | initEnvironment.sh              |   .
076f77
    .   +---------------------------------+   .
076f77
    .   | cli $@                          |   .
076f77
    .   +---v-------------------------v---+   .
076f77
    .   .   | cli_getFunctions        |   .   .
076f77
    .   .   +---v-----------------v---+   .   .
076f77
    .   .   .   | function1       |   .   .   .
076f77
    .   .   .   | function2       |   .   .   .
076f77
    .   .   .   | function3       |   .   .   .
076f77
    .   .   .   +-----------------+   .   .   .
076f77
    .   .   ...........................   .   .
076f77
    .   ...................................   .
076f77
    ...........................................
076f77
@end verbatim
076f77
@caption{The functionalities initialization environment.}
076f77
@end float
076f77
076f77
Functionalities are implemented by means of actions.  Once the
076f77
functionality has been initiazalized, actions initialization take
076f77
place for that functionality. Actions initialization model is very
076f77
similar to functions initialization model. But with the difference,
076f77
that actions are loaded inside function environment, and so, share
076f77
variables and functions defined inside function environment.
076f77
076f77
@float Figure,fig:trunk/Scripts/Bash/Functions:Initialization
076f77
@verbatim
076f77
+--------------------------------------+
076f77
| cli_getFunctions                     |
076f77
+---v------------------------------v---+
076f77
.   | function1                    |   .
076f77
.   +---v----------------------v---+   .
076f77
.   .   | function1_getActions |   .   .
076f77
.   .   +---v--------------v---+   .   .
076f77
.   .   .   | action 1     |   .   .   .
076f77
.   .   .   | action 2     |   .   .   .
076f77
.   .   .   | action n     |   .   .   .
076f77
.   .   .   +--------------+   .   .   .
076f77
.   .   ........................   .   .
076f77
.   ................................   .
076f77
.   +------------------------------+   .
076f77
.   | function2                    |   .
076f77
.   +---v----------------------v---+   .
076f77
.   .   | function2_getActions |   .   .
076f77
.   .   +---v--------------v---+   .   .
076f77
.   .   .   | action 1     |   .   .   .
076f77
.   .   .   | action 2     |   .   .   .
076f77
.   .   .   | action n     |   .   .   .
076f77
.   .   .   +--------------+   .   .   .
076f77
.   .   ........................   .   .
076f77
.   ................................   .
076f77
.   +------------------------------+   .
076f77
.   | function3                    |   .
076f77
.   +---v----------------------v---+   .
076f77
.   .   | function3_getActions |   .   .
076f77
.   .   +---v--------------v---+   .   .
076f77
.   .   .   | action 1     |   .   .   .
076f77
.   .   .   | action 2     |   .   .   .
076f77
.   .   .   | action n     |   .   .   .
076f77
.   .   .   +--------------+   .   .   .
076f77
.   .   ........................   .   .
076f77
.   ................................   .
076f77
........................................
076f77
@end verbatim
076f77
@caption{The actions initialization environment.}
076f77
@end float
076f77
076f77
@subsection Usage
076f77
076f77
The @file{centos-art.sh} script usage information is described inside
076f77
each specific function documentation (@pxref{trunk Scripts Bash
076f77
Functions}).
076f77
076f77
@subsection See also
076f77
076f77
@menu
076f77
* trunk Scripts::
076f77
* trunk Scripts Bash Functions::
076f77
* trunk Scripts Bash Locale::
076f77
@end menu