Blame Manual/repository-html/repository_52.html

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

2.50 The <tt>`trunk/Scripts/Bash'</tt> Directory

b9dbd3
b9dbd3
b9dbd3
b9dbd3

2.50.1 Goals

b9dbd3
b9dbd3

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

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

b9dbd3
b9dbd3
b9dbd3

2.50.2 Description

b9dbd3
b9dbd3

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

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

b9dbd3

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

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

b9dbd3

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

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

b9dbd3

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

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

b9dbd3

Once global variables and function scripts have been loaded,

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

b9dbd3

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

b9dbd3
the following format:
b9dbd3

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

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

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

b9dbd3

Once command-line arguments have been retrived, the

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

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

Figure 2.1: The functionalities initialization environment.

b9dbd3
b9dbd3

b9dbd3

Functionalities are implemented by means of actions. Once the

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

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

Figure 2.2: The actions initialization environment.

b9dbd3
b9dbd3

b9dbd3
b9dbd3
b9dbd3

2.50.3 Usage

b9dbd3
b9dbd3

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

b9dbd3
each specific function documentation (-- Removed(pxref:trunk Scripts Bash
b9dbd3
Functions) --).
b9dbd3

b9dbd3
aaf678
b9dbd3

2.50.4 See also

aaf678
b9dbd3
b9dbd3
2.49 The <tt>`trunk/Scripts'</tt> Directory  
b9dbd3
b9dbd3
aaf678
ee1f37
ee1f37
b9dbd3
[ < ]
b130a0
[ > ]
ee1f37
   
b9dbd3
[ << ]
b9dbd3
[ Up ]
b9dbd3
[ >> ]
ee1f37
ee1f37

ee1f37
 <font size="-1">
406f69
  This document was generated on March, 1 2011 using texi2html 1.76.
ee1f37
 </font>
ee1f37
 
ee1f37
ee1f37

ee1f37
</body>
ee1f37
</html>