Blame Manuals/en/Html/Repository/repository_40.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
-->
92fb7f
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>
aaa0e9
<title>The CentOS Artwork Repository: 3.37 trunk/Scripts/Bash</title>
4c79b5
aaa0e9
<meta name="description" content="The CentOS Artwork Repository: 3.37 trunk/Scripts/Bash">
aaa0e9
<meta name="keywords" content="The CentOS Artwork Repository: 3.37 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
01b527
[ < ]
01b527
[ > ]
4c79b5
   
4c79b5
[ << ]
4c79b5
[ Up ]
aaa0e9
[ >> ]
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
   
4c79b5
[Top]
4c79b5
[Contents]
aaa0e9
[Index]
4c79b5
[ ? ]
4c79b5
aaa0e9
01b527
aaa0e9

3.37 trunk/Scripts/Bash

4c79b5
4c79b5
01b527
6ba043

3.37.1 Goals

6ba043
aaa0e9

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

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

6ba043
01b527
6ba043

3.37.2 Description

6ba043
aaa0e9

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

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

aaa0e9

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

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

aaa0e9

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

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

aaa0e9

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

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

aaa0e9

Once global variables and function scripts have been loaded,

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

aaa0e9

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

aaa0e9
the following format:
aaa0e9

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

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

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

aaa0e9

Once command-line arguments have been retrived, the

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

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

Figure 3.12: The functionalities initialization environment.

aaa0e9
4224f4

aaa0e9

Functionalities are implemented by means of actions. Once the

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

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

Figure 3.13: The actions initialization environment.

aaa0e9
63f275

6ba043
01b527
6ba043

3.37.3 Usage

6ba043
aaa0e9

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

aaa0e9
each specific function documentation (see section trunk/Scripts/Bash/Functions).
4224f4

4224f4
aaa0e9
4224f4

3.37.4 See also

4224f4
4224f4
aaa0e9
3.36 trunk/Scripts  
aaa0e9
aaa0e9
3.38 trunk/Scripts/Bash/Functions  
63f275
aaa0e9
3.48 trunk/Scripts/Bash/Locale  
63f275
63f275
4c79b5
5fb024
4c79b5
aaa0e9
[ < ]
aaa0e9
[ > ]
4c79b5
   
4c79b5
[ << ]
01b527
[ Up ]
aaa0e9
[ >> ]
4c79b5
4c79b5

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

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