Blame Identity/Manual/repository-xhtml/repository_69.xhtml

c8f7b7
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">
34051a
<head>
34051a
a6f1b3
    <title>CentOS Artwork Repository: 2.62 The trunk/Scripts Directory</title>
c8f7b7
c8f7b7
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
a6f1b3
    <meta name="description" content="CentOS Artwork Repository: 2.62 The trunk/Scripts Directory" />
a6f1b3
    <meta name="keywords" content="CentOS Artwork Repository: 2.62 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" />
34051a
c8f7b7
    <link href="/home/centos/artwork/trunk/Identity/Manual/repository.css" rel="stylesheet" type="text/css" media="screen projection" />
34051a
34051a
</head>
34051a
728c6d
<body>
34051a
728c6d
728c6d
728c6d
728c6d
728c6d
    
728c6d
728c6d
        
c8f7b7
a6f1b3
34051a
c8f7b7
[ < ]
ed9de5
[ > ]
34051a
   
c8f7b7
[ << ]
c8f7b7
[ Up ]
a6f1b3
[ >> ]
34051a
   
34051a
   
34051a
   
34051a
   
c8f7b7
[Top]
c8f7b7
[Contents]
a6f1b3
[Index]
c8f7b7
[ ? ]
34051a
a6f1b3
ed9de5
a6f1b3

2.62 The <tt>`trunk/Scripts'</tt> Directory

632e8b
728c6d

ed9de5
52772c

2.62.1 Goals

632e8b
a6f1b3

The <tt>`trunk/Scripts'</tt> directory exists to organize the trunk

a6f1b3
development line of <tt>`centos-art.sh'</tt> automation script.  The
a6f1b3
<tt>`centos-art.sh'</tt> script standardizes tasks you need to do
a6f1b3
frequently inside CentOS Artwork Repository.
a6f1b3

728c6d

ed9de5
52772c

2.62.2 Description

632e8b
a6f1b3

The best way to understand <tt>`centos-art.sh'</tt> automation script is

a6f1b3
studying its source code.  However, as start point, you may prefer to
a6f1b3
read an introductory resume before diving into the source code
a6f1b3
details.
a6f1b3

a6f1b3

The <tt>`centos-art.sh'</tt> script is written in Bash. Most tasks, inside

a6f1b3
<tt>`centos-art.sh'</tt> script, have been organized in many specific
a6f1b3
functionalities that you can invoke from the centos-art
a6f1b3
command-line interface.
a6f1b3

a6f1b3

When you type the centos-art command in your terminal, the

a6f1b3
operating system trys to execute that command. In order to execute the
a6f1b3
command, the operating system needs to know where it is, so the
a6f1b3
operating system uses the PATH environment variable to look for
a6f1b3
that command location. If your system was prepared to use CentOS
a6f1b3
Artwork Repository correctly (-- Removed(pxref:trunk Scripts Bash Functions
a6f1b3
Verify) --), you should have a symbolic link inside <tt>`~/bin/'</tt>
a6f1b3
directory that points to the <tt>`centos-art.sh'</tt> script file. As
a6f1b3
<tt>`~/bin/'</tt> directory is, by default, inside PATH environment
a6f1b3
variable, the execution of centos-art command runs the
a6f1b3
<tt>`centos-art.sh'</tt> script.
a6f1b3

a6f1b3

When <tt>`centos-art.sh'</tt> script is executed, the first it does is

a6f1b3
executing the <tt>`trunk/Scripts/Bash/initEnvironment.sh'</tt> script to
a6f1b3
initialize global variables (e.g., gettext variables) and
a6f1b3
global function scripts.  Global function scripts are located inside
a6f1b3
<tt>`trunk/Scripts/Bash/Functions'</tt> directory and their file names
a6f1b3
begin with <samp>`cli'</samp>. Global function scripts provide common
a6f1b3
functionalities that can be used anywhere inside <tt>`centos-art.sh'</tt>
a6f1b3
script execution environment.
a6f1b3

a6f1b3

Once global variables and function scripts have been loaded,

a6f1b3
<tt>`centos-art.sh'</tt> script executes the cli global function
a6f1b3
from <tt>`cli.sh'</tt> function script to retrive command-line arguments
a6f1b3
and define some default values that may be used later by specific
a6f1b3
function scripts (-- Removed(pxref:trunk Scripts Bash Functions) --).
a6f1b3

a6f1b3

As convenction, the <tt>`centos-art.sh'</tt> command-line arguments have

a6f1b3
the following format:
a6f1b3

a6f1b3
centos-art function path/to/dir --options
a6f1b3
a6f1b3

In the above example, <samp>`centos-art'</samp> is the command you use to

a6f1b3
invoke <tt>`centos-art.sh'</tt> script. The <samp>`arg1'</samp> is required and
a6f1b3
represents the functionality you want to perform (e.g.,
a6f1b3
<samp>`verify'</samp>, <samp>`render'</samp>, <samp>`locale'</samp>, <samp>`manual'</samp>,
a6f1b3
etc.). The remaining arguments are modifiers to <samp>`arg1'</samp>. The
a6f1b3
<samp>`--arg2'</samp> definition is required and represets, specifically,
a6f1b3
the action inside the functionality you want to perform.  The
a6f1b3
<samp>`--arg3'</samp> and on, are optional.
a6f1b3

a6f1b3

Once command-line arguments have been retrived, the

a6f1b3
<tt>`centos-art.sh'</tt> script loads specific functionalities using the
a6f1b3
<tt>`cli_getFunctions.sh'</tt> function script. Only one specific
a6f1b3
functionality can be loaded at one script execution I.e., you run
a6f1b3
centos-art.sh script to run just one functionality.
a6f1b3

a6f1b3
a6f1b3
+----------------------------------------------------------------------+
a6f1b3
| [centos@host]$ centos-art function --action='value' --option='value' |
a6f1b3
+----------------------------------------------------------------------+
a6f1b3
| ~/bin/centos-art --> ~/artwork/trunk/Scripts/centos-art.sh           |
a6f1b3
+---v-----------------------------------------v------------------------+
a6f1b3
    | centos-art.sh                           |
a6f1b3
    +---v---------------------------------v---+
a6f1b3
    .   | initEnvironment.sh              |   .
a6f1b3
    .   +---------------------------------+   .
a6f1b3
    .   | cli $@                          |   .
a6f1b3
    .   +---v-------------------------v---+   .
a6f1b3
    .   .   | cli_getFunctions        |   .   .
a6f1b3
    .   .   +---v-----------------v---+   .   .
a6f1b3
    .   .   .   | function1       |   .   .   .
a6f1b3
    .   .   .   | function2       |   .   .   .
a6f1b3
    .   .   .   | function3       |   .   .   .
a6f1b3
    .   .   .   +-----------------+   .   .   .
a6f1b3
    .   .   ...........................   .   .
a6f1b3
    .   ...................................   .
a6f1b3
    ...........................................
a6f1b3
a6f1b3

Figure 2.1: The functionalities initialization environment.

a6f1b3
a6f1b3

a6f1b3

Functionalities are implemented by means of actions. Once the

a6f1b3
functionality has been initiazalized, actions initialization take
a6f1b3
place for that functionality. Actions initialization model is very
a6f1b3
similar to functions initialization model. But with the difference,
a6f1b3
that actions are loaded inside function environment, and so, share
a6f1b3
variables and functions defined inside function environment.
a6f1b3

a6f1b3
a6f1b3
+--------------------------------------+
a6f1b3
| cli_getFunctions                     |
a6f1b3
+---v------------------------------v---+
a6f1b3
.   | function1                    |   .
a6f1b3
.   +---v------------------------v-+   .
a6f1b3
.   .   | function1_getArguments | .   .
a6f1b3
.   .   +---v--------------v-----+ .   .
a6f1b3
.   .   .   | action 1     |     . .   .
a6f1b3
.   .   .   | action 2     |     . .   .
a6f1b3
.   .   .   | action n     |     . .   .
a6f1b3
.   .   .   +--------------+     . .   .
a6f1b3
.   .   .......................... .   .
a6f1b3
.   ................................   .
a6f1b3
.   +------------------------------+   .
a6f1b3
.   | function2                    |   .
a6f1b3
.   +---v------------------------v-+   .
a6f1b3
.   .   | function2_getArguments | .   .
a6f1b3
.   .   +---v--------------v-----+ .   .
a6f1b3
.   .   .   | action 1     |     . .   .
a6f1b3
.   .   .   | action 2     |     . .   .
a6f1b3
.   .   .   | action n     |     . .   .
a6f1b3
.   .   .   +--------------+     . .   .
a6f1b3
.   .   .......................... .   .
a6f1b3
.   ................................   .
a6f1b3
.   +------------------------------+   .
a6f1b3
.   | function3                    |   .
a6f1b3
.   +---v------------------------v-+   .
a6f1b3
.   .   | function3_getArguments | .   .
a6f1b3
.   .   +---v--------------v-----+ .   .
a6f1b3
.   .   .   | action 1     |     . .   .
a6f1b3
.   .   .   | action 2     |     . .   .
a6f1b3
.   .   .   | action n     |     . .   .
a6f1b3
.   .   .   +--------------+     . .   .
a6f1b3
.   .   .......................... .   .
a6f1b3
.   ................................   .
a6f1b3
........................................
a6f1b3
a6f1b3

Figure 2.2: The actions initialization environment.

a6f1b3
a6f1b3

728c6d

ed9de5
52772c

2.62.3 Usage

34051a
a6f1b3

The <tt>`centos-art.sh'</tt> script usage information is described inside

a6f1b3
each specific function documentation (-- Removed(pxref:trunk Scripts Bash
a6f1b3
Functions) --).
a6f1b3

728c6d

ed9de5
52772c

2.62.4 See also

632e8b
a6f1b3
a6f1b3
2.62 The <tt>`trunk/Scripts'</tt> Directory  
a6f1b3
a6f1b3
a6f1b3
632e8b
728c6d

34051a
ed9de5
[ < ]
c8f7b7
[ > ]
34051a
   
c8f7b7
[ << ]
ed9de5
[ Up ]
a6f1b3
[ >> ]
34051a
34051a
728c6d
            

728c6d
728c6d
        
728c6d
728c6d
    
728c6d
728c6d
    

728c6d
728c6d
728c6d
34051a
</body>
728c6d
34051a
</html>