|
|
4c79b5 |
@subsection Goals
|
|
|
4c79b5 |
|
|
|
efa7b7 |
The @file{trunk/Scripts/Bash} directory exists to organize the trunk
|
|
|
efa7b7 |
development line of @file{centos-art.sh} automation script. The
|
|
|
efa7b7 |
@file{centos-art.sh} script standardizes frequent tasks inside your
|
|
|
efa7b7 |
working copy of CentOS Artwork Repository.
|
|
|
4c79b5 |
|
|
|
4c79b5 |
@subsection Description
|
|
|
4c79b5 |
|
|
|
efa7b7 |
The best way to understand @file{centos-art.sh} automation script is
|
|
|
efa7b7 |
studying its source code. The @file{centos-art.sh} script is splited
|
|
|
efa7b7 |
in several configuration and function files which are loaded when the
|
|
|
efa7b7 |
@file{centos-art.sh} script is executed. This section describes the
|
|
|
efa7b7 |
order in which @file{centos-art.sh} loads its configuration and
|
|
|
efa7b7 |
function files.
|
|
|
4c79b5 |
|
|
|
4c79b5 |
When you type the @command{centos-art} command in your terminal, the
|
|
|
4c79b5 |
operating system trys to execute that command. In order to execute the
|
|
|
4c79b5 |
command, the operating system needs to know where it is, so the
|
|
|
4c79b5 |
operating system uses the @var{PATH} environment variable to look for
|
|
|
4c79b5 |
that command's location. If your system was prepared to use CentOS
|
|
|
efa7b7 |
Artwork Repository correctly (@pxref{trunk Scripts Bash Functions
|
|
|
efa7b7 |
Verify}), you should have a symbolic link inside @file{~/bin/}
|
|
|
efa7b7 |
directory that points to the @file{centos-art.sh} script file. As
|
|
|
efa7b7 |
@file{~/bin/} directory is, by default, inside @var{PATH} environment
|
|
|
efa7b7 |
variable, the execution of @command{centos-art} command runs the
|
|
|
efa7b7 |
@file{centos-art.sh} script.
|
|
|
efa7b7 |
|
|
|
efa7b7 |
When @file{centos-art.sh} script is executed, the first it does is
|
|
|
efa7b7 |
executing the @file{trunk/Scripts/Bash/initFunctions.sh} script to
|
|
|
efa7b7 |
initialize global variables (e.g., @command{gettext}'s variables) and
|
|
|
efa7b7 |
global function scripts. Global function scripts are located inside
|
|
|
efa7b7 |
@file{trunk/Scripts/Bash/Functions} directory and their file names
|
|
|
efa7b7 |
begin with @samp{cli}. Global function scripts provide common
|
|
|
efa7b7 |
functionalities that can be used anywhere inside @file{centos-art.sh}
|
|
|
efa7b7 |
script execution environment.
|
|
|
efa7b7 |
|
|
|
efa7b7 |
Once global variables and function scripts have been loaded,
|
|
|
efa7b7 |
@file{centos-art.sh} script executes the @command{cli} global function
|
|
|
efa7b7 |
from @file{cli.sh} function script to retrive command-line arguments
|
|
|
efa7b7 |
and define some default values that may be used later by specific
|
|
|
efa7b7 |
function scripts (@pxref{trunk Scripts Bash Functions}).
|
|
|
efa7b7 |
|
|
|
efa7b7 |
As convenction, the @file{centos-art.sh} command-line arguments have
|
|
|
efa7b7 |
the following format:
|
|
|
efa7b7 |
|
|
|
efa7b7 |
@verbatim
|
|
|
efa7b7 |
centos-art arg1 --arg2=val2 --arg3=val3
|
|
|
efa7b7 |
@end verbatim
|
|
|
efa7b7 |
|
|
|
efa7b7 |
In the above example, @samp{centos-art} is the command you use to
|
|
|
efa7b7 |
invoke @file{centos-art.sh} script. The @samp{arg1} represents the
|
|
|
efa7b7 |
action you want to do (e.g., @option{verify}, @option{render},
|
|
|
efa7b7 |
@option{locale}, @option{help}, etc.). The remaining arguments are
|
|
|
efa7b7 |
modifiers to @option{arg1}. The @option{--arg2} definition is
|
|
|
efa7b7 |
required. The @option{--arg3} is optional. For example, if you want
|
|
|
efa7b7 |
to render all anaconda progress slides, for all major releases of
|
|
|
efa7b7 |
CentOS distribution, for all languages availabe using TreeFlower motif
|
|
|
efa7b7 |
as background, you use the following command:
|
|
|
efa7b7 |
|
|
|
efa7b7 |
@verbatim
|
|
|
efa7b7 |
centos-art render --entry=trunk/Identity/Themes/Motifs/TreeFlower/Distro/Anaconda/Progress
|
|
|
efa7b7 |
@end verbatim
|
|
|
efa7b7 |
|
|
|
efa7b7 |
Now, if you only want to render anaconda progress
|
|
|
efa7b7 |
@file{01-welcome.png} slide, for CentOS distribution major release 5,
|
|
|
efa7b7 |
in English language, you need to add the third argument as follows:
|
|
|
efa7b7 |
|
|
|
efa7b7 |
@verbatim
|
|
|
efa7b7 |
centos-art render --entry=trunk/Identity/Themes/Motifs/TreeFlower/Distro/Anaconda/Progress --filter=5/en/01-welcome
|
|
|
efa7b7 |
@end verbatim
|
|
|
efa7b7 |
|
|
|
efa7b7 |
Once command-line arguments have been retrived, the
|
|
|
efa7b7 |
@file{centos-art.sh} script loads specific functions using the
|
|
|
efa7b7 |
@file{cli_getActions.sh} function script. For example, if you run the
|
|
|
efa7b7 |
command @command{centos-art render --entry}, the @file{centos-art.sh}
|
|
|
efa7b7 |
script will look for @file{trunk/Scripts/Bash/Functions/Render}
|
|
|
6c4982 |
directory and will load the @command{render} function from
|
|
|
6c4982 |
@file{render.sh} function script; this, in order to achive the
|
|
|
6c4982 |
rendering task as it defines.
|
|
|
4c79b5 |
|
|
|
4c79b5 |
@float Figure,fig:trunk/Scripts/Bash:Initialization
|
|
|
4c79b5 |
@verbatim
|
|
|
4c79b5 |
+------------------------------------------------------------------+
|
|
|
4c79b5 |
| [centos@host]$ centos-art action 'path/to/dir' --option='value' |
|
|
|
4c79b5 |
+------------------------------------------------------------------+
|
|
|
4c79b5 |
| ~/bin/centos-art --> ~/artwork/trunk/Scripts/Bash/centos-art.sh |
|
|
|
4c79b5 |
+---v-----------------------------------------v--------------------+
|
|
|
4c79b5 |
| centos-art.sh |
|
|
|
4c79b5 |
+---v---------------------------------v---+
|
|
|
4c79b5 |
. | initFunctions.sh | .
|
|
|
4c79b5 |
. +---------------------------------+ .
|
|
|
efa7b7 |
. | cli $@ | .
|
|
|
4c79b5 |
. +---v-------------------------v---+ .
|
|
|
4c79b5 |
. . | cli_getActions | . .
|
|
|
4c79b5 |
. . +---v-----------------v---+ . .
|
|
|
4c79b5 |
. . . | function call 1 | . . .
|
|
|
4c79b5 |
. . . | function call 2 | . . .
|
|
|
4c79b5 |
. . . | function call n | . . .
|
|
|
4c79b5 |
. . . +-----------------+ . . .
|
|
|
4c79b5 |
. . ........................... . .
|
|
|
4c79b5 |
. ................................... .
|
|
|
4c79b5 |
...........................................
|
|
|
4c79b5 |
@end verbatim
|
|
|
efa7b7 |
@caption{The @file{centos-art.sh} initialization environment.}
|
|
|
4c79b5 |
@end float
|
|
|
4c79b5 |
|
|
|
4c79b5 |
@subsection Usage
|
|
|
4c79b5 |
|
|
|
efa7b7 |
The @file{centos-art.sh} script usage information is described inside
|
|
|
efa7b7 |
each specific function documentation (@pxref{trunk Scripts Bash
|
|
|
efa7b7 |
Functions}).
|
|
|
4c79b5 |
|
|
|
4c79b5 |
@subsection See also
|
|
|
4c79b5 |
|
|
|
4c79b5 |
@menu
|
|
|
4c79b5 |
* trunk Scripts::
|
|
|
6c4982 |
* trunk Scripts Bash Functions::
|
|
|
efa7b7 |
* trunk Scripts Bash Locale::
|
|
|
4c79b5 |
@end menu
|