Blame Manuals/Repository/repository-html/repository_52.html

4c79b5
4c79b5
<html>
ccb7a3
4c79b5
4c79b5
Permission is granted to copy, distribute and/or modify this document
4c79b5
under the terms of the GNU Free Documentation License, Version 1.2 or
4c79b5
any later version published by the Free Software Foundation; with no
4c79b5
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
4c79b5
copy of the license is included in the section entitled GNU Free
4c79b5
Documentation License.  
4c79b5
-->
acd47b
4c79b5
4c79b5
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
4c79b5
            Karl Berry  <karl@freefriends.org>
4c79b5
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
4c79b5
            and many others.
4c79b5
Maintained by: Many creative people <dev@texi2html.cvshome.org>
4c79b5
Send bugs and suggestions to <users@texi2html.cvshome.org>
4c79b5
4c79b5
-->
4c79b5
<head>
fa7cae
<title>CentOS Artwork Repository: 3.49 trunk/Scripts/Bash</title>
4c79b5
fa7cae
<meta name="description" content="CentOS Artwork Repository: 3.49 trunk/Scripts/Bash">
fa7cae
<meta name="keywords" content="CentOS Artwork Repository: 3.49 trunk/Scripts/Bash">
4c79b5
<meta name="resource-type" content="document">
4c79b5
<meta name="distribution" content="global">
4c79b5
<meta name="Generator" content="texi2html 1.76">
4c79b5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4c79b5
<style type="text/css">
4c79b5
1e9202
@import "/home/centos/artwork/trunk/Identity/Models/Css/Texi2html/common.css";
4c79b5
4c79b5
a.summary-letter {text-decoration: none}
4c79b5
pre.display {font-family: serif}
4c79b5
pre.format {font-family: serif}
4c79b5
pre.menu-comment {font-family: serif}
4c79b5
pre.menu-preformatted {font-family: serif}
4c79b5
pre.smalldisplay {font-family: serif; font-size: smaller}
4c79b5
pre.smallexample {font-size: smaller}
4c79b5
pre.smallformat {font-family: serif; font-size: smaller}
4c79b5
pre.smalllisp {font-size: smaller}
4c79b5
span.sansserif {font-family:sans-serif; font-weight:normal;}
4c79b5
ul.toc {list-style: none}
4c79b5
-->
4c79b5
</style>
4c79b5
4c79b5
4c79b5
</head>
4c79b5
4c79b5
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
4c79b5
4c79b5
2dc146
[ < ]
2dc146
[ > ]
4c79b5
   
4c79b5
[ << ]
4c79b5
[ Up ]
fa7cae
[ >> ]
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
[Top]
4c79b5
[Contents]
fa7cae
[Index]
4c79b5
[ ? ]
4c79b5
fa7cae
2dc146
fa7cae

3.49 trunk/Scripts/Bash

2dc146
2dc146
2dc146
2dc146

3.49.1 Goals

2dc146
fa7cae

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

fa7cae
development line of <tt>`centos-art.sh'</tt> automation script.  The
fa7cae
<tt>`centos-art.sh'</tt> script standardizes frequent tasks inside your
fa7cae
working copy of CentOS Artwork Repository.
2dc146

2dc146
2dc146
2dc146

3.49.2 Description

2dc146
fa7cae

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

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

fa7cae

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

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

fa7cae

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

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

fa7cae

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

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

fa7cae

Once global variables and function scripts have been loaded,

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

fa7cae

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

fa7cae
the following format:
fa7cae

fa7cae
centos-art arg1 --arg2=val2 --arg3=val3
fa7cae
fa7cae

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

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

fa7cae

Once command-line arguments have been retrived, the

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

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

Figure 3.1: The functionalities initialization environment.

fa7cae
2dc146

fa7cae

Functionalities are implemented by means of actions. Once the

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

fa7cae
fa7cae
+--------------------------------------+
fa7cae
| cli_getFunctions                     |
fa7cae
+---v------------------------------v---+
fa7cae
.   | function1                    |   .
fa7cae
.   +---v----------------------v---+   .
fa7cae
.   .   | function1_getActions |   .   .
fa7cae
.   .   +---v--------------v---+   .   .
fa7cae
.   .   .   | action 1     |   .   .   .
fa7cae
.   .   .   | action 2     |   .   .   .
fa7cae
.   .   .   | action n     |   .   .   .
fa7cae
.   .   .   +--------------+   .   .   .
fa7cae
.   .   ........................   .   .
fa7cae
.   ................................   .
fa7cae
.   +------------------------------+   .
fa7cae
.   | function2                    |   .
fa7cae
.   +---v----------------------v---+   .
fa7cae
.   .   | function2_getActions |   .   .
fa7cae
.   .   +---v--------------v---+   .   .
fa7cae
.   .   .   | action 1     |   .   .   .
fa7cae
.   .   .   | action 2     |   .   .   .
fa7cae
.   .   .   | action n     |   .   .   .
fa7cae
.   .   .   +--------------+   .   .   .
fa7cae
.   .   ........................   .   .
fa7cae
.   ................................   .
fa7cae
.   +------------------------------+   .
fa7cae
.   | function3                    |   .
fa7cae
.   +---v----------------------v---+   .
fa7cae
.   .   | function3_getActions |   .   .
fa7cae
.   .   +---v--------------v---+   .   .
fa7cae
.   .   .   | action 1     |   .   .   .
fa7cae
.   .   .   | action 2     |   .   .   .
fa7cae
.   .   .   | action n     |   .   .   .
fa7cae
.   .   .   +--------------+   .   .   .
fa7cae
.   .   ........................   .   .
fa7cae
.   ................................   .
fa7cae
........................................
fa7cae
fa7cae

Figure 3.2: The actions initialization environment.

fa7cae
2dc146

2dc146
4a9d2a
2dc146

3.49.3 Usage

008ee0
fa7cae

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

fa7cae
each specific function documentation (see section trunk/Scripts/Bash/Functions).
2dc146

2dc146
fa7cae
4c79b5

3.49.4 See also

4c79b5
2dc146
fa7cae
3.48 trunk/Scripts  
fa7cae
fa7cae
3.50 trunk/Scripts/Bash/Functions  
2dc146
fa7cae
3.60 trunk/Scripts/Bash/Locale  
2dc146
2dc146
4c79b5
4c79b5
4c79b5
fa7cae
[ < ]
fa7cae
[ > ]
4c79b5
   
4c79b5
[ << ]
2dc146
[ Up ]
fa7cae
[ >> ]
4c79b5
4c79b5

4c79b5
 <font size="-1">
acd47b
  This document was generated on February, 26 2011 using texi2html 1.76.
4c79b5
 </font>
4c79b5
 
4c79b5
4c79b5

4c79b5
</body>
4c79b5
</html>