diff --git a/Manual/Directories/trunk/Scripts.texi b/Manual/Directories/trunk/Scripts.texi index c9b371f..3d12353 100644 --- a/Manual/Directories/trunk/Scripts.texi +++ b/Manual/Directories/trunk/Scripts.texi @@ -1,25 +1,157 @@ @subsection Goals -The @file{trunk/Scripts} directory exists to: - -@itemize -@item Organize the ``trunk'' development line of automation scripts by -programming language. -@end itemize +The @file{trunk/Scripts} directory exists to organize the trunk +development line of @file{centos-art.sh} automation script. The +@file{centos-art.sh} script standardizes tasks you need to do +frequently inside CentOS Artwork Repository. @subsection Description -@itemize -@item ... -@end itemize +The best way to understand @file{centos-art.sh} 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. + +The @file{centos-art.sh} script is written in Bash. Most tasks, inside +@file{centos-art.sh} script, have been organized in many specific +functionalities that you can invoke from the @command{centos-art} +command-line interface. + +When you type the @command{centos-art} 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} environment variable to look for +that command location. If your system was prepared to use CentOS +Artwork Repository correctly (--- @strong{Removed}(pxref:trunk Scripts Bash Functions +Verify) ---), you should have a symbolic link inside @file{~/bin/} +directory that points to the @file{centos-art.sh} script file. As +@file{~/bin/} directory is, by default, inside @var{PATH} environment +variable, the execution of @command{centos-art} command runs the +@file{centos-art.sh} script. + +When @file{centos-art.sh} script is executed, the first it does is +executing the @file{trunk/Scripts/Bash/initEnvironment.sh} script to +initialize global variables (e.g., @command{gettext} variables) and +global function scripts. Global function scripts are located inside +@file{trunk/Scripts/Bash/Functions} directory and their file names +begin with @samp{cli}. Global function scripts provide common +functionalities that can be used anywhere inside @file{centos-art.sh} +script execution environment. + +Once global variables and function scripts have been loaded, +@file{centos-art.sh} script executes the @command{cli} global function +from @file{cli.sh} function script to retrive command-line arguments +and define some default values that may be used later by specific +function scripts (--- @strong{Removed}(pxref:trunk Scripts Bash Functions) ---). + +As convenction, the @file{centos-art.sh} command-line arguments have +the following format: + +@verbatim +centos-art arg1 --arg2=val2 --arg3=val3 +@end verbatim + +In the above example, @samp{centos-art} is the command you use to +invoke @file{centos-art.sh} script. The @samp{arg1} is required and +represents the functionality you want to perform (e.g., +@option{verify}, @option{render}, @option{locale}, @option{manual}, +etc.). The remaining arguments are modifiers to @option{arg1}. The +@option{--arg2} definition is required and represets, specifically, +the action inside the functionality you want to perform. The +@option{--arg3} and on, are optional. + +Once command-line arguments have been retrived, the +@file{centos-art.sh} script loads specific functionalities using the +@file{cli_getFunctions.sh} function script. Only one specific +functionality can be loaded at one script execution I.e., you run +@command{centos-art.sh} script to run just one functionality. + +@float Figure,fig:trunk/Scripts/Bash:Initialization +@verbatim ++----------------------------------------------------------------------+ +| [centos@host]$ centos-art function --action='value' --option='value' | ++----------------------------------------------------------------------+ +| ~/bin/centos-art --> ~/artwork/trunk/Scripts/Bash/centos-art.sh | ++---v-----------------------------------------v------------------------+ + | centos-art.sh | + +---v---------------------------------v---+ + . | initEnvironment.sh | . + . +---------------------------------+ . + . | cli $@ | . + . +---v-------------------------v---+ . + . . | cli_getFunctions | . . + . . +---v-----------------v---+ . . + . . . | function1 | . . . + . . . | function2 | . . . + . . . | function3 | . . . + . . . +-----------------+ . . . + . . ........................... . . + . ................................... . + ........................................... +@end verbatim +@caption{The functionalities initialization environment.} +@end float + +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. + +@float Figure,fig:trunk/Scripts/Bash/Functions:Initialization +@verbatim ++--------------------------------------+ +| cli_getFunctions | ++---v------------------------------v---+ +. | function1 | . +. +---v----------------------v---+ . +. . | function1_getActions | . . +. . +---v--------------v---+ . . +. . . | action 1 | . . . +. . . | action 2 | . . . +. . . | action n | . . . +. . . +--------------+ . . . +. . ........................ . . +. ................................ . +. +------------------------------+ . +. | function2 | . +. +---v----------------------v---+ . +. . | function2_getActions | . . +. . +---v--------------v---+ . . +. . . | action 1 | . . . +. . . | action 2 | . . . +. . . | action n | . . . +. . . +--------------+ . . . +. . ........................ . . +. ................................ . +. +------------------------------+ . +. | function3 | . +. +---v----------------------v---+ . +. . | function3_getActions | . . +. . +---v--------------v---+ . . +. . . | action 1 | . . . +. . . | action 2 | . . . +. . . | action n | . . . +. . . +--------------+ . . . +. . ........................ . . +. ................................ . +........................................ +@end verbatim +@caption{The actions initialization environment.} +@end float @subsection Usage -@itemize -@item ... -@end itemize +The @file{centos-art.sh} script usage information is described inside +each specific function documentation (--- @strong{Removed}(pxref:trunk Scripts Bash +Functions) ---). @subsection See also @menu +* Directories trunk Scripts:: +@comment --- Removed(* Directories trunk Scripts Bash Functions::) --- +@comment --- Removed(* Directories trunk Scripts Bash Locale::) --- @end menu +