Blame Manuals/Repository/en/Html/repository_39.html

4c79b5
4c79b5
<html>
6414c4
09d4f2
6414c4
Copyright C 2009, 2010, 2011  Alain Reguera Delgado
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
-->
139290
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>
ec5f63
<title>The CentOS Artwork Repository: 3.36 trunk/Scripts/Bash</title>
4c79b5
ec5f63
<meta name="description" content="The CentOS Artwork Repository: 3.36 trunk/Scripts/Bash">
ec5f63
<meta name="keywords" content="The CentOS Artwork Repository: 3.36 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
5cee2c
[ < ]
5cee2c
[ > ]
4c79b5
   
4c79b5
[ << ]
4c79b5
[ Up ]
13b177
[ >> ]
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
[Top]
4c79b5
[Contents]
13b177
[Index]
4c79b5
[ ? ]
4c79b5
ec5f63
5cee2c
ec5f63

3.36 trunk/Scripts/Bash

4c79b5
5fb024
5cee2c
5fb024

3.36.1 Goals

5fb024
ec5f63

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

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

5fb024
5cee2c
5fb024

3.36.2 Description

5fb024
ec5f63

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

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

ec5f63

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

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

ec5f63

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

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

ec5f63

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

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

ec5f63

Once global variables and function scripts have been loaded,

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

ec5f63

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

ec5f63
the following format:
ec5f63

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

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

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

ec5f63

Once command-line arguments have been retrived, the

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

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

Figure 3.12: The functionalities initialization environment.

ec5f63
ec5f63

ec5f63

Functionalities are implemented by means of actions. Once the

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

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

Figure 3.13: The actions initialization environment.

ec5f63
ec5f63

54b5a5
5cee2c
63f275

3.36.3 Usage

54b5a5
ec5f63

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

5cee2c
each specific function documentation (see section trunk/Scripts/Bash/Functions).
ec5f63

5fb024
5cee2c
5fb024

3.36.4 See also

5fb024
ec5f63
5cee2c
3.35 trunk/Scripts  
ec5f63
5cee2c
3.37 trunk/Scripts/Bash/Functions  
ec5f63
13b177
3.47 trunk/Scripts/Bash/Locale  
ec5f63
ec5f63
4c79b5
4c79b5
4c79b5
5cee2c
[ < ]
5cee2c
[ > ]
4c79b5
   
4c79b5
[ << ]
5cee2c
[ Up ]
13b177
[ >> ]
4c79b5
4c79b5

4c79b5
 <font size="-1">
139290
  This document was generated on January, 14 2011 using texi2html 1.76.
4c79b5
 </font>
4c79b5
 
4c79b5
4c79b5

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