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
-->
4a9d2a
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>
4a9d2a
<title>CentOS Artwork Repository: 3.47 trunk/Scripts/Bash</title>
4c79b5
4a9d2a
<meta name="description" content="CentOS Artwork Repository: 3.47 trunk/Scripts/Bash">
4a9d2a
<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
4a9d2a
[ < ]
4a9d2a
[ > ]
4c79b5
   
4c79b5
[ << ]
4c79b5
[ Up ]
4a9d2a
[ >> ]
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
[Top]
4c79b5
[Contents]
4a9d2a
[Index]
4c79b5
[ ? ]
4c79b5
4a9d2a
4a9d2a
4a9d2a

3.47 trunk/Scripts/Bash

4c79b5
4c79b5
4a9d2a
ec5f63

3.47.1 Goals

4c79b5
4a9d2a

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

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

eae802
4a9d2a
ec5f63

3.47.2 Description

6414c4
4a9d2a

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

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

4a9d2a

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

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

4a9d2a

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

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

4a9d2a

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

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

4a9d2a

Once global variables and function scripts have been loaded,

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

4a9d2a

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

4a9d2a
the following format:
4a9d2a

4a9d2a
centos-art arg1 --arg2=val2 --arg3=val3
4a9d2a
4a9d2a

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

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

4a9d2a

Once command-line arguments have been retrived, the

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

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

Figure 3.1: The functionalities initialization environment.

4a9d2a
4a9d2a

4a9d2a

Functionalities are implemented by means of actions. Once the

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

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

Figure 3.2: The actions initialization environment.

4a9d2a
6414c4

54b5a5
4a9d2a
2c8180

3.47.3 Usage

6aec21
4a9d2a

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

4a9d2a
each specific function documentation (see section trunk/Scripts/Bash/Functions).
035049

6aec21
4a9d2a
4c79b5

3.47.4 See also

4c79b5
035049
4a9d2a
3.46 trunk/Scripts  
4a9d2a
4a9d2a
3.48 trunk/Scripts/Bash/Functions  
c6292c
4a9d2a
3.58 trunk/Scripts/Bash/Locale  
749e81
035049
4c79b5
4c79b5
4c79b5
4a9d2a
[ < ]
4a9d2a
[ > ]
4c79b5
   
4c79b5
[ << ]
4a9d2a
[ Up ]
4a9d2a
[ >> ]
4c79b5
4c79b5

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

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