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