|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
|
728c6d |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
728c6d |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
|
728c6d |
|
|
|
010b2d |
<head>
|
|
|
ed9de5 |
<title>CentOS Artwork Repository: 2.60 The trunk/Scripts Directory</title>
|
|
|
010b2d |
|
|
|
728c6d |
<meta name="description" content="CentOS Artwork Repository: 2.60 The trunk/Scripts Directory" />
|
|
|
728c6d |
<meta name="keywords" content="CentOS Artwork Repository: 2.60 The trunk/Scripts Directory" />
|
|
|
728c6d |
<meta name="resource-type" content="document" />
|
|
|
728c6d |
<meta name="distribution" content="global" />
|
|
|
728c6d |
<meta name="generator" content="texi2html 1.76" />
|
|
|
728c6d |
<meta name="copyright" content="2009-2011 Alain Reguera Delgado" />
|
|
|
010b2d |
|
|
|
728c6d |
<link href="/home/centos/artwork/trunk/Identity/Manual/repository.css" rel="stylesheet" type="text/css" media="screen projection"/>
|
|
|
010b2d |
|
|
|
010b2d |
</head>
|
|
|
010b2d |
|
|
|
728c6d |
<body>
|
|
|
010b2d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
Start page body definitions.
|
|
|
728c6d |
-->
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
010b2d |
|
|
|
1075b9 |
[ < ]
|
|
|
52772c |
[ > ]
|
|
|
010b2d |
|
|
|
1075b9 |
[ << ]
|
|
|
1075b9 |
[ Up ]
|
|
|
ed9de5 |
[ >> ]
|
|
|
010b2d |
|
|
|
010b2d |
|
|
|
010b2d |
|
|
|
010b2d |
|
|
|
1075b9 |
[Top]
|
|
|
1075b9 |
[Contents]
|
|
|
ed9de5 |
[Index]
|
|
|
1075b9 |
[ ? ]
|
|
|
010b2d |
|
|
|
ed9de5 |
|
|
|
52772c |
|
|
|
ed9de5 |
2.60 The <tt>`trunk/Scripts'</tt> Directory
|
|
|
52772c |
|
|
|
728c6d |
|
|
|
52772c |
|
|
|
52772c |
2.60.1 Goals
|
|
|
52772c |
|
|
|
ed9de5 |
The <tt>`trunk/Scripts'</tt> directory exists to organize the trunk
|
|
|
ed9de5 |
development line of <tt>`centos-art.sh'</tt> automation script. The
|
|
|
ed9de5 |
<tt>`centos-art.sh'</tt> script standardizes tasks you need to do
|
|
|
ed9de5 |
frequently inside CentOS Artwork Repository.
|
|
|
ed9de5 |
|
|
|
728c6d |
|
|
|
52772c |
|
|
|
52772c |
2.60.2 Description
|
|
|
52772c |
|
|
|
ed9de5 |
The best way to understand <tt>`centos-art.sh'</tt> automation script is
|
|
|
ed9de5 |
studying its source code. However, as start point, you may prefer to
|
|
|
ed9de5 |
read an introductory resume before diving into the source code
|
|
|
ed9de5 |
details.
|
|
|
ed9de5 |
|
|
|
ed9de5 |
The <tt>`centos-art.sh'</tt> script is written in Bash. Most tasks, inside
|
|
|
ed9de5 |
<tt>`centos-art.sh'</tt> script, have been organized in many specific
|
|
|
ed9de5 |
functionalities that you can invoke from the centos-art
|
|
|
ed9de5 |
command-line interface.
|
|
|
ed9de5 |
|
|
|
ed9de5 |
When you type the centos-art command in your terminal, the
|
|
|
ed9de5 |
operating system trys to execute that command. In order to execute the
|
|
|
ed9de5 |
command, the operating system needs to know where it is, so the
|
|
|
ed9de5 |
operating system uses the PATH environment variable to look for
|
|
|
ed9de5 |
that command location. If your system was prepared to use CentOS
|
|
|
ed9de5 |
Artwork Repository correctly (-- Removed(pxref:trunk Scripts Bash Functions
|
|
|
ed9de5 |
Verify) --), you should have a symbolic link inside <tt>`~/bin/'</tt>
|
|
|
ed9de5 |
directory that points to the <tt>`centos-art.sh'</tt> script file. As
|
|
|
ed9de5 |
<tt>`~/bin/'</tt> directory is, by default, inside PATH environment
|
|
|
ed9de5 |
variable, the execution of centos-art command runs the
|
|
|
ed9de5 |
<tt>`centos-art.sh'</tt> script.
|
|
|
ed9de5 |
|
|
|
ed9de5 |
When <tt>`centos-art.sh'</tt> script is executed, the first it does is
|
|
|
ed9de5 |
executing the <tt>`trunk/Scripts/Bash/initEnvironment.sh'</tt> script to
|
|
|
ed9de5 |
initialize global variables (e.g., gettext variables) and
|
|
|
ed9de5 |
global function scripts. Global function scripts are located inside
|
|
|
ed9de5 |
<tt>`trunk/Scripts/Bash/Functions'</tt> directory and their file names
|
|
|
ed9de5 |
begin with <samp>`cli'</samp>. Global function scripts provide common
|
|
|
ed9de5 |
functionalities that can be used anywhere inside <tt>`centos-art.sh'</tt>
|
|
|
ed9de5 |
script execution environment.
|
|
|
ed9de5 |
|
|
|
ed9de5 |
Once global variables and function scripts have been loaded,
|
|
|
ed9de5 |
<tt>`centos-art.sh'</tt> script executes the cli global function
|
|
|
ed9de5 |
from <tt>`cli.sh'</tt> function script to retrive command-line arguments
|
|
|
ed9de5 |
and define some default values that may be used later by specific
|
|
|
ed9de5 |
function scripts (-- Removed(pxref:trunk Scripts Bash Functions) --).
|
|
|
ed9de5 |
|
|
|
ed9de5 |
As convenction, the <tt>`centos-art.sh'</tt> command-line arguments have
|
|
|
ed9de5 |
the following format:
|
|
|
ed9de5 |
|
|
|
ed9de5 |
centos-art function path/to/dir --options
|
|
|
ed9de5 |
|
|
|
ed9de5 |
In the above example, <samp>`centos-art'</samp> is the command you use to
|
|
|
ed9de5 |
invoke <tt>`centos-art.sh'</tt> script. The <samp>`arg1'</samp> is required and
|
|
|
ed9de5 |
represents the functionality you want to perform (e.g.,
|
|
|
ed9de5 |
<samp>`verify'</samp>, <samp>`render'</samp>, <samp>`locale'</samp>, <samp>`manual'</samp>,
|
|
|
ed9de5 |
etc.). The remaining arguments are modifiers to <samp>`arg1'</samp>. The
|
|
|
ed9de5 |
<samp>`--arg2'</samp> definition is required and represets, specifically,
|
|
|
ed9de5 |
the action inside the functionality you want to perform. The
|
|
|
ed9de5 |
<samp>`--arg3'</samp> and on, are optional.
|
|
|
ed9de5 |
|
|
|
ed9de5 |
Once command-line arguments have been retrived, the
|
|
|
ed9de5 |
<tt>`centos-art.sh'</tt> script loads specific functionalities using the
|
|
|
ed9de5 |
<tt>`cli_getFunctions.sh'</tt> function script. Only one specific
|
|
|
ed9de5 |
functionality can be loaded at one script execution I.e., you run
|
|
|
ed9de5 |
centos-art.sh script to run just one functionality.
|
|
|
ed9de5 |
|
|
|
ed9de5 |
|
|
|
ed9de5 |
+----------------------------------------------------------------------+
|
|
|
ed9de5 |
| [centos@host]$ centos-art function --action='value' --option='value' |
|
|
|
ed9de5 |
+----------------------------------------------------------------------+
|
|
|
ed9de5 |
| ~/bin/centos-art --> ~/artwork/trunk/Scripts/centos-art.sh |
|
|
|
ed9de5 |
+---v-----------------------------------------v------------------------+
|
|
|
ed9de5 |
| centos-art.sh |
|
|
|
ed9de5 |
+---v---------------------------------v---+
|
|
|
ed9de5 |
. | initEnvironment.sh | .
|
|
|
ed9de5 |
. +---------------------------------+ .
|
|
|
ed9de5 |
. | cli $@ | .
|
|
|
ed9de5 |
. +---v-------------------------v---+ .
|
|
|
ed9de5 |
. . | cli_getFunctions | . .
|
|
|
ed9de5 |
. . +---v-----------------v---+ . .
|
|
|
ed9de5 |
. . . | function1 | . . .
|
|
|
ed9de5 |
. . . | function2 | . . .
|
|
|
ed9de5 |
. . . | function3 | . . .
|
|
|
ed9de5 |
. . . +-----------------+ . . .
|
|
|
ed9de5 |
. . ........................... . .
|
|
|
ed9de5 |
. ................................... .
|
|
|
ed9de5 |
...........................................
|
|
|
ed9de5 |
|
|
|
ed9de5 |
Figure 2.1: The functionalities initialization environment.
|
|
|
ed9de5 |
|
|
|
ed9de5 |
|
|
|
ed9de5 |
Functionalities are implemented by means of actions. Once the
|
|
|
ed9de5 |
functionality has been initiazalized, actions initialization take
|
|
|
ed9de5 |
place for that functionality. Actions initialization model is very
|
|
|
ed9de5 |
similar to functions initialization model. But with the difference,
|
|
|
ed9de5 |
that actions are loaded inside function environment, and so, share
|
|
|
ed9de5 |
variables and functions defined inside function environment.
|
|
|
ed9de5 |
|
|
|
ed9de5 |
|
|
|
ed9de5 |
+--------------------------------------+
|
|
|
ed9de5 |
| cli_getFunctions |
|
|
|
ed9de5 |
+---v------------------------------v---+
|
|
|
ed9de5 |
. | function1 | .
|
|
|
ed9de5 |
. +---v------------------------v-+ .
|
|
|
ed9de5 |
. . | function1_getArguments | . .
|
|
|
ed9de5 |
. . +---v--------------v-----+ . .
|
|
|
ed9de5 |
. . . | action 1 | . . .
|
|
|
ed9de5 |
. . . | action 2 | . . .
|
|
|
ed9de5 |
. . . | action n | . . .
|
|
|
ed9de5 |
. . . +--------------+ . . .
|
|
|
ed9de5 |
. . .......................... . .
|
|
|
ed9de5 |
. ................................ .
|
|
|
ed9de5 |
. +------------------------------+ .
|
|
|
ed9de5 |
. | function2 | .
|
|
|
ed9de5 |
. +---v------------------------v-+ .
|
|
|
ed9de5 |
. . | function2_getArguments | . .
|
|
|
ed9de5 |
. . +---v--------------v-----+ . .
|
|
|
ed9de5 |
. . . | action 1 | . . .
|
|
|
ed9de5 |
. . . | action 2 | . . .
|
|
|
ed9de5 |
. . . | action n | . . .
|
|
|
ed9de5 |
. . . +--------------+ . . .
|
|
|
ed9de5 |
. . .......................... . .
|
|
|
ed9de5 |
. ................................ .
|
|
|
ed9de5 |
. +------------------------------+ .
|
|
|
ed9de5 |
. | function3 | .
|
|
|
ed9de5 |
. +---v------------------------v-+ .
|
|
|
ed9de5 |
. . | function3_getArguments | . .
|
|
|
ed9de5 |
. . +---v--------------v-----+ . .
|
|
|
ed9de5 |
. . . | action 1 | . . .
|
|
|
ed9de5 |
. . . | action 2 | . . .
|
|
|
ed9de5 |
. . . | action n | . . .
|
|
|
ed9de5 |
. . . +--------------+ . . .
|
|
|
ed9de5 |
. . .......................... . .
|
|
|
ed9de5 |
. ................................ .
|
|
|
ed9de5 |
........................................
|
|
|
ed9de5 |
|
|
|
ed9de5 |
Figure 2.2: The actions initialization environment.
|
|
|
ed9de5 |
|
|
|
ed9de5 |
|
|
|
728c6d |
|
|
|
52772c |
|
|
|
52772c |
2.60.3 Usage
|
|
|
52772c |
|
|
|
ed9de5 |
The <tt>`centos-art.sh'</tt> script usage information is described inside
|
|
|
ed9de5 |
each specific function documentation (-- Removed(pxref:trunk Scripts Bash
|
|
|
ed9de5 |
Functions) --).
|
|
|
ed9de5 |
|
|
|
728c6d |
|
|
|
52772c |
|
|
|
52772c |
2.60.4 See also
|
|
|
9bfd15 |
|
|
|
ed9de5 |
|
|
|
ed9de5 |
2.60 The <tt>`trunk/Scripts'</tt> Directory
|
|
|
ed9de5 |
|
|
|
ed9de5 |
|
|
|
ed9de5 |
|
|
|
063806 |
|
|
|
728c6d |
|
|
|
010b2d |
|
|
|
52772c |
[ < ]
|
|
|
1075b9 |
[ > ]
|
|
|
010b2d |
|
|
|
1075b9 |
[ << ]
|
|
|
52772c |
[ Up ]
|
|
|
ed9de5 |
[ >> ]
|
|
|
010b2d |
|
|
|
010b2d |
|
|
|
728c6d |
|
|
|
728c6d |
The content of left column ends here.
|
|
|
728c6d |
-->
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
Start page footer definitions.
|
|
|
728c6d |
-->
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
728c6d |
|
|
|
010b2d |
</body>
|
|
|
728c6d |
|
|
|
010b2d |
</html>
|