Blame Manuals/Repository/repository-html/repository_51.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>
2b5e61
<title>CentOS Artwork Repository: 3.48 trunk/Scripts/Bash</title>
4c79b5
2b5e61
<meta name="description" content="CentOS Artwork Repository: 3.48 trunk/Scripts/Bash">
2b5e61
<meta name="keywords" content="CentOS Artwork Repository: 3.48 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 ]
2b5e61
[ >> ]
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
[Top]
4c79b5
[Contents]
2b5e61
[Index]
4c79b5
[ ? ]
4c79b5
2b5e61
4a9d2a
2b5e61

3.48 trunk/Scripts/Bash

008ee0
54b5a5
4a9d2a
63f275

3.48.1 Goals

54b5a5
2b5e61

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

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

4a9d2a
4a9d2a
4a9d2a

3.48.2 Description

4a9d2a
2b5e61

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

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

2b5e61

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

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

2b5e61

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

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

2b5e61

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

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

2b5e61

Once global variables and function scripts have been loaded,

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

2b5e61

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

2b5e61
the following format:
2b5e61

2b5e61
centos-art arg1 --arg2=val2 --arg3=val3
2b5e61
2b5e61

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

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

2b5e61

Once command-line arguments have been retrived, the

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

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

Figure 3.1: The functionalities initialization environment.

2b5e61
2b5e61

2b5e61

Functionalities are implemented by means of actions. Once the

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

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

Figure 3.2: The actions initialization environment.

2b5e61
2b5e61

4a9d2a
4a9d2a
4a9d2a

3.48.3 Usage

4a9d2a
2b5e61

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

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

4a9d2a
2dc146
4c79b5

3.48.4 See also

4c79b5
2b5e61
2b5e61
3.47 trunk/Scripts  
2b5e61
2b5e61
3.49 trunk/Scripts/Bash/Functions  
2b5e61
2b5e61
3.59 trunk/Scripts/Bash/Locale  
2b5e61
2b5e61
4c79b5
4c79b5
4c79b5
2dc146
[ < ]
2dc146
[ > ]
4c79b5
   
4c79b5
[ << ]
4a9d2a
[ Up ]
2b5e61
[ >> ]
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>