Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!--This manuals documents relevant information regarding the deployment,
organization, and administration of CentOS Artwork Repository.

Copyright C 2009-2011 Alain Reguera Delgado

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
copy of the license is included in the section entitled GNU Free
Documentation License.  
-->
<!-- Created on March, 30 2011 by texi2html 1.76 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people <dev@texi2html.cvshome.org>
Send bugs and suggestions to <users@texi2html.cvshome.org>

-->
<head>
<title>CentOS Artwork Repository: 2.60 The trunk/Scripts Directory</title>

<meta name="description" content="CentOS Artwork Repository: 2.60 The trunk/Scripts Directory">
<meta name="keywords" content="CentOS Artwork Repository: 2.60 The trunk/Scripts Directory">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.76">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
/* CSS
 *
 * repository.css -- This file provides visual style for repository
 * documentation manual in HTML format, as output by Texi2html
 * program.
 *
 * Copyright (C) 2009-2011 Alain Reguera Delgado
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA.
 * ----------------------------------------------------------------------
 * $Id$
 * ----------------------------------------------------------------------
 */

@import url("/home/centos/artwork/trunk/Identity/Webenv/Css/base.css");
@import url("/home/centos/artwork/trunk/Identity/Webenv/Css/base-app.css");

a.summary-letter {text-decoration: none}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="repository_2.59.html#SEC328" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC330" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="repository_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="repository_U.0.html#SEC416" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="repository_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Directories-trunk-Scripts"></a>
<a name="SEC329"></a>
<h2 class="section"> 2.60 The <tt>`trunk/Scripts'</tt> Directory </h2>
<ul>
<a href="#SEC330">2.60.1 Goals</a> <br>
<a href="#SEC331">2.60.2 Description</a> <br>
<a href="#SEC332">2.60.3 Usage</a> <br>
<a href="#SEC333">2.60.4 See also</a> <br>
</ul>


<a name="SEC330"></a>
<h3 class="subsection"> 2.60.1 Goals </h3>

<p>The <tt>`trunk/Scripts'</tt> directory exists to organize the trunk
development line of <tt>`centos-art.sh'</tt> automation script.  The
<tt>`centos-art.sh'</tt> script standardizes tasks you need to do
frequently inside CentOS Artwork Repository.
</p>

<a name="SEC331"></a>
<h3 class="subsection"> 2.60.2 Description </h3>

<p>The best way to understand <tt>`centos-art.sh'</tt> automation script is
studying its source code.  However, as start point, you may prefer to
read an introductory resume before diving into the source code
details.
</p>
<p>The <tt>`centos-art.sh'</tt> script is written in Bash. Most tasks, inside
<tt>`centos-art.sh'</tt> script, have been organized in many specific
functionalities that you can invoke from the <code>centos-art</code>
command-line interface.
</p>
<p>When you type the <code>centos-art</code> command in your terminal, the
operating system trys to execute that command. In order to execute the
command, the operating system needs to know where it is, so the
operating system uses the <var>PATH</var> environment variable to look for
that command location. If your system was prepared to use CentOS
Artwork Repository correctly (-- <strong>Removed</strong>(pxref:trunk Scripts Bash Functions
Verify) --), you should have a symbolic link inside <tt>`~/bin/'</tt>
directory that points to the <tt>`centos-art.sh'</tt> script file. As
<tt>`~/bin/'</tt> directory is, by default, inside <var>PATH</var> environment
variable, the execution of <code>centos-art</code> command runs the
<tt>`centos-art.sh'</tt> script.
</p>
<p>When <tt>`centos-art.sh'</tt> script is executed, the first it does is
executing the <tt>`trunk/Scripts/Bash/initEnvironment.sh'</tt> script to
initialize global variables (e.g., <code>gettext</code> variables) and
global function scripts.  Global function scripts are located inside
<tt>`trunk/Scripts/Bash/Functions'</tt> directory and their file names
begin with <samp>`cli'</samp>. Global function scripts provide common
functionalities that can be used anywhere inside <tt>`centos-art.sh'</tt>
script execution environment.
</p>
<p>Once global variables and function scripts have been loaded,
<tt>`centos-art.sh'</tt> script executes the <code>cli</code> global function
from <tt>`cli.sh'</tt> function script to retrive command-line arguments
and define some default values that may be used later by specific
function scripts (-- <strong>Removed</strong>(pxref:trunk Scripts Bash Functions) --).
</p>
<p>As convenction, the <tt>`centos-art.sh'</tt> command-line arguments have
the following format:
</p>
<pre class="verbatim">centos-art function path/to/dir --options
</pre>
<p>In the above example, <samp>`centos-art'</samp> is the command you use to
invoke <tt>`centos-art.sh'</tt> script. The <samp>`arg1'</samp> is required and
represents the functionality you want to perform (e.g.,
<samp>`verify'</samp>, <samp>`render'</samp>, <samp>`locale'</samp>, <samp>`manual'</samp>,
etc.). The remaining arguments are modifiers to <samp>`arg1'</samp>. The
<samp>`--arg2'</samp> definition is required and represets, specifically,
the action inside the functionality you want to perform.  The
<samp>`--arg3'</samp> and on, are optional.
</p>
<p>Once command-line arguments have been retrived, the
<tt>`centos-art.sh'</tt> script loads specific functionalities using the
<tt>`cli_getFunctions.sh'</tt> function script. Only one specific
functionality can be loaded at one script execution I.e., you run
<code>centos-art.sh</code> script to run just one functionality.
</p>
<div class="float"><a name="fig_003atrunk_002fScripts_002fBash_003aInitialization"></a>
<pre class="verbatim">+----------------------------------------------------------------------+
| [centos@host]$ centos-art function --action='value' --option='value' |
+----------------------------------------------------------------------+
| ~/bin/centos-art --&gt; ~/artwork/trunk/Scripts/centos-art.sh           |
+---v-----------------------------------------v------------------------+
    | centos-art.sh                           |
    +---v---------------------------------v---+
    .   | initEnvironment.sh              |   .
    .   +---------------------------------+   .
    .   | cli $@                          |   .
    .   +---v-------------------------v---+   .
    .   .   | cli_getFunctions        |   .   .
    .   .   +---v-----------------v---+   .   .
    .   .   .   | function1       |   .   .   .
    .   .   .   | function2       |   .   .   .
    .   .   .   | function3       |   .   .   .
    .   .   .   +-----------------+   .   .   .
    .   .   ...........................   .   .
    .   ...................................   .
    ...........................................
</pre>
</div><p><strong>Figure 2.1: The functionalities initialization environment.
</strong>
</p>
<p>Functionalities are implemented by means of actions.  Once the
functionality has been initiazalized, actions initialization take
place for that functionality. Actions initialization model is very
similar to functions initialization model. But with the difference,
that actions are loaded inside function environment, and so, share
variables and functions defined inside function environment.
</p>
<div class="float"><a name="fig_003atrunk_002fScripts_002fBash_002fFunctions_003aInitialization"></a>
<pre class="verbatim">+--------------------------------------+
| cli_getFunctions                     |
+---v------------------------------v---+
.   | function1                    |   .
.   +---v------------------------v-+   .
.   .   | function1_getArguments | .   .
.   .   +---v--------------v-----+ .   .
.   .   .   | action 1     |     . .   .
.   .   .   | action 2     |     . .   .
.   .   .   | action n     |     . .   .
.   .   .   +--------------+     . .   .
.   .   .......................... .   .
.   ................................   .
.   +------------------------------+   .
.   | function2                    |   .
.   +---v------------------------v-+   .
.   .   | function2_getArguments | .   .
.   .   +---v--------------v-----+ .   .
.   .   .   | action 1     |     . .   .
.   .   .   | action 2     |     . .   .
.   .   .   | action n     |     . .   .
.   .   .   +--------------+     . .   .
.   .   .......................... .   .
.   ................................   .
.   +------------------------------+   .
.   | function3                    |   .
.   +---v------------------------v-+   .
.   .   | function3_getArguments | .   .
.   .   +---v--------------v-----+ .   .
.   .   .   | action 1     |     . .   .
.   .   .   | action 2     |     . .   .
.   .   .   | action n     |     . .   .
.   .   .   +--------------+     . .   .
.   .   .......................... .   .
.   ................................   .
........................................
</pre>
</div><p><strong>Figure 2.2: The actions initialization environment.
</strong>
</p>

<a name="SEC332"></a>
<h3 class="subsection"> 2.60.3 Usage </h3>

<p>The <tt>`centos-art.sh'</tt> script usage information is described inside
each specific function documentation (-- <strong>Removed</strong>(pxref:trunk Scripts Bash
Functions) --).
</p>

<a name="SEC333"></a>
<h3 class="subsection"> 2.60.4 See also </h3>




<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="repository_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="repository_U.0.html#SEC416" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="repository_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
 <font size="-1">
  This document was generated on <i>March, 30 2011</i> using <a class="www" href="http://texi2html.cvshome.org/"><i>texi2html 1.76</i></a>.
 </font>
 <br>

</p>
</body>
</html>