Blame Manuals/Repository/repository-html/repository_50.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
-->
bf28e1
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>
c12cdc
<title>CentOS Artwork Repository: 3.47 trunk/Scripts/Bash</title>
4c79b5
c12cdc
<meta name="description" content="CentOS Artwork Repository: 3.47 trunk/Scripts/Bash">
c12cdc
<meta name="keywords" content="CentOS Artwork Repository: 3.47 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
d11e55
[ < ]
d11e55
[ > ]
4c79b5
   
4c79b5
[ << ]
4c79b5
[ Up ]
c12cdc
[ >> ]
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
[Top]
4c79b5
[Contents]
c12cdc
[Index]
4c79b5
[ ? ]
4c79b5
c12cdc
d11e55
c12cdc

3.47 trunk/Scripts/Bash

4c79b5
4c79b5
d11e55
ec5f63

3.47.1 Goals

4c79b5
c12cdc

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

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

eae802
d11e55
ec5f63

3.47.2 Description

6414c4
c12cdc

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

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

c12cdc

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

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

c12cdc

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

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

c12cdc

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

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

c12cdc

Once global variables and function scripts have been loaded,

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

c12cdc

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

c12cdc
the following format:
c12cdc

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

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

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

c12cdc

Once command-line arguments have been retrived, the

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

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

Figure 3.1: The functionalities initialization environment.

c12cdc
c12cdc

c12cdc

Functionalities are implemented by means of actions. Once the

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

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

Figure 3.2: The actions initialization environment.

c12cdc
c12cdc

54b5a5
d11e55
2c8180

3.47.3 Usage

6aec21
c12cdc

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

c12cdc
each specific function documentation (see section trunk/Scripts/Bash/Functions).
c12cdc

6aec21
d11e55
4c79b5

3.47.4 See also

4c79b5
c12cdc
c12cdc
3.46 trunk/Scripts  
c12cdc
c12cdc
3.48 trunk/Scripts/Bash/Functions  
c12cdc
c12cdc
3.58 trunk/Scripts/Bash/Locale  
c12cdc
c12cdc
4c79b5
4c79b5
4c79b5
d11e55
[ < ]
d11e55
[ > ]
4c79b5
   
4c79b5
[ << ]
d11e55
[ Up ]
c12cdc
[ >> ]
4c79b5
4c79b5

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

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