|
|
010b2d |
|
|
|
010b2d |
<html>
|
|
|
d1db00 |
|
|
|
d1db00 |
organization, and administration of CentOS Artwork Repository.
|
|
|
d1db00 |
|
|
|
d1db00 |
Copyright C 2009-2011 Alain Reguera Delgado
|
|
|
010b2d |
|
|
|
010b2d |
Permission is granted to copy, distribute and/or modify this document
|
|
|
010b2d |
under the terms of the GNU Free Documentation License, Version 1.2 or
|
|
|
010b2d |
any later version published by the Free Software Foundation; with no
|
|
|
010b2d |
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
|
|
|
010b2d |
copy of the license is included in the section entitled GNU Free
|
|
|
010b2d |
Documentation License.
|
|
|
010b2d |
-->
|
|
|
949b9b |
|
|
|
010b2d |
|
|
|
010b2d |
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
|
|
|
010b2d |
Karl Berry <karl@freefriends.org>
|
|
|
010b2d |
Olaf Bachmann <obachman@mathematik.uni-kl.de>
|
|
|
010b2d |
and many others.
|
|
|
010b2d |
Maintained by: Many creative people <dev@texi2html.cvshome.org>
|
|
|
010b2d |
Send bugs and suggestions to <users@texi2html.cvshome.org>
|
|
|
010b2d |
|
|
|
010b2d |
-->
|
|
|
010b2d |
<head>
|
|
|
06d106 |
<title>CentOS Artwork Repository: 2.62 The trunk/Scripts/Bash Directory</title>
|
|
|
010b2d |
|
|
|
06d106 |
<meta name="description" content="CentOS Artwork Repository: 2.62 The trunk/Scripts/Bash Directory">
|
|
|
06d106 |
<meta name="keywords" content="CentOS Artwork Repository: 2.62 The trunk/Scripts/Bash Directory">
|
|
|
010b2d |
<meta name="resource-type" content="document">
|
|
|
010b2d |
<meta name="distribution" content="global">
|
|
|
010b2d |
<meta name="Generator" content="texi2html 1.76">
|
|
|
010b2d |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
|
010b2d |
<style type="text/css">
|
|
|
010b2d |
|
|
|
010b2d |
@import "/home/centos/artwork/trunk/Identity/Models/Css/Texi2html/common.css";
|
|
|
010b2d |
|
|
|
010b2d |
a.summary-letter {text-decoration: none}
|
|
|
010b2d |
pre.display {font-family: serif}
|
|
|
010b2d |
pre.format {font-family: serif}
|
|
|
010b2d |
pre.menu-comment {font-family: serif}
|
|
|
010b2d |
pre.menu-preformatted {font-family: serif}
|
|
|
010b2d |
pre.smalldisplay {font-family: serif; font-size: smaller}
|
|
|
010b2d |
pre.smallexample {font-size: smaller}
|
|
|
010b2d |
pre.smallformat {font-family: serif; font-size: smaller}
|
|
|
010b2d |
pre.smalllisp {font-size: smaller}
|
|
|
010b2d |
span.sansserif {font-family:sans-serif; font-weight:normal;}
|
|
|
010b2d |
ul.toc {list-style: none}
|
|
|
010b2d |
-->
|
|
|
010b2d |
</style>
|
|
|
010b2d |
|
|
|
010b2d |
|
|
|
010b2d |
</head>
|
|
|
010b2d |
|
|
|
010b2d |
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
|
|
|
010b2d |
|
|
|
010b2d |
|
|
|
995423 |
[ < ]
|
|
|
06d106 |
[ > ]
|
|
|
010b2d |
|
|
|
671838 |
[ << ]
|
|
|
671838 |
[ Up ]
|
|
|
06d106 |
[ >> ]
|
|
|
010b2d |
|
|
|
010b2d |
|
|
|
010b2d |
|
|
|
010b2d |
|
|
|
982d5c |
[Top]
|
|
|
982d5c |
[Contents]
|
|
|
06d106 |
[Index]
|
|
|
982d5c |
[ ? ]
|
|
|
010b2d |
|
|
|
06d106 |
|
|
|
995423 |
|
|
|
06d106 |
2.62 The <tt>`trunk/Scripts/Bash'</tt> Directory
|
|
|
671838 |
|
|
|
671838 |
|
|
|
06d106 |
|
|
|
06d106 |
2.62.1 Goals
|
|
|
06d106 |
|
|
|
06d106 |
The <tt>`trunk/Scripts/Bash'</tt> directory exists to organize the trunk
|
|
|
06d106 |
development line of <tt>`centos-art.sh'</tt> automation script. The
|
|
|
06d106 |
<tt>`centos-art.sh'</tt> script standardizes frequent tasks inside your
|
|
|
06d106 |
working copy of CentOS Artwork Repository.
|
|
|
06d106 |
|
|
|
06d106 |
|
|
|
06d106 |
|
|
|
06d106 |
2.62.2 Description
|
|
|
06d106 |
|
|
|
06d106 |
The best way to understand <tt>`centos-art.sh'</tt> automation script is
|
|
|
06d106 |
studying its source code. However, as start point, you may prefer to
|
|
|
06d106 |
read an introductory resume before diving into the source code
|
|
|
06d106 |
details.
|
|
|
06d106 |
|
|
|
06d106 |
The <tt>`centos-art.sh'</tt> script is written in Bash. Most tasks, inside
|
|
|
06d106 |
<tt>`centos-art.sh'</tt> script, have been organized in many specific
|
|
|
06d106 |
functionalities that you can invoke from the centos-art
|
|
|
06d106 |
command-line interface.
|
|
|
06d106 |
|
|
|
06d106 |
When you type the centos-art command in your terminal, the
|
|
|
06d106 |
operating system trys to execute that command. In order to execute the
|
|
|
06d106 |
command, the operating system needs to know where it is, so the
|
|
|
06d106 |
operating system uses the PATH environment variable to look for
|
|
|
06d106 |
that command location. If your system was prepared to use CentOS
|
|
|
06d106 |
Artwork Repository correctly (-- Removed(pxref:trunk Scripts Bash Functions
|
|
|
06d106 |
Verify) --), you should have a symbolic link inside <tt>`~/bin/'</tt>
|
|
|
06d106 |
directory that points to the <tt>`centos-art.sh'</tt> script file. As
|
|
|
06d106 |
<tt>`~/bin/'</tt> directory is, by default, inside PATH environment
|
|
|
06d106 |
variable, the execution of centos-art command runs the
|
|
|
06d106 |
<tt>`centos-art.sh'</tt> script.
|
|
|
06d106 |
|
|
|
06d106 |
When <tt>`centos-art.sh'</tt> script is executed, the first it does is
|
|
|
06d106 |
executing the <tt>`trunk/Scripts/Bash/initEnvironment.sh'</tt> script to
|
|
|
06d106 |
initialize global variables (e.g., gettext variables) and
|
|
|
06d106 |
global function scripts. Global function scripts are located inside
|
|
|
06d106 |
<tt>`trunk/Scripts/Bash/Functions'</tt> directory and their file names
|
|
|
06d106 |
begin with <samp>`cli'</samp>. Global function scripts provide common
|
|
|
06d106 |
functionalities that can be used anywhere inside <tt>`centos-art.sh'</tt>
|
|
|
06d106 |
script execution environment.
|
|
|
06d106 |
|
|
|
06d106 |
Once global variables and function scripts have been loaded,
|
|
|
06d106 |
<tt>`centos-art.sh'</tt> script executes the cli global function
|
|
|
06d106 |
from <tt>`cli.sh'</tt> function script to retrive command-line arguments
|
|
|
06d106 |
and define some default values that may be used later by specific
|
|
|
06d106 |
function scripts (-- Removed(pxref:trunk Scripts Bash Functions) --).
|
|
|
06d106 |
|
|
|
06d106 |
As convenction, the <tt>`centos-art.sh'</tt> command-line arguments have
|
|
|
06d106 |
the following format:
|
|
|
06d106 |
|
|
|
06d106 |
centos-art arg1 --arg2=val2 --arg3=val3
|
|
|
06d106 |
|
|
|
06d106 |
In the above example, <samp>`centos-art'</samp> is the command you use to
|
|
|
06d106 |
invoke <tt>`centos-art.sh'</tt> script. The <samp>`arg1'</samp> is required and
|
|
|
06d106 |
represents the functionality you want to perform (e.g.,
|
|
|
06d106 |
<samp>`verify'</samp>, <samp>`render'</samp>, <samp>`locale'</samp>, <samp>`manual'</samp>,
|
|
|
06d106 |
etc.). The remaining arguments are modifiers to <samp>`arg1'</samp>. The
|
|
|
06d106 |
<samp>`--arg2'</samp> definition is required and represets, specifically,
|
|
|
06d106 |
the action inside the functionality you want to perform. The
|
|
|
06d106 |
<samp>`--arg3'</samp> and on, are optional.
|
|
|
06d106 |
|
|
|
06d106 |
Once command-line arguments have been retrived, the
|
|
|
06d106 |
<tt>`centos-art.sh'</tt> script loads specific functionalities using the
|
|
|
06d106 |
<tt>`cli_getFunctions.sh'</tt> function script. Only one specific
|
|
|
06d106 |
functionality can be loaded at one script execution I.e., you run
|
|
|
06d106 |
centos-art.sh script to run just one functionality.
|
|
|
06d106 |
|
|
|
06d106 |
|
|
|
06d106 |
+----------------------------------------------------------------------+
|
|
|
06d106 |
| [centos@host]$ centos-art function --action='value' --option='value' |
|
|
|
06d106 |
+----------------------------------------------------------------------+
|
|
|
06d106 |
| ~/bin/centos-art --> ~/artwork/trunk/Scripts/Bash/centos-art.sh |
|
|
|
06d106 |
+---v-----------------------------------------v------------------------+
|
|
|
06d106 |
| centos-art.sh |
|
|
|
06d106 |
+---v---------------------------------v---+
|
|
|
06d106 |
. | initEnvironment.sh | .
|
|
|
06d106 |
. +---------------------------------+ .
|
|
|
06d106 |
. | cli $@ | .
|
|
|
06d106 |
. +---v-------------------------v---+ .
|
|
|
06d106 |
. . | cli_getFunctions | . .
|
|
|
06d106 |
. . +---v-----------------v---+ . .
|
|
|
06d106 |
. . . | function1 | . . .
|
|
|
06d106 |
. . . | function2 | . . .
|
|
|
06d106 |
. . . | function3 | . . .
|
|
|
06d106 |
. . . +-----------------+ . . .
|
|
|
06d106 |
. . ........................... . .
|
|
|
06d106 |
. ................................... .
|
|
|
06d106 |
...........................................
|
|
|
06d106 |
|
|
|
06d106 |
Figure 2.1: The functionalities initialization environment.
|
|
|
06d106 |
|
|
|
06d106 |
|
|
|
06d106 |
Functionalities are implemented by means of actions. Once the
|
|
|
06d106 |
functionality has been initiazalized, actions initialization take
|
|
|
06d106 |
place for that functionality. Actions initialization model is very
|
|
|
06d106 |
similar to functions initialization model. But with the difference,
|
|
|
06d106 |
that actions are loaded inside function environment, and so, share
|
|
|
06d106 |
variables and functions defined inside function environment.
|
|
|
06d106 |
|
|
|
06d106 |
|
|
|
06d106 |
+--------------------------------------+
|
|
|
06d106 |
| cli_getFunctions |
|
|
|
06d106 |
+---v------------------------------v---+
|
|
|
06d106 |
. | function1 | .
|
|
|
06d106 |
. +---v----------------------v---+ .
|
|
|
06d106 |
. . | function1_getActions | . .
|
|
|
06d106 |
. . +---v--------------v---+ . .
|
|
|
06d106 |
. . . | action 1 | . . .
|
|
|
06d106 |
. . . | action 2 | . . .
|
|
|
06d106 |
. . . | action n | . . .
|
|
|
06d106 |
. . . +--------------+ . . .
|
|
|
06d106 |
. . ........................ . .
|
|
|
06d106 |
. ................................ .
|
|
|
06d106 |
. +------------------------------+ .
|
|
|
06d106 |
. | function2 | .
|
|
|
06d106 |
. +---v----------------------v---+ .
|
|
|
06d106 |
. . | function2_getActions | . .
|
|
|
06d106 |
. . +---v--------------v---+ . .
|
|
|
06d106 |
. . . | action 1 | . . .
|
|
|
06d106 |
. . . | action 2 | . . .
|
|
|
06d106 |
. . . | action n | . . .
|
|
|
06d106 |
. . . +--------------+ . . .
|
|
|
06d106 |
. . ........................ . .
|
|
|
06d106 |
. ................................ .
|
|
|
06d106 |
. +------------------------------+ .
|
|
|
06d106 |
. | function3 | .
|
|
|
06d106 |
. +---v----------------------v---+ .
|
|
|
06d106 |
. . | function3_getActions | . .
|
|
|
06d106 |
. . +---v--------------v---+ . .
|
|
|
06d106 |
. . . | action 1 | . . .
|
|
|
06d106 |
. . . | action 2 | . . .
|
|
|
06d106 |
. . . | action n | . . .
|
|
|
06d106 |
. . . +--------------+ . . .
|
|
|
06d106 |
. . ........................ . .
|
|
|
06d106 |
. ................................ .
|
|
|
06d106 |
........................................
|
|
|
06d106 |
|
|
|
06d106 |
Figure 2.2: The actions initialization environment.
|
|
|
06d106 |
|
|
|
06d106 |
|
|
|
06d106 |
|
|
|
06d106 |
|
|
|
06d106 |
2.62.3 Usage
|
|
|
06d106 |
|
|
|
06d106 |
The <tt>`centos-art.sh'</tt> script usage information is described inside
|
|
|
06d106 |
each specific function documentation (-- Removed(pxref:trunk Scripts Bash
|
|
|
06d106 |
Functions) --).
|
|
|
06d106 |
|
|
|
06d106 |
|
|
|
06d106 |
|
|
|
06d106 |
2.62.4 See also
|
|
|
06d106 |
|
|
|
06d106 |
|
|
|
06d106 |
2.61 The <tt>`trunk/Scripts'</tt> Directory
|
|
|
06d106 |
|
|
|
06d106 |
|
|
|
06d106 |
|
|
|
010b2d |
|
|
|
010b2d |
|
|
|
06d106 |
[ < ]
|
|
|
06d106 |
[ > ]
|
|
|
010b2d |
|
|
|
671838 |
[ << ]
|
|
|
06d106 |
[ Up ]
|
|
|
06d106 |
[ >> ]
|
|
|
010b2d |
|
|
|
010b2d |
|
|
|
010b2d |
<font size="-1">
|
|
|
949b9b |
This document was generated on March, 11 2011 using texi2html 1.76.
|
|
|
010b2d |
</font>
|
|
|
010b2d |
|
|
|
010b2d |
|
|
|
010b2d |
|
|
|
010b2d |
</body>
|
|
|
010b2d |
</html>
|