diff --git a/Manuals/Filesystem/filesystem-html/filesystem_3.html b/Manuals/Filesystem/filesystem-html/filesystem_3.html index 89518d3..c3ab6b3 100644 --- a/Manuals/Filesystem/filesystem-html/filesystem_3.html +++ b/Manuals/Filesystem/filesystem-html/filesystem_3.html @@ -171,25 +171,25 @@ ul.toc {list-style: none}
centos-art
command runs the
@@ -118,7 +119,7 @@ script execution environment.
`centos-art.sh' script executes the cli
global function
from `cli.sh' function script to retrive command-line arguments
and define some default values that may be used later by specific
-function scripts (see section trunk/Scripts/Bash/Functions).
+function scripts (-- Removed(pxref:trunk Scripts Bash Functions) --).
As convenction, the `centos-art.sh' command-line arguments have the following format: @@ -218,7 +219,8 @@ variables and functions defined inside function environment.
The `centos-art.sh' script usage information is described inside -each specific function documentation (see section trunk/Scripts/Bash/Functions). +each specific function documentation (-- Removed(pxref:trunk Scripts Bash +Functions) --).
@@ -227,8 +229,6 @@ each specific function documentation (see sectionThe `trunk/Scripts/Bash/Functions' directory exists to organize +`centos-art.sh' specific functionalities. +
The specific functions of `centos-art.sh' script are designed +with "Software Toolbox" philosophy (see (coreutils.info)Toolbox introduction) in mind: each program "should do one +thing well". Inside `centos-art.sh' script, each specific +functionality is considered a program that should do one thing well. +Of course, if you find that they still don't do it, feel free to +improve them in order for them to do so. +
+The specific functions of `centos-art.sh' script are organized
+inside specific directories under `trunk/Scripts/Bash/Functions'
+location. Each specific function directory should be named as the
+function it represents, with the first letter in uppercase. For
+example, if the function name is render
, the specific function
+directory for it would be `trunk/Scripts/Bash/Functions/Render'.
+
To better understand how specific functions of `centos-art.sh' +script are designed, lets create one function which only goal is to +output different kind of greetings to your screen. +
+When we create specific functions for `centos-art.sh' script it +is crucial to know what these functions will do exactly and if there +is any function that already does what we intend to do. If there is no +one, it is good time to create them then. Otherwise, if +functionalities already available don't do what you exactly expect, +contact their authors and work together to improve them. +
++ +Tip
Join CentOS developers mailing list +centos-art@centos.org to share your ideas. +
It is also worth to know what global functions and variables do we +have available inside `centos-art.sh' script, so advantage can be +taken from them. Global variables are defined inside global function +scripts. Global functions scripts are stored immediatly under +`trunk/Scripts/Bash/Functions' directory, in files begining with +`cli' prefix. +
+OK, let's begin with our functionality example. +
+What function name do we use? Well, lets use greet
. Note that
+`hello' word is not a verb; but an expression, a kind of
+greeting, an interjection specifically. In contrast, `greet' is a
+verb and describes what we do when we say `Hello!', `Hi!',
+and similar expressions.
+
So far, we've gathered the following function information: +
+Name: greet +Path: trunk/Scripts/Bash/Functions/Greet +File: trunk/Scripts/Bash/Functions/Greet/greet.sh ++
The `greet.sh' function script is the first file
+`centos-art.sh' script loads when the `greet' functionality
+is called using commands like `centos-art greet --hello='World''.
+The `greet.sh' function script contains the greet
function
+definition.
+
Inside `centos-art.sh' script, as convenction, each function +script has one top commentary, followed by one blank line, and then +one function defintion below it only. +
+Inside `centos-art.sh' script functions, top commentaries have
+the following components: the functionality description, one-line for
+copyright note with your personal information, the license under
+which the function source code is released --the `centos-art.sh'
+script is released as GPL, so do all its functions--, the $Id$
+keyword of Subversion is later expanded by svn propset
+command.
+
In our greet
function example, top commentary for
+`greet.sh' function script would look like the following:
+
#!/bin/bash +# +# greet.sh -- This function outputs different kind of greetings to +# your screen. Use this function to understand how centos-art.sh +# script specific functionalities work. +# +# Copyright (C) YEAR YOURFULLNAME +# +# 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$ +# ---------------------------------------------------------------------- ++
After top commentary, separated by one blank line, the greet
+function definition would look like the following:
+
function greet { + + # Define global variables. + + # Define command-line interface. + greet_getActions + +} ++
The first definition inside greet
function, are global
+variables that will be available along greet
function execution
+environment. This time we didn't use global variable definitions for
+greet
function execution environment, so we left that section
+empty.
+
Later, we call greet_getActions
function to define the
+command-line interface of greet
functionality. The command-line
+interface of greet
functionality defines what and how actions
+are performed, based on arguments combination passed to
+`centos-art.sh' script.
+
function greet_getActions { + + case "$ACTIONNAM" in + --hello ) + greet_doHello + ;; + + --bye ) + greet_doBye + ;; + + * ) + cli_printMessage "`gettext "The option provided is not valid."`" + cli_printMessage "$(caller)" 'AsToKnowMoreLine' + + esac + +} ++
The ACTIONNAM global variable is defined in `cli.sh' +function script and contains the value passed before the equal sign +(i.e., `=') in the second command-line argument of +`centos-art.sh' script. For example, if the second command-line +argument is `--hello='World'', the value of ACTIONNAM +variable would be `--hello'. Using this configuration let us +deside which action to perform based on the action name passed to +`centos-art.sh' script as second argument. +
+The greet
function definition makes available two valid
+greetings through `--hello' and `--bye' options. If no
+one of them is provided as second command-line argument, the `*'
+case is evaluated instead.
+
The `*' case and its two lines further on should always be +present in `_getActions.sh' function scripts, no matter what +specific functionality you are creating. This convenction helps the +user to find out documentation about current functionality in use, +when no valid action is provided. +
+The greet_doHello
and greet_doBye
function definitions
+are the core of greet
specific functionality. In such function
+definitions we set what our greet
function really does: to
+output different kinds of greetings.
+
function greet_doHello { + + cli_printMessage "`gettext "Hello"` $ACTIONVAL" + +} ++
The greet_doHello
function definition is stored in
+`greet_doHello.sh' function script.
+
function greet_doBye { + + cli_printMessage "`gettext "Goodbye"` $ACTIONVAL" + +} ++
The greet_doBye
function definition is stored in the
+`greet_doBye.sh' function script.
+
Both `greet_doHello.sh' and `greet_doBye.sh' function
+scripts are stored inside greet
function directory path (i.e.
+`trunk/Scripts/Bash/Functions/Greet').
+
The ACTIONVAL global variable is defined in `cli.sh' +function script and contains the value passed after the equal sign +(i.e., `=') in the second command-line argument of +`centos-art.sh' script. For example, if the second command-line +argument is `--hello='World'', the value of ACTIONVAL +variable would be `World' without quotes. +
+Let's see how greet
specific functionality files are organzied
+under greet
function directory. To see file organization we use
+the tree
command:
+
trunk/Scripts/Bash/Functions/Greet +|-- greet_doBye.sh +|-- greet_doHello.sh +|-- greet_getActions.sh +`-- greet.sh ++
To try the greet
specific functionality we've just created,
+pass the function name (i.e., `greet') as first argument to
+`centos-art.sh' script, and any of the valid options as second
+argument. Some examples are illustrated below:
+
[centos@projects ~]$ centos-art greet --hello='World' +Hello World +[centos@projects ~]$ centos-art greet --bye='World' +Goodbye World +[centos@projects ~]$ ++
The word `World' in the examples above can be anything. In fact, +change it to have a little fun. +
+Now that we have a specific function that works as we expect, it is
+time to document it. To document greet
specific functionality,
+we use its directory path and the manual
functionality
+(-- Removed(pxref:trunk Scripts Bash Functions Manual) --) of `centos-art.sh'
+script, just as the following command illustrates:
+
centos-art manual --edit=trunk/Scripts/Bash/Functions/Greet ++
To have a well documented function helps user to understand how your +function really works, and how it should be used. When no valid +action is passed to a function, the `centos-art.sh' script uses +the function documentation entry as vehicle to communicate which the +valid functions are. When no documentation entry exists for a +function, the `centos-art.sh' script informs that no +documentation entry exists for such function and requests user to +create it right at that time. +
+Now that we have documented our function, it is time to translate its
+output messages to different languages. To translate specific
+functionality output messages to different languages we use the
+locale
functionality (-- Removed(pxref:trunk Scripts Bash Functions
+Locale) --) of `centos-art.sh' script, just as the following command
+illustrates:
+
centos-art locale --edit ++
+ +Warning
To translate output messages in different languages, +your system locale information --as in
LANG
environment +variable-- must be set to that locale you want to produce translated +messages for. For example, if you want to produce translated messages +for Spanish language, your system locale information must be set to +`es_ES.UTF-8', or similar, first. +
Well, it seems that our example is rather complete by now. +
+In greet
function example we've described so far, we only use
+cli_printMessage
global function in action specific function
+definitions in order to print messages, but more interesting things
+can be achieved inside action specific function definitions. For
+example, if you pass a directory path as action value in second
+argument, you could retrive a list of files from therein, and process
+them. If the list of files turns too long or you just want to control
+which files to process, you could add the third argument in the form
+`--filter='regex'' and reduce the amount of files to process
+using a regular expression pattern.
+
The greet
function described in this section may serve you as
+an introduction to understand how specific functionalities work inside
+`centos-art.sh' script. With some of luck this introduction will
+also serve you as motivation to create your own `centos-art.sh'
+script specific functionalities.
+
By the way, the greet
functionality doesn't exist inside
+`centos-art.sh' script yet. Would you like to create it?
+
The following global variables of `centos-art.sh' script, are +available for you to use inside specific functions: +
+Default domain used to retrieve translated messages. This value is set +in `initFunctions.sh' and shouldn't be changed. +
Default directory used to retrieve translated messages. This value is +set in `initFunctions.sh' and shouldn't be changed. +
Define function name. +
+Function names associate sets of actions. There is one set of actions +for each unique function name inside `centos-art.sh' script. +
+Dunction names are passed as first argument in `centos-art.sh' +command-line interface. For example, in the command `centos-art +render --entry=path/to/dir --filter=regex', the ACTION passed to +`centos-art.sh' script is `render'. +
+When first argument is not provided, the `centos-art.sh' script +immediatly ends its execution. +
Define action name. +
+Each action name identifies an specific action to perform, inside an +specific function. +
+Action name names aare passed as second argument in +`centos-art.sh' command-line interface. For example, in the +command `centos-art render --entry=path/to/dir --filter=regex', +the ACTIONNAM passed to `centos-art.sh' script is +`--entry'. +
+When second argument is not provided, the `centos-art.sh' script +immediatly ends its execution. +
Define action value. +
+Action values are associated to just one action name. Action values +contain the working copy entry over which its associated action will be +performed in. Working copy entries can be files or directories inside +the working copy. +
Define regular expression used as pattern to build the list of files +to process. +
+By default, REGEX variable is set to .+
to match all
+files.
+
Functions that need to build a list of files to process use the option +`--filter' to redefine REGEX variable default value, and +so, control the amount of files to process. +
Define optional arguments. +
+Optional arguments, inside `centos-art.sh' script, are considered +as all command-line arguments passed to `centos-art.sh' script, +from third argument position on. For example, in the command +`centos-art render --entry=path/to/dir --filter=regex' , the +optional arguments are from `--filter=regex' argument on. +
+Optional arguments are parsed using getopt
command through
+the following base construction:
+
# Define short options we want to support. +local ARGSS="" + +# Define long options we want to support. +local ARGSL="filter:,to:" + +# Parse arguments using getopt(1) command parser. +cli_doParseArguments + +# Reset positional parameters using output from (getopt) argument +# parser. +eval set -- "$ARGUMENTS" + +# Define action to take for each option passed. +while true; do + case "$1" in + --filter ) + REGEX="$2" + shift 2 + ;; + --to ) + TARGET="$2" + shift 2 + ;; + * ) + break + esac +done ++
Optional arguments provide support to command options inside
+`centos-art.sh' script. For instance, consider the Subversion
+(svn
) command, where there are many options (e.g.,
+`copy', `delete', `move', etc), and inside each
+option there are several modifiers (e.g., `--revision',
+`--message', `--username', etc.) that can be combined one
+another in their short or long variants.
+
The ARGUMENTS variable is used to store arguments passed from +command-line for later use inside `centos-art.sh' script. Storing +arguments is specially useful when we want to run a command with some +specific options from them. Consider the following command: +
+centos-art path --copy=SOURCE --to=TARGET --message="The commit message goes here." --username='johndoe' ++
In the above command, the `--message', and `--username'
+options are specific to svn copy
command. In such cases,
+options are not interpreted by `centos-art.sh' script itself.
+Instead, the `centos-art.sh' script uses getopt
to
+retrive them and store them in the ARGUMENTS variable for later
+use, as described in the following command:
+
# Build subversion command to duplicate locations inside the +# workstation. +eval svn copy $SOURCE $TARGET --quiet $ARGUMENTS ++
When getopt
parses ARGUMENTS, we may use short options
+(e.g., `-m') or long options (e.g., `--message'). When
+we use short options, arguments are separated by one space from the
+option (e.g., `-m 'This is a commit message.''). When we use
+long options arguments are separated by an equal sign (`=')
+(e.g., `--message='This is a commit message'').
+
In order for getopt
to parse ARGUMENTS correctly, it
+is required to provide the short and long definition of options that
+will be passed or at least supported by the command performing the
+final action the function script exists for.
+
As convenction, inside `centos-art.sh' script, short option +definitions are set in the ARGSS variable; and long option +definitions are set in the ARGSL variable. +
+When you define short and long options, it may be needed to define +which of these option arguments are required and which not. To define +an option argument as required, you need to set one colon `:' +after the option definition (e.g., `-o m: -l message:'). On +the other hand, to define an option argument as not required, you need +to set two colons `::' after the option definition (e.g., +`-o m:: -l message::'). +
Default text editor. +
+The `centos-art.sh' script uses default text EDITOR
to edit
+pre-commit subversion messages, translation files, configuration
+files, script files, and similar text-based files.
+
If EDITOR
environment variable is not set, `centos-art.sh'
+script uses `/usr/bin/vim' as default text editor. Otherwise, the
+following values are recognized by `centos-art.sh' script:
+
If no one of these values is set in EDITOR
environment variable,
+`centos-art.sh' uses `/usr/bin/vim' text editor by default.
+
Function scripts stored directly under +`trunk/Scripts/Bash/Functions/' directory are used to define +global functions. Global functions can be used inside action specific +functionalities and or even be reused inside themselves. This section +provides introductory information to global functions you can use +inside `centos-art.sh' script. +
+Validate action value (ACTIONVAL) variable. +
+The action value variable can take one of the following values: +
+If another value different from that specified above is passed to +action value variable, the `centos-art.sh' script prints an error +message and ends script execution. +
Verify file existence. +
+cli_checkFiles
receives a FILE absolute path and performs
+file verification as specified in TYPE. When TYPE is not
+specified, cli_checkFiles
verifies FILE existence, no
+matter what kind of file it be. If TYPE is specified, use one
+of the following values:
+
Ends script execution if FILE is not a directory. +
+When you verify directories with cli_checkFiles, if directory doesn't +exist, `centos-art.sh' script asks you for confirmation in order +to create that directory. If you answer positively, +`centos-art.sh' script creates that directory and continues +script flows normally. Otherwise, if you answer negatively, +`centos-art.sh' ends script execution with an error and +documentation message. +
+Ends script execution if FILE is not a regular file. +
Ends script execution if FILE is not a symbolic link. +
Ends script execution if FILE is not executable. +
Ends script execution if FILE is neither a regular file nor a +symbolic link. +
Ends script execution if FILE is neither a regular file nor a +directory. +
Ends script execution if FILE is not inside the working copy. +
As default behaviour, if FILE passes all verifications, +`centos-art.sh' script continues with its normal flow. +
Syncronize changes between repository and working copy. +
+The cli_commitRepoChanges
function brings changes from the
+central repository down to the working copy--using svn
+update
--, checks the working copy changes--using svn
+status
command--, prints status report--using both svn
+update
and svn status
commands output, and finally, commits
+recent changes from the working copy up to the repository--using
+svn commit
command--.
+
Previous to commit the working copy changes up to the central
+repository, the cli_commitRepoChanges
function asks you to
+verify changes--using svn diff
command--, and later,
+another confirmation question is shown to be sure you really want to
+commit changes up to central repository.
+
If LOCATION argument is not specified, the value of +ACTIONVAL variable is used as reference instead. +
+---------------------------------------------------------------------- +--> Bringing changes from the repository into the working copy +--> Checking changes in the working copy +---------------------------------------------------------------------- +Added 0 file from the repository. +Deleted 0 file from the repository. +Updated 0 file from the repository. +Conflicted 0 file from the repository. +Merged 0 file from the repository. +Modified 4 files from the working copy. +Unversioned 0 file from the working copy. +Deleted 0 file from the working copy. +Added 0 file from the working copy. +---------------------------------------------------------------------- ++
Figure 3.3: The cli_commitRepoChanges
function output.
+
+
Call the cli_commitRepoChanges
function before or/and after
+calling functions that modify files or directories inside the working
+copy as you may need to.
+
Redefine arguments (ARGUMENTS) global variable using
+getopt
command output. For more information about how to use
+cli_doParseArguments
function, see ARGUMENTS variable
+description above.
+
Initialize/reset arguments (ARGUMENTS) global variable using +positional parameters variable ($@) as reference. +
+When we work inside function definitions, positional parameters are
+reset to the last function definition positional parameters. If you
+need to redefine positional parameters from one specific function, you
+need to call cli_doParseArgumentsReDef
with the positional
+parameters variable ($@), set as first argument, to that
+specific function you want to redefine positional parameters at.
+
Initialize function name (FUNCNAM), action name +(ACTIONNAM), and action value (ACTIONVAL) global +variables, using positional parameters passed in $@ variable. +
+The cli_getArguments
function is called from cli.sh
+function script, using cli
function positional parameters
+(i.e., the positional parameters passed as arguments in the
+command-line) as first function argument.
+
Once command-line positional parameters are accesible to
+`centos-art.sh' script execution evironment,
+cli_getArguments
uses regular expression to retrive
+action variables from first and second argument. The first argument
+defines the value used as function name (FUNCNAM), and the
+second argument defines both values used as action name
+(ACTIONNAM) and action value (ACTIONVAL), respectively.
+
The first argument is a word in lower case. This word specifies the +name of the functionality you want to use (e.g., `render' to +render images, `manual' to work on documentation, and so on.) +
+The second argument has a long option style (e.g., +`--option=value'). The `--option' represents the action name +(ACTIONNAM), and the characters inbetween the equal sign +(`=') and the first space character, are considered as the action +value (ACTIONVAL). In order to provide action values with space +characters inbetween you need to enclose action value with quotes like +in `--option='This is long value with spaces inbetween''. +Generally, action values are used to specify paths over which the +action name acts on. +
+Once action related variables (i.e., FUNCNAM, ACTIONNAM,
+and ACTIONVAL) are defined and validated,
+cli_getArguments
shifts the positional arguments to remove the
+first two arguments passed (i.e., those used to retrive action related
+variables) and redefine the arguments (ARGUMENTS) global
+variable with the new positional parameters information.
+
Initialize funtionalities supported by `centos-art.sh' script. +
+Functionalities supported by `centos-art.sh' script are organized +in functionality directories under +`trunk/Scripts/Bash/Functions/' directory. Each functionality +directory stores function scripts to the functionality such directory +was created for. Function scripts contain function definitions. +Function definitions contain several commands focused on achieving one +specific task only (i.e., the one such functionality was created for). +
+In order for `centos-art.sh' script to recognize a functionality, +such functionality needs to be stored under +`trunk/Scripts/Bash/Functions/' in a directory written +capitalized (i.e., the whole name is written in lowercase except the +first character which is in uppercase). The directory where one +specific functionality is stored is known as the `functionality +directory'. +
+Inside each functionality directory, the functionalty itself is +implemented through function scripts. Function scripts are organized +in files independently one another and written in `camelCase' +format with the function name as prefix. Separation between prefix +and description is done using underscore (`_') character. +
+In order for `centos-art.sh' script to load functionalities +correctly, function definition inside function scripts should be set +using the `function' reserved word, just as in the following +example: +
+function prefix_doSomething { + + # Do something here... + +} ++
The above function definition is just a convenction we use, in order
+to make identification of function names easier read and automate by
+`centos-art.sh' script initialization commands, once
+`centos-art.sh' script determines which functionality directory
+to use. Specifically, in order to initialize and export functions,
+`centos-art.sh' script executes all function scripts inside the
+functionality directory, and later grep
on them using a
+regular expression pattern, where the `function' reserved word is
+used as reference to retrive the function names and export them to
+`centos-art.sh' script execution environment, and so, make
+function definitions --from function scripts inside the functionality
+directory-- available for further calls.
+
If the functionality specified in the command-line first argument +doesn't have a functionality directory, `centos-art.sh' script +considers the functionality provided in the command-line as invalid +functionality and immediatly stops script execution with an error +message. +
+In order to keep visual consistency among function scripts, please +consider using the following function script design model as template +for your own function scripts: +
+#!/bin/bash +# +# prefix_doSomething.sh -- This function illustrates function scripts +# design model you can use to create your own function scripts inside +# centos-art.sh script. +# +# Copyright (C) YEAR YOURFULLNAME +# +# 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$ +# ---------------------------------------------------------------------- + +function prefix_doSomething { + + # Do something here... + +} +
Output country codes supported by `centos-art.sh' script. +
+The cli_getCountryCodes
function outputs a list with country
+codes as defined in ISO3166 standard. When FILTER is provided,
+cli_getCountryCodes
outputs country codes that match
+FILTER regular expression pattern.
+
Outputs country name supported by `centos-art.sh' script. +
+The cli_getCountryName
function reads one language locale code
+in the format LL_CC and outputs the name of its related country as in
+ISO3166. If filter is specified, cli_getCountryName
returns the
+country name that matches the locale code specified in FILTER,
+exactly.
+
Output current locale used by `centos-art.sh' script. +
+The cli_getCurrentLocale
function uses LANG
environment
+variable to build a locale pattern that is later applied to
+cli_getLocales
function output in order to return the current
+locale that `centos-art.sh' script works with.
+
The current locale information, returned by
+cli_getCurrentLocale
, is output from more specific to less
+specific. For example, if `en_GB' locale exists in
+cli_getLocales
function output, the `en_GB' locale would
+take precedence before `en' locale.
+
Locale precedence selection is quite important in order to define the +locale type we use for message translations. For example, if +`en_GB' is used, we are also saying that the common language +specification for English language (i.e., `en') is no longer +used. Instead, we are using English non-common country-specific +language specifications like `en_AU', `en_BW', `en_GB', +`en_US', etc., for message translations. +
+Use cli_getCurrentLocale
function to know what current locale
+information to use inside `centos-art.sh' script.
+
Output list of files to process. +
+The cli_getFilesList
function uses LOCATION variable as
+source location to build a list of files just as specified by regular
+expression (REGEX) global variable. Essentially, what the
+cli_getFilesList
function does is using find
command
+to look for files in the location (LOCATION) just as posix-egrep
+regular expression (REGEX) specifies.
+
If LOCATION is not specified when cli_getFilesList
+function is called, the action value (ACTIONVAL) global variable
+is used as location value instead.
+
By default, if the regular expression (REGEX) global variable is
+not redefined after its first definition in the cli
function,
+all files that match default regular expression value (i.e.,
+`.+') will be added to the list of files to process. Otherwise,
+if you redefine the regular expression global variable after its first
+definition in the cli
function and before calling
+cli_getFilesList
function, the last value you specifed is used
+instead.
+
When you need to customize the regular expression (REGEX) global +variable value inside a function, do not redefine the global variable +(at least you be absolutly convinced you need to). Instead, set the +regular expression global variable as `local' to the function you +need a customized regular expression value for. If we don't redefine +the regular expression global variable as local to the function, or +use another name for the regular expression variable (which is not +very convenient in order to keep the amount of names to remember low), +you may experiment undesired concantenation issues that make your +regular expression to be something different from that you expect them +to be, specially if the function where you are doing the variable +redefinition is called several times during the same script execution. +
+As result, the cli_getFilesList
re-defines the value of
+FILES variable with the list of files the find
command
+returned. As example, consider the following construction:
+
function prefix_doSomething { + + # Initialize the list of files to process. + local FILES='' + + # Initialize location. + local LOCATION=/home/centos/artwork/trunk/Identity/Themes/Models/Default + + # Re-define regular expression to match scalable vector graphic + # files only. Note how we use the global value of REGEX to build a + # new local REGEX value here. + local REGEX="${REGEX}.*\.(svgz|svg)" + + # Redefine list of files to process. + cli_getFilesList $LOCATION + + # Process list of files. + for FILE in $FILES;do + cli_printMessages "$FILE" 'AsResponseLine' + # Do something else here on... + done + +} ++
Outputs language codes supported by `centos-art.sh' script. +
+cli_getLangCodes
function outputs a list of language codes as
+defined in ISO639 standard. When FILTER is provided,
+cli_getLangCodes
outputs language codes that match FILTER
+regular expression pattern.
+
Outputs language names supported by `centos-art.sh' script. +
+cli_getLangName
function reads one language locale code in the
+format LL_CC and outputs the language related name as in ISO639. If
+filter is specified, cli_getLangName
returns the language name
+that matches the locale code specified in FILTER, exactly.
+
Output locale codes supported by `centos-art.sh' script. +
+Occasionally, you use cli_getLocales
function to add locale
+information in non-common country-specific language (`LL_CC')
+format for those languages (e.g., `bn_IN', `pt_BR', etc.)
+which locale differences cannot be solved using common language
+specifications (`LL') into one unique common locale specification
+(e.g., `bn', `pt', etc.).
+
Sanitate file names. +
+Inside `centos-art.sh' script, specific functionalities rely both
+in cli_getRepoName
and repository file system organization to
+achieve their goals. Consider cli_getRepoName
function as
+central place to manage file name convenctions for other functions
+inside `centos-art.sh' script.
+
+ +Important
cli_getRepoName
function doesn't verify file +or directory existence, for that purpose usecli_checkFiles
+function instead. +
The NAME variable contains the file name or directory name you +want to sanitate. +
+The TYPE variable specifies what type of sanitation you want to +perform on NAME. The TYPE can be one of the following +values: +
+Sanitate directory NAMEs. +
Sanitate regular file NAMEs. +
Use cli_getRepoName
function to sanitate file names and
+directory names before their utilization.
+
Use cli_getRepoName
when you need to change file name
+convenctions inside `centos-art.sh' script.
+
When we change file name convenctions inside cli_getRepoName
+what we are really changing is the way functions interpret repository
+file system organization. Notice that when we change a file name
+(e.g., a function name), it is necessary to update all files where
+such file name is placed on. This may require a massive substitution
+inside the repository, each time we change name convenctions in the
+repository (-- Removed(pxref:trunk Scripts Bash Functions Path) --, for more
+information).
+
Request repository status. +
+This function requests the status of a LOCATION inside the
+working copy using the svn status
command and returns the
+first character in the output line, just as described in svn
+help status
. If LOCATION is not a regular file or a directory,
+inside the working copy, the `centos-art.sh' script prints a
+message and ends its execution.
+
Use this function to perform verifications based a repository +LOCATION status. +
Output absolute path to temporal file NAME. +
+The cli_getTemporalFile
function uses `/tmp' directory as
+source location to store temporal files, the `centos-art.sh'
+script name, and a random identification string to let you run more
+than one `centos-art.sh' script simultaneously on the same user
+session. For example, due the following temporal file defintion:
+
cli_getTemporalFile $FILE ++
If FILE name is `instance.svg' and the unique random string +is `f16f7b51-ac12-4b7f-9e66-72df847f12de', the final temporal +file, built from previous temporal file definition, would be: +
+/tmp/centos-art.sh-f16f7b51-ac12-4b7f-9e66-72df847f12de-instance.svg ++
When you use the cli_getTemporalFile
function to create
+temporal files, be sure to remove temporal files created once you've
+ended up with them. For example, consider the following construction:
+
for FILE in $FILES;do + + # Initialize temporal instance of file. + INSTANCE=$(cli_getTemporalFile $FILE) + + # Do something ... + + # Remove temporal instance of file. + if [[ -f $INSTANCE ]];then + rm $INSTANCE + fi + +done ++
Use the cli_getTemporalFile
function whenever you need to
+create temporal files inside `centos-art.sh' script.
+
Output theme name. +
+In order for cli_getThemeName
function to extract theme name
+correctly, the ACTIONVAL variable must contain a directory path
+under `trunk/Identity/Themes/Motifs/' directory structure.
+Otherwise, cli_getThemeName
returns an empty string.
+
Define standard output message definition supported by +`centos-art.sh' script. +
+When FORMAT is not specified, cli_printMessage
outputs
+information just as it was passed in MESSAGE variable.
+Otherwise, FORMAT can take one of the following values:
+
To print heading messages. +
---------------------------------------------------------------------- +$MESSAGE +---------------------------------------------------------------------- ++
To print warning messages. +
---------------------------------------------------------------------- +WARNING: $MESSAGE +---------------------------------------------------------------------- ++
To print note messages. +
---------------------------------------------------------------------- +NOTE: $MESSAGE +---------------------------------------------------------------------- ++
To print `Updating' messages on two-columns format. +
Updating $MESSAGE ++
To print `Removing' messages on two-columns format. +
Removing $MESSAGE ++
To print `Checking' messages on two-columns format. +
Checking $MESSAGE ++
To print `Creating' messages on two-columns format. +
Creating $MESSAGE ++
To print `Saved as' messages on two-columns format. +
Saved as $MESSAGE ++
To print `Linked to' messages on two-columns format. +
Linked to $MESSAGE ++
To print `Moved to' messages on two-columns format. +
Moved to $MESSAGE ++
To print `Translation' messages on two-columns format. +
Translation $MESSAGE ++
To print `Configuration' messages on two-columns format. +
Configuration $MESSAGE ++
To print response messages on one-column format. +
--> $MESSAGE ++
To print request messages on one-column format. Request messages +output messages with one colon (`:') and without trailing newline +(`\n') at message end. +
$MESSAGE: ++
To print `yes or no' request messages on one-column format. If
+something different from `y' is answered (when using
+en_US.UTF-8
locale), script execution ends immediatly.
+
$MESSAGE [y/N]: ++
When we use `centos-art.sh' script in a locale different from
+en_US.UTF-8
, confirmation answer may be different from
+`y'. For example, if you use es_ES.UTF-8
locale, the
+confirmation question would look like:
+
$MESSAGE [s/N]: ++
and the confirmation answer would be `s', as it is on Spanish +`sí' word. +
+Definition of which confirmation word to use is set on translation +messages for your specific locale information. -- Removed(xref:trunk Scripts +Bash Functions Locale) --, for more information about locale-specific +translation messages. +
+To standardize `to know more, run the following command:'
+messages. When the `AsToKnowMoreLine' option is used, the
+MESSAGE value should be set to "$(caller)"
. caller
+is a Bash builtin that returns the context of the current subroutine
+call. `AsToKnowMoreLine' option uses caller
builtin
+output to build documentation entries dynamically.
+
---------------------------------------------------------------------- +To know more, run the following command: +centos-art manual --read='path/to/dir' +---------------------------------------------------------------------- ++
Use `AsToKnowMoreLine' option after errors and for intentional +script termination. +
+To standardize regular messages on one-column format. +
+When MESSAGE contains a colon inside (e.g., `description:
+message'), the cli_printMessage
function outputs MESSAGE
+on two-columns format.
+
Use cli_printMessage
function whenever you need to output
+information from `centos-art.sh' script.
+
+Tip
To improve two-columns format, change the following file: +
trunk/Scripts/Bash/Styles/output_forTwoColumns.awk +
The following specific functions of `centos-art.sh' script, are +available for you to use: +
+ + +3.47 trunk/Scripts/Bash | + | |
3.60 trunk/Scripts/Bash/Locale | + |
[ < ] | -[ > ] | +||||||||||||||||||||||||||
[ < ] | +[ > ] | [ << ] | [ Up ] | diff --git a/Manuals/Filesystem/filesystem-html/filesystem_53.html b/Manuals/Filesystem/filesystem-html/filesystem_53.html index 527c72f..e0e1634 100644 --- a/Manuals/Filesystem/filesystem-html/filesystem_53.html +++ b/Manuals/Filesystem/filesystem-html/filesystem_53.html @@ -20,10 +20,10 @@ Send bugs and suggestions to
[ < ] | -[ > ] | +|||||
[ < ] | +[ > ] | [ << ] | [ Up ] | @@ -67,1292 +67,38 @@ ul.toc {list-style: none}[Index] | [ ? ] |
The `trunk/Scripts/Bash/Functions' directory exists to organize -`centos-art.sh' specific functionalities. -
- - -The specific functions of `centos-art.sh' script are designed -with "Software Toolbox" philosophy (see (coreutils.info)Toolbox introduction) in mind: each program "should do one -thing well". Inside `centos-art.sh' script, each specific -functionality is considered a program that should do one thing well. -Of course, if you find that they still don't do it, feel free to -improve them in order for them to do so. -
-The specific functions of `centos-art.sh' script are organized
-inside specific directories under `trunk/Scripts/Bash/Functions'
-location. Each specific function directory should be named as the
-function it represents, with the first letter in uppercase. For
-example, if the function name is render
, the specific function
-directory for it would be `trunk/Scripts/Bash/Functions/Render'.
-
To better understand how specific functions of `centos-art.sh' -script are designed, lets create one function which only goal is to -output different kind of greetings to your screen. -
-When we create specific functions for `centos-art.sh' script it -is crucial to know what these functions will do exactly and if there -is any function that already does what we intend to do. If there is no -one, it is good time to create them then. Otherwise, if -functionalities already available don't do what you exactly expect, -contact their authors and work together to improve them. -
-- -Tip
Join CentOS developers mailing list -centos-art@centos.org to share your ideas. -
It is also worth to know what global functions and variables do we -have available inside `centos-art.sh' script, so advantage can be -taken from them. Global variables are defined inside global function -scripts. Global functions scripts are stored immediatly under -`trunk/Scripts/Bash/Functions' directory, in files begining with -`cli' prefix. -
-OK, let's begin with our functionality example. -
-What function name do we use? Well, lets use greet
. Note that
-`hello' word is not a verb; but an expression, a kind of
-greeting, an interjection specifically. In contrast, `greet' is a
-verb and describes what we do when we say `Hello!', `Hi!',
-and similar expressions.
-
So far, we've gathered the following function information: -
-Name: greet -Path: trunk/Scripts/Bash/Functions/Greet -File: trunk/Scripts/Bash/Functions/Greet/greet.sh --
The `greet.sh' function script is the first file
-`centos-art.sh' script loads when the `greet' functionality
-is called using commands like `centos-art greet --hello='World''.
-The `greet.sh' function script contains the greet
function
-definition.
-
Inside `centos-art.sh' script, as convenction, each function -script has one top commentary, followed by one blank line, and then -one function defintion below it only. -
-Inside `centos-art.sh' script functions, top commentaries have
-the following components: the functionality description, one-line for
-copyright note with your personal information, the license under
-which the function source code is released --the `centos-art.sh'
-script is released as GPL, so do all its functions--, the $Id$
-keyword of Subversion is later expanded by svn propset
-command.
-
In our greet
function example, top commentary for
-`greet.sh' function script would look like the following:
-
#!/bin/bash -# -# greet.sh -- This function outputs different kind of greetings to -# your screen. Use this function to understand how centos-art.sh -# script specific functionalities work. -# -# Copyright (C) YEAR YOURFULLNAME -# -# 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$ -# ---------------------------------------------------------------------- --
After top commentary, separated by one blank line, the greet
-function definition would look like the following:
-
function greet { - - # Define global variables. - - # Define command-line interface. - greet_getActions - -} --
The first definition inside greet
function, are global
-variables that will be available along greet
function execution
-environment. This time we didn't use global variable definitions for
-greet
function execution environment, so we left that section
-empty.
-
Later, we call greet_getActions
function to define the
-command-line interface of greet
functionality. The command-line
-interface of greet
functionality defines what and how actions
-are performed, based on arguments combination passed to
-`centos-art.sh' script.
-
function greet_getActions { - - case "$ACTIONNAM" in - - --hello ) - greet_doHello - ;; - - --bye ) - greet_doBye - ;; - - * ) - cli_printMessage "`gettext "The option provided is not valid."`" - cli_printMessage "$(caller)" 'AsToKnowMoreLine' - - esac - -} --
The ACTIONNAM global variable is defined in `cli.sh' -function script and contains the value passed before the equal sign -(i.e., `=') in the second command-line argument of -`centos-art.sh' script. For example, if the second command-line -argument is `--hello='World'', the value of ACTIONNAM -variable would be `--hello'. Using this configuration let us -deside which action to perform based on the action name passed to -`centos-art.sh' script as second argument. -
-The greet
function definition makes available two valid
-greetings through `--hello' and `--bye' options. If no
-one of them is provided as second command-line argument, the `*'
-case is evaluated instead.
-
The `*' case and its two lines further on should always be -present in `_getActions.sh' function scripts, no matter what -specific functionality you are creating. This convenction helps the -user to find out documentation about current functionality in use, -when no valid action is provided. -
-The greet_doHello
and greet_doBye
function definitions
-are the core of greet
specific functionality. In such function
-definitions we set what our greet
function really does: to
-output different kinds of greetings.
-
function greet_doHello { - - cli_printMessage "`gettext "Hello"` $ACTIONVAL" - -} --
The greet_doHello
function definition is stored in
-`greet_doHello.sh' function script.
-
function greet_doBye { - - cli_printMessage "`gettext "Goodbye"` $ACTIONVAL" - -} --
The greet_doBye
function definition is stored in the
-`greet_doBye.sh' function script.
-
Both `greet_doHello.sh' and `greet_doBye.sh' function
-scripts are stored inside greet
function directory path (i.e.
-`trunk/Scripts/Bash/Functions/Greet').
-
The ACTIONVAL global variable is defined in `cli.sh' -function script and contains the value passed after the equal sign -(i.e., `=') in the second command-line argument of -`centos-art.sh' script. For example, if the second command-line -argument is `--hello='World'', the value of ACTIONVAL -variable would be `World' without quotes. -
-Let's see how greet
specific functionality files are organzied
-under greet
function directory. To see file organization we use
-the tree
command:
-
trunk/Scripts/Bash/Functions/Greet -|-- greet_doBye.sh -|-- greet_doHello.sh -|-- greet_getActions.sh -`-- greet.sh --
To try the greet
specific functionality we've just created,
-pass the function name (i.e., `greet') as first argument to
-`centos-art.sh' script, and any of the valid options as second
-argument. Some examples are illustrated below:
-
[centos@projects ~]$ centos-art greet --hello='World' -Hello World -[centos@projects ~]$ centos-art greet --bye='World' -Goodbye World -[centos@projects ~]$ --
The word `World' in the examples above can be anything. In fact, -change it to have a little fun. -
-Now that we have a specific function that works as we expect, it is
-time to document it. To document greet
specific functionality,
-we use its directory path and the manual
functionality
-(see section trunk/Scripts/Bash/Functions/Manual) of `centos-art.sh'
-script, just as the following command illustrates:
-
centos-art manual --edit=trunk/Scripts/Bash/Functions/Greet --
To have a well documented function helps user to understand how your -function really works, and how it should be used. When no valid -action is passed to a function, the `centos-art.sh' script uses -the function documentation entry as vehicle to communicate which the -valid functions are. When no documentation entry exists for a -function, the `centos-art.sh' script informs that no -documentation entry exists for such function and requests user to -create it right at that time. -
-Now that we have documented our function, it is time to translate its
-output messages to different languages. To translate specific
-functionality output messages to different languages we use the
-locale
functionality (see section trunk/Scripts/Bash/Functions/Locale) of `centos-art.sh' script, just as the following command
-illustrates:
-
centos-art locale --edit --
- -Warning
To translate output messages in different languages, -your system locale information --as in
LANG
environment -variable-- must be set to that locale you want to produce translated -messages for. For example, if you want to produce translated messages -for Spanish language, your system locale information must be set to -`es_ES.UTF-8', or similar, first. -
Well, it seems that our example is rather complete by now. -
-In greet
function example we've described so far, we only use
-cli_printMessage
global function in action specific function
-definitions in order to print messages, but more interesting things
-can be achieved inside action specific function definitions. For
-example, if you pass a directory path as action value in second
-argument, you could retrive a list of files from therein, and process
-them. If the list of files turns too long or you just want to control
-which files to process, you could add the third argument in the form
-`--filter='regex'' and reduce the amount of files to process
-using a regular expression pattern.
-
The greet
function described in this section may serve you as
-an introduction to understand how specific functionalities work inside
-`centos-art.sh' script. With some of luck this introduction will
-also serve you as motivation to create your own `centos-art.sh'
-script specific functionalities.
-
By the way, the greet
functionality doesn't exist inside
-`centos-art.sh' script yet. Would you like to create it?
-
The following global variables of `centos-art.sh' script, are -available for you to use inside specific functions: -
-Default domain used to retrieve translated messages. This value is set -in `initFunctions.sh' and shouldn't be changed. -
Default directory used to retrieve translated messages. This value is -set in `initFunctions.sh' and shouldn't be changed. -
Define function name. -
-Function names associate sets of actions. There is one set of actions -for each unique function name inside `centos-art.sh' script. -
-Dunction names are passed as first argument in `centos-art.sh' -command-line interface. For example, in the command `centos-art -render --entry=path/to/dir --filter=regex', the ACTION passed to -`centos-art.sh' script is `render'. -
-When first argument is not provided, the `centos-art.sh' script -immediatly ends its execution. -
Define action name. -
-Each action name identifies an specific action to perform, inside an -specific function. -
-Action name names aare passed as second argument in -`centos-art.sh' command-line interface. For example, in the -command `centos-art render --entry=path/to/dir --filter=regex', -the ACTIONNAM passed to `centos-art.sh' script is -`--entry'. -
-When second argument is not provided, the `centos-art.sh' script -immediatly ends its execution. -
Define action value. -
-Action values are associated to just one action name. Action values -contain the working copy entry over which its associated action will be -performed in. Working copy entries can be files or directories inside -the working copy. -
Define regular expression used as pattern to build the list of files -to process. -
-By default, REGEX variable is set to .+
to match all
-files.
-
Functions that need to build a list of files to process use the option -`--filter' to redefine REGEX variable default value, and -so, control the amount of files to process. -
Define optional arguments. -
-Optional arguments, inside `centos-art.sh' script, are considered -as all command-line arguments passed to `centos-art.sh' script, -from third argument position on. For example, in the command -`centos-art render --entry=path/to/dir --filter=regex' , the -optional arguments are from `--filter=regex' argument on. -
-Optional arguments are parsed using getopt
command through
-the following base construction:
-
# Define short options we want to support. -local ARGSS="" - -# Define long options we want to support. -local ARGSL="filter:,to:" - -# Parse arguments using getopt(1) command parser. -cli_doParseArguments - -# Reset positional parameters using output from (getopt) argument -# parser. -eval set -- "$ARGUMENTS" - -# Define action to take for each option passed. -while true; do - case "$1" in - --filter ) - REGEX="$2" - shift 2 - ;; - --to ) - TARGET="$2" - shift 2 - ;; - * ) - break - esac -done --
Optional arguments provide support to command options inside
-`centos-art.sh' script. For instance, consider the Subversion
-(svn
) command, where there are many options (e.g.,
-`copy', `delete', `move', etc), and inside each
-option there are several modifiers (e.g., `--revision',
-`--message', `--username', etc.) that can be combined one
-another in their short or long variants.
-
The ARGUMENTS variable is used to store arguments passed from -command-line for later use inside `centos-art.sh' script. Storing -arguments is specially useful when we want to run a command with some -specific options from them. Consider the following command: -
-centos-art path --copy=SOURCE --to=TARGET --message="The commit message goes here." --username='johndoe' --
In the above command, the `--message', and `--username'
-options are specific to svn copy
command. In such cases,
-options are not interpreted by `centos-art.sh' script itself.
-Instead, the `centos-art.sh' script uses getopt
to
-retrive them and store them in the ARGUMENTS variable for later
-use, as described in the following command:
-
# Build subversion command to duplicate locations inside the -# workstation. -eval svn copy $SOURCE $TARGET --quiet $ARGUMENTS --
When getopt
parses ARGUMENTS, we may use short options
-(e.g., `-m') or long options (e.g., `--message'). When
-we use short options, arguments are separated by one space from the
-option (e.g., `-m 'This is a commit message.''). When we use
-long options arguments are separated by an equal sign (`=')
-(e.g., `--message='This is a commit message'').
-
In order for getopt
to parse ARGUMENTS correctly, it
-is required to provide the short and long definition of options that
-will be passed or at least supported by the command performing the
-final action the function script exists for.
-
As convenction, inside `centos-art.sh' script, short option -definitions are set in the ARGSS variable; and long option -definitions are set in the ARGSL variable. -
-When you define short and long options, it may be needed to define -which of these option arguments are required and which not. To define -an option argument as required, you need to set one colon `:' -after the option definition (e.g., `-o m: -l message:'). On -the other hand, to define an option argument as not required, you need -to set two colons `::' after the option definition (e.g., -`-o m:: -l message::'). -
Default text editor. -
-The `centos-art.sh' script uses default text EDITOR
to edit
-pre-commit subversion messages, translation files, configuration
-files, script files, and similar text-based files.
-
If EDITOR
environment variable is not set, `centos-art.sh'
-script uses `/usr/bin/vim' as default text editor. Otherwise, the
-following values are recognized by `centos-art.sh' script:
-
If no one of these values is set in EDITOR
environment variable,
-`centos-art.sh' uses `/usr/bin/vim' text editor by default.
-
Function scripts stored directly under -`trunk/Scripts/Bash/Functions/' directory are used to define -global functions. Global functions can be used inside action specific -functionalities and or even be reused inside themselves. This section -provides introductory information to global functions you can use -inside `centos-art.sh' script. -
-Validate action value (ACTIONVAL) variable. -
-The action value variable can take one of the following values: -
-If another value different from that specified above is passed to -action value variable, the `centos-art.sh' script prints an error -message and ends script execution. -
Verify file existence. -
-cli_checkFiles
receives a FILE absolute path and performs
-file verification as specified in TYPE. When TYPE is not
-specified, cli_checkFiles
verifies FILE existence, no
-matter what kind of file it be. If TYPE is specified, use one
-of the following values:
-
Ends script execution if FILE is not a directory. -
-When you verify directories with cli_checkFiles, if directory doesn't -exist, `centos-art.sh' script asks you for confirmation in order -to create that directory. If you answer positively, -`centos-art.sh' script creates that directory and continues -script flows normally. Otherwise, if you answer negatively, -`centos-art.sh' ends script execution with an error and -documentation message. -
-Ends script execution if FILE is not a regular file. -
Ends script execution if FILE is not a symbolic link. -
Ends script execution if FILE is not executable. -
Ends script execution if FILE is neither a regular file nor a -symbolic link. -
Ends script execution if FILE is neither a regular file nor a -directory. -
Ends script execution if FILE is not inside the working copy. -
As default behaviour, if FILE passes all verifications, -`centos-art.sh' script continues with its normal flow. -
Syncronize changes between repository and working copy. -
-The cli_commitRepoChanges
function brings changes from the
-central repository down to the working copy--using svn
-update
--, checks the working copy changes--using svn
-status
command--, prints status report--using both svn
-update
and svn status
commands output, and finally, commits
-recent changes from the working copy up to the repository--using
-svn commit
command--.
-
Previous to commit the working copy changes up to the central
-repository, the cli_commitRepoChanges
function asks you to
-verify changes--using svn diff
command--, and later,
-another confirmation question is shown to be sure you really want to
-commit changes up to central repository.
-
If LOCATION argument is not specified, the value of -ACTIONVAL variable is used as reference instead. -
----------------------------------------------------------------------- ---> Bringing changes from the repository into the working copy ---> Checking changes in the working copy ----------------------------------------------------------------------- -Added 0 file from the repository. -Deleted 0 file from the repository. -Updated 0 file from the repository. -Conflicted 0 file from the repository. -Merged 0 file from the repository. -Modified 4 files from the working copy. -Unversioned 0 file from the working copy. -Deleted 0 file from the working copy. -Added 0 file from the working copy. ----------------------------------------------------------------------- --
Figure 3.3: The cli_commitRepoChanges
function output.
-
-
Call the cli_commitRepoChanges
function before or/and after
-calling functions that modify files or directories inside the working
-copy as you may need to.
-
Redefine arguments (ARGUMENTS) global variable using
-getopt
command output. For more information about how to use
-cli_doParseArguments
function, see ARGUMENTS variable
-description above.
-
Initialize/reset arguments (ARGUMENTS) global variable using -positional parameters variable ($@) as reference. -
-When we work inside function definitions, positional parameters are
-reset to the last function definition positional parameters. If you
-need to redefine positional parameters from one specific function, you
-need to call cli_doParseArgumentsReDef
with the positional
-parameters variable ($@), set as first argument, to that
-specific function you want to redefine positional parameters at.
-
Initialize function name (FUNCNAM), action name -(ACTIONNAM), and action value (ACTIONVAL) global -variables, using positional parameters passed in $@ variable. -
-The cli_getArguments
function is called from cli.sh
-function script, using cli
function positional parameters
-(i.e., the positional parameters passed as arguments in the
-command-line) as first function argument.
-
Once command-line positional parameters are accesible to
-`centos-art.sh' script execution evironment,
-cli_getArguments
uses regular expression to retrive
-action variables from first and second argument. The first argument
-defines the value used as function name (FUNCNAM), and the
-second argument defines both values used as action name
-(ACTIONNAM) and action value (ACTIONVAL), respectively.
-
The first argument is a word in lower case. This word specifies the -name of the functionality you want to use (e.g., `render' to -render images, `manual' to work on documentation, and so on.) -
-The second argument has a long option style (e.g., -`--option=value'). The `--option' represents the action name -(ACTIONNAM), and the characters inbetween the equal sign -(`=') and the first space character, are considered as the action -value (ACTIONVAL). In order to provide action values with space -characters inbetween you need to enclose action value with quotes like -in `--option='This is long value with spaces inbetween''. -Generally, action values are used to specify paths over which the -action name acts on. -
-Once action related variables (i.e., FUNCNAM, ACTIONNAM,
-and ACTIONVAL) are defined and validated,
-cli_getArguments
shifts the positional arguments to remove the
-first two arguments passed (i.e., those used to retrive action related
-variables) and redefine the arguments (ARGUMENTS) global
-variable with the new positional parameters information.
-
Initialize funtionalities supported by `centos-art.sh' script. -
-Functionalities supported by `centos-art.sh' script are organized -in functionality directories under -`trunk/Scripts/Bash/Functions/' directory. Each functionality -directory stores function scripts to the functionality such directory -was created for. Function scripts contain function definitions. -Function definitions contain several commands focused on achieving one -specific task only (i.e., the one such functionality was created for). -
-In order for `centos-art.sh' script to recognize a functionality, -such functionality needs to be stored under -`trunk/Scripts/Bash/Functions/' in a directory written -capitalized (i.e., the whole name is written in lowercase except the -first character which is in uppercase). The directory where one -specific functionality is stored is known as the `functionality -directory'. -
-Inside each functionality directory, the functionalty itself is -implemented through function scripts. Function scripts are organized -in files independently one another and written in `camelCase' -format with the function name as prefix. Separation between prefix -and description is done using underscore (`_') character. -
-In order for `centos-art.sh' script to load functionalities -correctly, function definition inside function scripts should be set -using the `function' reserved word, just as in the following -example: -
-function prefix_doSomething { - - # Do something here... - -} --
The above function definition is just a convenction we use, in order
-to make identification of function names easier read and automate by
-`centos-art.sh' script initialization commands, once
-`centos-art.sh' script determines which functionality directory
-to use. Specifically, in order to initialize and export functions,
-`centos-art.sh' script executes all function scripts inside the
-functionality directory, and later grep
on them using a
-regular expression pattern, where the `function' reserved word is
-used as reference to retrive the function names and export them to
-`centos-art.sh' script execution environment, and so, make
-function definitions --from function scripts inside the functionality
-directory-- available for further calls.
-
If the functionality specified in the command-line first argument -doesn't have a functionality directory, `centos-art.sh' script -considers the functionality provided in the command-line as invalid -functionality and immediatly stops script execution with an error -message. -
-In order to keep visual consistency among function scripts, please -consider using the following function script design model as template -for your own function scripts: -
-#!/bin/bash -# -# prefix_doSomething.sh -- This function illustrates function scripts -# design model you can use to create your own function scripts inside -# centos-art.sh script. -# -# Copyright (C) YEAR YOURFULLNAME -# -# 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$ -# ---------------------------------------------------------------------- - -function prefix_doSomething { - - # Do something here... - -} -
Output country codes supported by `centos-art.sh' script. -
-The cli_getCountryCodes
function outputs a list with country
-codes as defined in ISO3166 standard. When FILTER is provided,
-cli_getCountryCodes
outputs country codes that match
-FILTER regular expression pattern.
-
Outputs country name supported by `centos-art.sh' script. -
-The cli_getCountryName
function reads one language locale code
-in the format LL_CC and outputs the name of its related country as in
-ISO3166. If filter is specified, cli_getCountryName
returns the
-country name that matches the locale code specified in FILTER,
-exactly.
-
Output current locale used by `centos-art.sh' script. -
-The cli_getCurrentLocale
function uses LANG
environment
-variable to build a locale pattern that is later applied to
-cli_getLocales
function output in order to return the current
-locale that `centos-art.sh' script works with.
-
The current locale information, returned by
-cli_getCurrentLocale
, is output from more specific to less
-specific. For example, if `en_GB' locale exists in
-cli_getLocales
function output, the `en_GB' locale would
-take precedence before `en' locale.
-
Locale precedence selection is quite important in order to define the -locale type we use for message translations. For example, if -`en_GB' is used, we are also saying that the common language -specification for English language (i.e., `en') is no longer -used. Instead, we are using English non-common country-specific -language specifications like `en_AU', `en_BW', `en_GB', -`en_US', etc., for message translations. -
-Use cli_getCurrentLocale
function to know what current locale
-information to use inside `centos-art.sh' script.
-
Output list of files to process. -
-The cli_getFilesList
function uses LOCATION variable as
-source location to build a list of files just as specified by regular
-expression (REGEX) global variable. Essentially, what the
-cli_getFilesList
function does is using find
command
-to look for files in the location (LOCATION) just as posix-egrep
-regular expression (REGEX) specifies.
-
If LOCATION is not specified when cli_getFilesList
-function is called, the action value (ACTIONVAL) global variable
-is used as location value instead.
-
By default, if the regular expression (REGEX) global variable is
-not redefined after its first definition in the cli
function,
-all files that match default regular expression value (i.e.,
-`.+') will be added to the list of files to process. Otherwise,
-if you redefine the regular expression global variable after its first
-definition in the cli
function and before calling
-cli_getFilesList
function, the last value you specifed is used
-instead.
-
When you need to customize the regular expression (REGEX) global -variable value inside a function, do not redefine the global variable -(at least you be absolutly convinced you need to). Instead, set the -regular expression global variable as `local' to the function you -need a customized regular expression value for. If we don't redefine -the regular expression global variable as local to the function, or -use another name for the regular expression variable (which is not -very convenient in order to keep the amount of names to remember low), -you may experiment undesired concantenation issues that make your -regular expression to be something different from that you expect them -to be, specially if the function where you are doing the variable -redefinition is called several times during the same script execution. -
-As result, the cli_getFilesList
re-defines the value of
-FILES variable with the list of files the find
command
-returned. As example, consider the following construction:
-
function prefix_doSomething { - - # Initialize the list of files to process. - local FILES='' - - # Initialize location. - local LOCATION=/home/centos/artwork/trunk/Identity/Themes/Models/Default - - # Re-define regular expression to match scalable vector graphic - # files only. Note how we use the global value of REGEX to build a - # new local REGEX value here. - local REGEX="${REGEX}.*\.(svgz|svg)" - - # Redefine list of files to process. - cli_getFilesList $LOCATION - - # Process list of files. - for FILE in $FILES;do - cli_printMessages "$FILE" 'AsResponseLine' - # Do something else here on... - done - -} --
Outputs language codes supported by `centos-art.sh' script. -
-cli_getLangCodes
function outputs a list of language codes as
-defined in ISO639 standard. When FILTER is provided,
-cli_getLangCodes
outputs language codes that match FILTER
-regular expression pattern.
-
Outputs language names supported by `centos-art.sh' script. -
-cli_getLangName
function reads one language locale code in the
-format LL_CC and outputs the language related name as in ISO639. If
-filter is specified, cli_getLangName
returns the language name
-that matches the locale code specified in FILTER, exactly.
-
Output locale codes supported by `centos-art.sh' script. -
-Occasionally, you use cli_getLocales
function to add locale
-information in non-common country-specific language (`LL_CC')
-format for those languages (e.g., `bn_IN', `pt_BR', etc.)
-which locale differences cannot be solved using common language
-specifications (`LL') into one unique common locale specification
-(e.g., `bn', `pt', etc.).
-
Sanitate file names. -
-Inside `centos-art.sh' script, specific functionalities rely both
-in cli_getRepoName
and repository file system organization to
-achieve their goals. Consider cli_getRepoName
function as
-central place to manage file name convenctions for other functions
-inside `centos-art.sh' script.
-
- -Important
cli_getRepoName
function doesn't verify file -or directory existence, for that purpose usecli_checkFiles
-function instead. -
The NAME variable contains the file name or directory name you -want to sanitate. -
-The TYPE variable specifies what type of sanitation you want to -perform on NAME. The TYPE can be one of the following -values: -
-Sanitate directory NAMEs. -
Sanitate regular file NAMEs. -
Use cli_getRepoName
function to sanitate file names and
-directory names before their utilization.
-
Use cli_getRepoName
when you need to change file name
-convenctions inside `centos-art.sh' script.
-
When we change file name convenctions inside cli_getRepoName
-what we are really changing is the way functions interpret repository
-file system organization. Notice that when we change a file name
-(e.g., a function name), it is necessary to update all files where
-such file name is placed on. This may require a massive substitution
-inside the repository, each time we change name convenctions in the
-repository (see section trunk/Scripts/Bash/Functions/Path, for more
-information).
-
Request repository status. -
-This function requests the status of a LOCATION inside the
-working copy using the svn status
command and returns the
-first character in the output line, just as described in svn
-help status
. If LOCATION is not a regular file or a directory,
-inside the working copy, the `centos-art.sh' script prints a
-message and ends its execution.
-
Use this function to perform verifications based a repository -LOCATION status. -
Output absolute path to temporal file NAME. -
-The cli_getTemporalFile
function uses `/tmp' directory as
-source location to store temporal files, the `centos-art.sh'
-script name, and a random identification string to let you run more
-than one `centos-art.sh' script simultaneously on the same user
-session. For example, due the following temporal file defintion:
-
cli_getTemporalFile $FILE --
If FILE name is `instance.svg' and the unique random string -is `f16f7b51-ac12-4b7f-9e66-72df847f12de', the final temporal -file, built from previous temporal file definition, would be: -
-/tmp/centos-art.sh-f16f7b51-ac12-4b7f-9e66-72df847f12de-instance.svg --
When you use the cli_getTemporalFile
function to create
-temporal files, be sure to remove temporal files created once you've
-ended up with them. For example, consider the following construction:
-
for FILE in $FILES;do - - # Initialize temporal instance of file. - INSTANCE=$(cli_getTemporalFile $FILE) - - # Do something ... - - # Remove temporal instance of file. - if [[ -f $INSTANCE ]];then - rm $INSTANCE - fi - -done --
Use the cli_getTemporalFile
function whenever you need to
-create temporal files inside `centos-art.sh' script.
-
Output theme name. -
-In order for cli_getThemeName
function to extract theme name
-correctly, the ACTIONVAL variable must contain a directory path
-under `trunk/Identity/Themes/Motifs/' directory structure.
-Otherwise, cli_getThemeName
returns an empty string.
-
Define standard output message definition supported by -`centos-art.sh' script. -
-When FORMAT is not specified, cli_printMessage
outputs
-information just as it was passed in MESSAGE variable.
-Otherwise, FORMAT can take one of the following values:
-
To print heading messages. -
---------------------------------------------------------------------- -$MESSAGE ----------------------------------------------------------------------- --
To print warning messages. -
---------------------------------------------------------------------- -WARNING: $MESSAGE ----------------------------------------------------------------------- --
To print note messages. -
---------------------------------------------------------------------- -NOTE: $MESSAGE ----------------------------------------------------------------------- --
To print `Updating' messages on two-columns format. -
Updating $MESSAGE --
To print `Removing' messages on two-columns format. -
Removing $MESSAGE --
To print `Checking' messages on two-columns format. -
Checking $MESSAGE --
To print `Creating' messages on two-columns format. -
Creating $MESSAGE --
To print `Saved as' messages on two-columns format. -
Saved as $MESSAGE --
To print `Linked to' messages on two-columns format. -
Linked to $MESSAGE --
To print `Moved to' messages on two-columns format. -
Moved to $MESSAGE --
To print `Translation' messages on two-columns format. -
Translation $MESSAGE --
To print `Configuration' messages on two-columns format. -
Configuration $MESSAGE --
To print response messages on one-column format. -
--> $MESSAGE --
To print request messages on one-column format. Request messages -output messages with one colon (`:') and without trailing newline -(`\n') at message end. -
$MESSAGE: --
To print `yes or no' request messages on one-column format. If
-something different from `y' is answered (when using
-en_US.UTF-8
locale), script execution ends immediatly.
-
$MESSAGE [y/N]: --
When we use `centos-art.sh' script in a locale different from
-en_US.UTF-8
, confirmation answer may be different from
-`y'. For example, if you use es_ES.UTF-8
locale, the
-confirmation question would look like:
-
$MESSAGE [s/N]: --
and the confirmation answer would be `s', as it is on Spanish -`sí' word. -
-Definition of which confirmation word to use is set on translation -messages for your specific locale information. See section trunk/Scripts/Bash/Functions/Locale, for more information about locale-specific -translation messages. -
-To standardize `to know more, run the following command:'
-messages. When the `AsToKnowMoreLine' option is used, the
-MESSAGE value should be set to "$(caller)"
. caller
-is a Bash builtin that returns the context of the current subroutine
-call. `AsToKnowMoreLine' option uses caller
builtin
-output to build documentation entries dynamically.
-
---------------------------------------------------------------------- -To know more, run the following command: -centos-art manual --read='path/to/dir' ----------------------------------------------------------------------- --
Use `AsToKnowMoreLine' option after errors and for intentional -script termination. -
-To standardize regular messages on one-column format. -
-When MESSAGE contains a colon inside (e.g., `description:
-message'), the cli_printMessage
function outputs MESSAGE
-on two-columns format.
-
Use cli_printMessage
function whenever you need to output
-information from `centos-art.sh' script.
-
-Tip
To improve two-columns format, change the following file: -
trunk/Scripts/Bash/Styles/output_forTwoColumns.awk -
The following specific functions of `centos-art.sh' script, are -available for you to use: -
-3.47 trunk/Scripts/Bash | - | |
3.60 trunk/Scripts/Bash/Locale | - |
[ > ] | [ << ] | -[ Up ] | +[ Up ] | [ >> ] |
diff --git a/Manuals/Filesystem/filesystem-html/filesystem_54.html b/Manuals/Filesystem/filesystem-html/filesystem_54.html
index 9efa026..81600d9 100644
--- a/Manuals/Filesystem/filesystem-html/filesystem_54.html
+++ b/Manuals/Filesystem/filesystem-html/filesystem_54.html
@@ -20,10 +20,10 @@ Send bugs and suggestions to [Index]
[ ? ]
3.47 trunk/Scripts/Bash | ||
3.50 trunk/Scripts/Bash/Functions | - |
The render
functionality exists to produce both identity and
translation files on different levels of information (i.e., different
@@ -180,7 +180,8 @@ produce image-based content, `centos-art.sh' produces
PNG (Portable Network Graphics) files with the .png
extension. Once the base image format has been produced, it is
possible for `centos-art.sh' to use it in order to automatically
-create other image formats that may be needed (see section trunk/Scripts/Bash/Functions/Render/Config).
+create other image formats that may be needed (-- Removed(pxref:trunk Scripts
+Bash Functions Render Config) --).
Inside the working copy, you can find an example of "design template without translation" configuration at `trunk/Identity/Models/'. @@ -288,7 +289,7 @@ design template instance is removed. At this point, whole production flow once again (design template by design template), until all design templates be processed.
-See section trunk/Scripts/Bash/Functions/Render/Config, for more +
-- Removed(xref:trunk Scripts Bash Functions Render Config) --, for more information.
@@ -799,10 +800,6 @@ have been duplicated, the functionality stops thereat.3.56 trunk/Scripts/Bash/Functions/Render/Config | - |
[Index] | [ ? ] |
Note
See section trunk/Scripts/Bash/Functions/Render, to know more +
@@ -265,10 +265,6 @@ directory path under `trunk/Identity' orNote
-- Removed(xref:trunk Scripts Bash Functions Render) --, to know more about possible values for `BASE', `POST' and `LAST' action definitions.
diff --git a/Manuals/Filesystem/filesystem-html/filesystem_60.html b/Manuals/Filesystem/filesystem-html/filesystem_60.html index 1ae9ba0..3710232 100644 --- a/Manuals/Filesystem/filesystem-html/filesystem_60.html +++ b/Manuals/Filesystem/filesystem-html/filesystem_60.html @@ -20,10 +20,10 @@ Send bugs and suggestions to
- 3.47 trunk/Scripts/Bash - 3.50 trunk/Scripts/Bash/Functions - 3.55 trunk/Scripts/Bash/Functions/Render - --> - CentOS Artwork Repository - Filesystem: 3.57 trunk/Scripts/Bash/Functions/Shell +CentOS Artwork Repository - Filesystem: 3.57 trunk/Scripts/Bash/centos-art/Functions/Shell - - + + @@ -67,9 +67,9 @@ ul.toc {list-style: none}[Index] [ ? ] - + -3.57 trunk/Scripts/Bash/Functions/Shell
+3.57 trunk/Scripts/Bash/centos-art/Functions/Shell
@@ -255,8 +255,6 @@ list of files to process.diff --git a/Manuals/Filesystem/filesystem-html/filesystem_61.html b/Manuals/Filesystem/filesystem-html/filesystem_61.html index d6871ed..792426f 100644 --- a/Manuals/Filesystem/filesystem-html/filesystem_61.html +++ b/Manuals/Filesystem/filesystem-html/filesystem_61.html @@ -20,10 +20,10 @@ Send bugs and suggestions to
- 3.47 trunk/Scripts/Bash 3.50 trunk/Scripts/Bash/Functions - --> - CentOS Artwork Repository - Filesystem: 3.58 trunk/Scripts/Bash/Functions/Svg +CentOS Artwork Repository - Filesystem: 3.58 trunk/Scripts/Bash/centos-art/Functions/Svg - - + + @@ -67,9 +67,9 @@ ul.toc {list-style: none}[Index] [ ? ] - + -3.58 trunk/Scripts/Bash/Functions/Svg
+3.58 trunk/Scripts/Bash/centos-art/Functions/Svg
@@ -287,8 +287,6 @@ list of files to process.diff --git a/Manuals/Filesystem/filesystem-html/filesystem_62.html b/Manuals/Filesystem/filesystem-html/filesystem_62.html index c79eca3..4d52d15 100644 --- a/Manuals/Filesystem/filesystem-html/filesystem_62.html +++ b/Manuals/Filesystem/filesystem-html/filesystem_62.html @@ -20,10 +20,10 @@ Send bugs and suggestions to
- 3.47 trunk/Scripts/Bash 3.50 trunk/Scripts/Bash/Functions - --> - CentOS Artwork Repository - Filesystem: 3.59 trunk/Scripts/Bash/Functions/Verify +CentOS Artwork Repository - Filesystem: 3.59 trunk/Scripts/Bash/centos-art/Functions/Verify - - + + @@ -67,9 +67,9 @@ ul.toc {list-style: none}[Index] [ ? ] - + -3.59 trunk/Scripts/Bash/Functions/Verify
+3.59 trunk/Scripts/Bash/centos-art/Functions/Verify
@@ -334,8 +334,6 @@ provided at all.diff --git a/Manuals/Filesystem/filesystem-html/filesystem_63.html b/Manuals/Filesystem/filesystem-html/filesystem_63.html index 37e530b..f55d5c1 100644 --- a/Manuals/Filesystem/filesystem-html/filesystem_63.html +++ b/Manuals/Filesystem/filesystem-html/filesystem_63.html @@ -85,7 +85,7 @@ used by `centos-art.sh' script.
- 3.47 trunk/Scripts/Bash 3.50 trunk/Scripts/Bash/Functions - Translated messages of `centos-art.sh' script are managed using GNU
@@ -93,7 +93,8 @@ automated through `centos-art.sh' script "locale" functionaligettext
utilities. Most translation actions have been automated through `centos-art.sh' script "locale" functionality -(see section trunk/Scripts/Bash/Functions/Locale). +(-- Removed(pxref:trunk Scripts Bash Functions Locale) --).The content of `trunk/Scripts/Bash/Locale' directory should not be managed manually. Instead, use the "locale" functionality of -`centos-art.sh' script. See section trunk/Scripts/Bash/Functions/Locale, for more information on how to use `centos-art.sh' +`centos-art.sh' script. -- Removed(xref:trunk Scripts Bash Functions +Locale) --, for more information on how to use `centos-art.sh' "locale" functionality.
@@ -101,8 +102,6 @@ be managed manually. Instead, use the "locale" functionality of3.60.4 See also
-
diff --git a/Manuals/Filesystem/filesystem-html/filesystem_66.html b/Manuals/Filesystem/filesystem-html/filesystem_66.html index 512bc36..f751c83 100644 --- a/Manuals/Filesystem/filesystem-html/filesystem_66.html +++ b/Manuals/Filesystem/filesystem-html/filesystem_66.html @@ -148,16 +148,16 @@ ul.toc {list-style: none}3.50 trunk/Scripts/Bash/Functions - 3.46 trunk/Scripts trunk Scripts Bash 3.47 trunk/Scripts/Bash trunk Scripts Bash centos-art 3.48 trunk/Scripts/Bash/centos-art - trunk Scripts Bash centos-art Functions 3.49 trunk/Scripts/Bash/centos-art/Functions - trunk Scripts Bash Functions 3.50 trunk/Scripts/Bash/Functions - trunk Scripts Bash Functions Html 3.51 trunk/Scripts/Bash/Functions/Html - trunk Scripts Bash Functions Locale 3.52 trunk/Scripts/Bash/Functions/Locale - trunk Scripts Bash Functions Manual 3.53 trunk/Scripts/Bash/Functions/Manual - trunk Scripts Bash Functions Path 3.54 trunk/Scripts/Bash/Functions/Path - trunk Scripts Bash Functions Render 3.55 trunk/Scripts/Bash/Functions/Render - trunk Scripts Bash Functions Render Config 3.56 trunk/Scripts/Bash/Functions/Render/Config - trunk Scripts Bash Functions Shell 3.57 trunk/Scripts/Bash/Functions/Shell - trunk Scripts Bash Functions Svg 3.58 trunk/Scripts/Bash/Functions/Svg + trunk Scripts Bash Functions Verify 3.59 trunk/Scripts/Bash/Functions/Verify + trunk Scripts Bash centos-art Functions Help 3.50 trunk/Scripts/Bash/centos-art/Functions/Help + trunk Scripts Bash centos-art Functions Html 3.51 trunk/Scripts/Bash/centos-art/Functions/Html + trunk Scripts Bash centos-art Functions Locale 3.52 trunk/Scripts/Bash/centos-art/Functions/Locale + trunk Scripts Bash centos-art Functions Manual 3.53 trunk/Scripts/Bash/centos-art/Functions/Manual + trunk Scripts Bash centos-art Functions Path 3.54 trunk/Scripts/Bash/centos-art/Functions/Path + trunk Scripts Bash centos-art Functions Render 3.55 trunk/Scripts/Bash/centos-art/Functions/Render + trunk Scripts Bash centos-art Functions Render Config 3.56 trunk/Scripts/Bash/centos-art/Functions/Render/Config + trunk Scripts Bash centos-art Functions Shell 3.57 trunk/Scripts/Bash/centos-art/Functions/Shell + trunk Scripts Bash centos-art Functions Svg 3.58 trunk/Scripts/Bash/centos-art/Functions/Svg trunk Scripts Bash centos-art Functions Verify 3.59 trunk/Scripts/Bash/centos-art/Functions/Verify trunk Scripts Bash Locale 3.60 trunk/Scripts/Bash/Locale trunk Scripts Perl 3.61 trunk/Scripts/Perl diff --git a/Manuals/Filesystem/filesystem-html/filesystem_67.html b/Manuals/Filesystem/filesystem-html/filesystem_67.html index 8a352a0..0c19687 100644 --- a/Manuals/Filesystem/filesystem-html/filesystem_67.html +++ b/Manuals/Filesystem/filesystem-html/filesystem_67.html @@ -75,7 +75,7 @@ ul.toc {list-style: none} trunk Scripts Python 3.62 trunk/Scripts/Python Figure 3.2 - The actions initialization environment.
Figure 3.3 The
cli_commitRepoChanges
function output. +Figure 3.3 The
cli_commitRepoChanges
function output.Figure 3.4 diff --git a/Manuals/Filesystem/filesystem-html/filesystem_toc.html b/Manuals/Filesystem/filesystem-html/filesystem_toc.html index aa4e5fd..5d1e750 100644 --- a/Manuals/Filesystem/filesystem-html/filesystem_toc.html +++ b/Manuals/Filesystem/filesystem-html/filesystem_toc.html @@ -435,43 +435,43 @@ ul.toc {list-style: none} - The functions script base comment structure
3.50 trunk/Scripts/Bash/Functions - +3.50 trunk/Scripts/Bash/centos-art/Functions/Help + -3.51 trunk/Scripts/Bash/Functions/Html + 3.51 trunk/Scripts/Bash/centos-art/Functions/Html -3.52 trunk/Scripts/Bash/Functions/Locale + 3.52 trunk/Scripts/Bash/centos-art/Functions/Locale -3.53 trunk/Scripts/Bash/Functions/Manual + 3.53 trunk/Scripts/Bash/centos-art/Functions/Manual -3.54 trunk/Scripts/Bash/Functions/Path + 3.54 trunk/Scripts/Bash/centos-art/Functions/Path -
- 3.54.1 Goals
- 3.54.2 Description @@ -486,7 +486,7 @@ ul.toc {list-style: none}
- 3.54.3 Usage
- 3.54.4 See also
3.55 trunk/Scripts/Bash/Functions/Render + 3.55 trunk/Scripts/Bash/centos-art/Functions/Render
- 3.55.1 Renderable identity directory structures
-@@ -500,7 +500,7 @@ ul.toc {list-style: none}
- 3.55.4 Usage
- 3.55.5 See also
- 3.56 trunk/Scripts/Bash/Functions/Render/Config +
- 3.56 trunk/Scripts/Bash/centos-art/Functions/Render/Config
-
- 3.56.1 Goals
- 3.56.2 Description @@ -512,14 +512,14 @@ ul.toc {list-style: none}
- 3.56.3 Usage
- 3.56.4 See also
- 3.57 trunk/Scripts/Bash/Functions/Shell +
- 3.57 trunk/Scripts/Bash/centos-art/Functions/Shell
-- 3.58 trunk/Scripts/Bash/Functions/Svg +
- 3.58 trunk/Scripts/Bash/centos-art/Functions/Svg
-
- 3.58.1 Goals
- 3.58.2 Description @@ -530,7 +530,7 @@ ul.toc {list-style: none}
- 3.58.3 Usage
- 3.58.4 See also
- 3.59 trunk/Scripts/Bash/Functions/Verify +
- 3.59 trunk/Scripts/Bash/centos-art/Functions/Verify
- 3.59.1 Goals
- 3.59.2 Description diff --git a/Manuals/Filesystem/filesystem.pdf b/Manuals/Filesystem/filesystem.pdf index cdf6274..d346729 100644 Binary files a/Manuals/Filesystem/filesystem.pdf and b/Manuals/Filesystem/filesystem.pdf differ diff --git a/Manuals/Filesystem/filesystem.xml b/Manuals/Filesystem/filesystem.xml index e47ef3c..b9c9c71 100644 --- a/Manuals/Filesystem/filesystem.xml +++ b/Manuals/Filesystem/filesystem.xml @@ -328,53 +328,53 @@
- trunk Scripts Bash Functions -trunk Scripts Bash Functions +trunk Scripts Bash centos-art Functions Help +trunk Scripts Bash centos-art Functions Help - trunk Scripts Bash Functions Html -trunk Scripts Bash Functions Html +trunk Scripts Bash centos-art Functions Html +trunk Scripts Bash centos-art Functions Html - trunk Scripts Bash Functions Locale -trunk Scripts Bash Functions Locale +trunk Scripts Bash centos-art Functions Locale +trunk Scripts Bash centos-art Functions Locale - trunk Scripts Bash Functions Manual -trunk Scripts Bash Functions Manual +trunk Scripts Bash centos-art Functions Manual +trunk Scripts Bash centos-art Functions Manual - trunk Scripts Bash Functions Path -trunk Scripts Bash Functions Path +trunk Scripts Bash centos-art Functions Path +trunk Scripts Bash centos-art Functions Path - trunk Scripts Bash Functions Render -trunk Scripts Bash Functions Render +trunk Scripts Bash centos-art Functions Render +trunk Scripts Bash centos-art Functions Render - trunk Scripts Bash Functions Render Config -trunk Scripts Bash Functions Render Config +trunk Scripts Bash centos-art Functions Render Config +trunk Scripts Bash centos-art Functions Render Config - trunk Scripts Bash Functions Shell -trunk Scripts Bash Functions Shell +trunk Scripts Bash centos-art Functions Shell +trunk Scripts Bash centos-art Functions Shell - trunk Scripts Bash Functions Svg -trunk Scripts Bash Functions Svg +trunk Scripts Bash centos-art Functions Svg +trunk Scripts Bash centos-art Functions Svg - trunk Scripts Bash Functions Verify -trunk Scripts Bash Functions Verify +trunk Scripts Bash centos-art Functions Verify +trunk Scripts Bash centos-art Functions Verify @@ -2995,9 +2995,9 @@ vim /home/centos/artwork/trunk/Translations/Fonts/dejavu_lgc_sans-boldoblique.se -Description The best way to understand 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 -centos-art.sh script is written in Bash. Most tasks, insidecentos-art.sh script, have been organized in many specific functionalities that you can invoke from thecentos-art command-line interface.When you type the +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 PATH environment variable to look for that command location. If your system was prepared to use CentOS Artwork Repository correctly (see), you should have a symbolic link inside trunk Scripts Bash Functions Verify ~/bin/ directory that points to thecentos-art.sh script file. As~/bin/ directory is, by default, inside PATH environment variable, the execution ofcentos-art command runs thecentos-art.sh script.When you type the 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 PATH environment variable to look for that command location. If your system was prepared to use CentOS Artwork Repository correctly (— Removed(pxref:trunk Scripts Bash Functions Verify) —), you should have a symbolic link inside~/bin/ directory that points to thecentos-art.sh script file. As~/bin/ directory is, by default, inside PATH environment variable, the execution ofcentos-art command runs thecentos-art.sh script.When -centos-art.sh script is executed, the first it does is executing thetrunk/Scripts/Bash/initEnvironment.sh script to initialize global variables (e.g.,gettext variables) and global function scripts. Global function scripts are located insidetrunk/Scripts/Bash/Functions directory and their file names begin with cli. Global function scripts provide common functionalities that can be used anywhere insidecentos-art.sh script execution environment.Once global variables and function scripts have been loaded, +centos-art.sh script executes thecli global function fromcli.sh function script to retrive command-line arguments and define some default values that may be used later by specific function scripts (see). trunk Scripts Bash Functions Once global variables and function scripts have been loaded, centos-art.sh script executes thecli global function fromcli.sh function script to retrive command-line arguments and define some default values that may be used later by specific function scripts (— Removed(pxref:trunk Scripts Bash Functions) —).As convenction, the centos-art.sh command-line arguments have the following format:Usage -The +centos-art.sh script usage information is described inside each specific function documentation (see). trunk Scripts Bash Functions The centos-art.sh script usage information is described inside each specific function documentation (— Removed(pxref:trunk Scripts Bash Functions) —).@@ -3088,12 +3088,8 @@ centos-art arg1 --arg2=val2 --arg3=val3 - trunk Scripts trunk Scripts -- - trunk Scripts Bash Functions -trunk Scripts Bash Functions -+ + trunk Scripts Bash Locale @@ -3116,7 +3112,7 @@ centos-art arg1 --arg2=val2 --arg3=val3- trunk Scripts Bash centos-art Functions -trunk Scripts Bash Functions +trunk Scripts Bash centos-art Functions Help trunk Scripts Bash centos-art trunk @@ -3124,51 +3120,6 @@ centos-art arg1 --arg2=val2 --arg3=val3 -trunk Scripts Bash centos-art Functions - - Goals -- -• -- -
-... -- - -Description -- -• -- -
-... -- - -Usage -- -• -- -
-... -- -See also - -- trunk Scripts Bash Functions -trunk Scripts Bash Functions Html -trunk Scripts Bash centos-art Functions -trunk -- trunk/Scripts/Bash/Functions -- trunk Scripts Bash Functions - @@ -3295,12 +3246,12 @@ Goodbye World [centos@projects ~]$ ]]>Goals The trunk/Scripts/Bash/Functions directory exists to organizecentos-art.sh specific functionalities.The word World in the examples above can be anything. In fact, change it to have a little fun. -Now that we have a specific function that works as we expect, it is time to document it. To document +greet
specific functionality, we use its directory path and themanual
functionality (see) of trunk Scripts Bash Functions Manual centos-art.sh script, just as the following command illustrates:Now that we have a specific function that works as we expect, it is time to document it. To document greet
specific functionality, we use its directory path and themanual
functionality (— Removed(pxref:trunk Scripts Bash Functions Manual) —) ofcentos-art.sh script, just as the following command illustrates:To have a well documented function helps user to understand how your function really works, and how it should be used. When no valid action is passed to a function, the -centos-art.sh script uses the function documentation entry as vehicle to communicate which the valid functions are. When no documentation entry exists for a function, thecentos-art.sh script informs that no documentation entry exists for such function and requests user to create it right at that time.Now that we have documented our function, it is time to translate its output messages to different languages. To translate specific functionality output messages to different languages we use the +locale
functionality (see) of trunk Scripts Bash Functions Locale centos-art.sh script, just as the following command illustrates:Now that we have documented our function, it is time to translate its output messages to different languages. To translate specific functionality output messages to different languages we use the locale
functionality (— Removed(pxref:trunk Scripts Bash Functions Locale) —) ofcentos-art.sh script, just as the following command illustrates:@@ -3852,7 +3803,7 @@ function prefix_doSomething { Use cli_getRepoName
function to sanitate file names and directory names before their utilization.Use -cli_getRepoName
when you need to change file name convenctions insidecentos-art.sh script.When we change file name convenctions inside +cli_getRepoName
what we are really changing is the way functions interpret repository file system organization. Notice that when we change a file name (e.g., a function name), it is necessary to update all files where such file name is placed on. This may require a massive substitution inside the repository, each time we change name convenctions in the repository (see, for more information). trunk Scripts Bash Functions Path When we change file name convenctions inside cli_getRepoName
what we are really changing is the way functions interpret repository file system organization. Notice that when we change a file name (e.g., a function name), it is necessary to update all files where such file name is placed on. This may require a massive substitution inside the repository, each time we change name convenctions in the repository (— Removed(pxref:trunk Scripts Bash Functions Path) —, for more information).@@ -4071,7 +4022,7 @@ $MESSAGE [y/N]: $MESSAGE [s/N]: ]]> and the confirmation answer would be s, as it is on Spanish sí word. -Definition of which confirmation word to use is set on translation messages for your specific locale information. See +, for more information about locale-specific translation messages. trunk Scripts Bash Functions Locale Definition of which confirmation word to use is set on translation messages for your specific locale information. — Removed(xref:trunk Scripts Bash Functions Locale) —, for more information about locale-specific translation messages. @@ -4110,51 +4061,15 @@ trunk/Scripts/Bash/Styles/output_forTwoColumns.awk @@ -4839,23 +4795,19 @@ function render_loadConfig {Specific functions The following specific functions of @@ -4177,13 +4092,13 @@ trunk/Scripts/Bash/Styles/output_forTwoColumns.awkcentos-art.sh script, are available for you to use:- trunk Scripts Bash Functions Html -trunk Scripts Bash Functions Locale -trunk Scripts Bash Functions +trunk Scripts Bash centos-art Functions Help +trunk Scripts Bash centos-art Functions Html +trunk Scripts Bash centos-art Functions trunk - trunk/Scripts/Bash/Functions/Html -+ trunk Scripts Bash Functions Html trunk/Scripts/Bash/centos-art/Functions/Help +trunk Scripts Bash centos-art Functions Help Goals @@ -4222,13 +4137,58 @@ trunk/Scripts/Bash/Styles/output_forTwoColumns.awk - +trunk Scripts Bash Functions Locale -trunk Scripts Bash Functions Manual -trunk Scripts Bash Functions Html +trunk Scripts Bash centos-art Functions Html +trunk Scripts Bash centos-art Functions Locale +trunk Scripts Bash centos-art Functions Help trunk - +trunk/Scripts/Bash/Functions/Locale -+ trunk Scripts Bash Functions Locale trunk/Scripts/Bash/centos-art/Functions/Html ++ trunk Scripts Bash centos-art Functions Html + + +Goals ++ +• +- +
+... ++ + +Description ++ +• +- +
+... ++ + +Usage ++ +• +- +
+... ++ +See also + ++ trunk Scripts Bash centos-art Functions Locale +trunk Scripts Bash centos-art Functions Manual +trunk Scripts Bash centos-art Functions Html +trunk ++ trunk/Scripts/Bash/centos-art/Functions/Locale +trunk Scripts Bash centos-art Functions Locale Goals @@ -4296,13 +4256,13 @@ trunk/Scripts/Bash/Styles/output_forTwoColumns.awk - trunk Scripts Bash Functions Manual -trunk Scripts Bash Functions Path -trunk Scripts Bash Functions Locale +trunk Scripts Bash centos-art Functions Manual +trunk Scripts Bash centos-art Functions Path +trunk Scripts Bash centos-art Functions Locale trunk - trunk/Scripts/Bash/Functions/Manual -+ trunk Scripts Bash Functions Manual trunk/Scripts/Bash/centos-art/Functions/Manual +trunk Scripts Bash centos-art Functions Manual Goals @@ -4341,13 +4301,13 @@ trunk/Scripts/Bash/Styles/output_forTwoColumns.awk - trunk Scripts Bash Functions Path -trunk Scripts Bash Functions Render -trunk Scripts Bash Functions Manual +trunk Scripts Bash centos-art Functions Path +trunk Scripts Bash centos-art Functions Render +trunk Scripts Bash centos-art Functions Manual trunk - trunk/Scripts/Bash/Functions/Path -+ trunk Scripts Bash Functions Path trunk/Scripts/Bash/centos-art/Functions/Path +trunk Scripts Bash centos-art Functions Path Goals This section exists to organize files related to @@ -4456,25 +4416,21 @@ centos-art manual --read=turnk/Identity/Themes/Motifs/TreeFlower/path
functiontionality. Thepath
functionality standardizes movement, syncronization, branching, tagging, and general file maintainance inside the repository.- trunk Scripts Bash trunk Scripts Bash -- - trunk Scripts Bash Functions -trunk Scripts Bash Functions -+ + - trunk Scripts Bash Functions Render -trunk Scripts Bash Functions Render Config -trunk Scripts Bash Functions Path +trunk Scripts Bash centos-art Functions Render +trunk Scripts Bash centos-art Functions Render Config +trunk Scripts Bash centos-art Functions Path trunk - trunk/Scripts/Bash/Functions/Render -+ trunk Scripts Bash Functions Render Therender
functionality exists to produce both identity and translation files on different levels of information (i.e., different languages, release numbers, architectures, etc.).trunk/Scripts/Bash/centos-art/Functions/Render +trunk Scripts Bash centos-art Functions Render Therender
functionality exists to produce both identity and translation files on different levels of information (i.e., different languages, release numbers, architectures, etc.).The render
functionality relies on “renderable directory structures” to produce files. Renderable directory structures can be either “identity directory structures” or “translation directory structures” with special directories inside.@@ -4510,7 +4466,7 @@ trunk/Identity/Path/To/Dir <-- Renderable identity directory structure. - Note At rendition time, the content of Img/ directory structure is produced bycentos-art.sh automatically.When a renderable identity directory structure is configured to produce image-based content, +centos-art.sh producesPNG Portable Network Graphics files with the.png
extension. Once the base image format has been produced, it is possible forcentos-art.sh to use it in order to automatically create other image formats that may be needed (see). trunk Scripts Bash Functions Render Config When a renderable identity directory structure is configured to produce image-based content, centos-art.sh producesPNG Portable Network Graphics files with the.png
extension. Once the base image format has been produced, it is possible forcentos-art.sh to use it in order to automatically create other image formats that may be needed (— Removed(pxref:trunk Scripts Bash Functions Render Config) —).Inside the working copy, you can find an example of “design template without translation” configuration at trunk/Identity/Models/ .See @@ -4571,7 +4527,7 @@ trunk/Identity/NewDir/Img/file.png 3 | Remove design template instance. ]]>, for more information. trunk Identity Finally, when the untranslated image has been created, the temporal design template instance is removed. At this point, -centos-art.sh takes the next design template and repeats the whole production flow once again (design template by design template), until all design templates be processed.See +, for more information. trunk Scripts Bash Functions Render Config — Removed(xref:trunk Scripts Bash Functions Render Config) —, for more information. See also - trunk Scripts Bash Functions Render Config -trunk Scripts Bash Functions Shell -trunk Scripts Bash Functions Render +trunk Scripts Bash centos-art Functions Render Config +trunk Scripts Bash centos-art Functions Shell +trunk Scripts Bash centos-art Functions Render trunk - trunk/Scripts/Bash/Functions/Render/Config -+ trunk Scripts Bash Functions Render Config trunk/Scripts/Bash/centos-art/Functions/Render/Config +trunk Scripts Bash centos-art Functions Render Config Goals The @@ -4924,7 +4876,7 @@ ACTIONS[1]='POST:renderFormats: xpm jpg tif' ]]>trunk/Scripts/Bash/Config directory exists to oraganize pre-rendering configuration scripts.The LAST action specifies which actions to apply once the last file in the list of files to process has been rendered. The LAST action is optional. Possible values for LAST actions may be groupByFormat, renderGdmTgz, etc. - Note See +, to know more about possible values for BASE, POST and LAST action definitions. trunk Scripts Bash Functions Render Note — Removed(xref:trunk Scripts Bash Functions Render) —, to know more about possible values for BASE, POST and LAST action definitions. To specify the LAST action, you need to set the LAST: string followed by the function name of the action you want to perform. For example, consider the following example if you want to render all files first and organize them later: trunk Scripts Bash trunk Scripts Bash -- - -trunk Scripts Bash Functions -trunk Scripts Bash Functions -- - trunk Scripts Bash Functions Render -trunk Scripts Bash Functions Render -+ + + - trunk Scripts Bash Functions Shell -trunk Scripts Bash Functions Svg -trunk Scripts Bash Functions Render Config +trunk Scripts Bash centos-art Functions Shell +trunk Scripts Bash centos-art Functions Svg +trunk Scripts Bash centos-art Functions Render Config trunk - trunk/Scripts/Bash/Functions/Shell -+ trunk Scripts Bash Functions Shell trunk/Scripts/Bash/centos-art/Functions/Shell +trunk Scripts Bash centos-art Functions Shell Goals This section exists to organize files related to @@ -5112,25 +5056,21 @@ Copyright (C) 1989, 1991 Free Software Foundation, Inc.shell
functionality ofcentos-art.sh script.- trunk Scripts Bash trunk Scripts Bash -- - trunk Scripts Bash Functions -trunk Scripts Bash Functions -+ + - trunk Scripts Bash Functions Svg -trunk Scripts Bash Functions Verify -trunk Scripts Bash Functions Shell +trunk Scripts Bash centos-art Functions Svg +trunk Scripts Bash centos-art Functions Verify +trunk Scripts Bash centos-art Functions Shell trunk - trunk/Scripts/Bash/Functions/Svg -+ trunk Scripts Bash Functions Svg trunk/Scripts/Bash/centos-art/Functions/Svg +trunk Scripts Bash centos-art Functions Svg Goals This section exists to organize files related to @@ -5271,25 +5211,21 @@ Copyright (C) 1989, 1991 Free Software Foundation, Inc.svg
functionality ofcentos-art.sh script.- trunk Scripts Bash trunk Scripts Bash -- - trunk Scripts Bash Functions -trunk Scripts Bash Functions -+ + - trunk Scripts Bash Functions Verify +trunk Scripts Bash centos-art Functions Verify trunk Scripts Bash Locale -trunk Scripts Bash Functions Svg +trunk Scripts Bash centos-art Functions Svg trunk - trunk/Scripts/Bash/Functions/Verify -+ trunk Scripts Bash Functions Verify trunk/Scripts/Bash/centos-art/Functions/Verify +trunk Scripts Bash centos-art Functions Verify @@ -5429,7 +5361,7 @@ Copyright (C) 1989, 1991 Free Software Foundation, Inc. Goals This section exists to organize files related to @@ -5415,12 +5351,8 @@ Copyright (C) 1989, 1991 Free Software Foundation, Inc.centos-art.sh script verify functionality. The verify functionality ofcentos-art.sh script helps you to verify the workstation configuration you are planning to use as host for your working copy of CentOS Artwork Repository.- trunk Scripts Bash trunk Scripts Bash -- - trunk Scripts Bash Functions -trunk Scripts Bash Functions -+ + trunk Scripts Bash Locale trunk Scripts Perl -trunk Scripts Bash Functions Verify +trunk Scripts Bash centos-art Functions Verify trunk trunk/Scripts/Bash/Locale @@ -5441,22 +5373,18 @@ Copyright (C) 1989, 1991 Free Software Foundation, Inc.Description -Translated messages of +centos-art.sh script are managed using GNUgettext utilities. Most translation actions have been automated throughcentos-art.sh script “locale” functionality (see). trunk Scripts Bash Functions Locale Translated messages of centos-art.sh script are managed using GNUgettext utilities. Most translation actions have been automated throughcentos-art.sh script “locale” functionality (— Removed(pxref:trunk Scripts Bash Functions Locale) —).Usage -The content of +trunk/Scripts/Bash/Locale directory should not be managed manually. Instead, use the “locale” functionality ofcentos-art.sh script. See, for more information on how to use trunk Scripts Bash Functions Locale centos-art.sh “locale” functionality.The content of trunk/Scripts/Bash/Locale directory should not be managed manually. Instead, use the “locale” functionality ofcentos-art.sh script. — Removed(xref:trunk Scripts Bash Functions Locale) —, for more information on how to usecentos-art.sh “locale” functionality.See also