Environment Functions Reference
In addition to environment variables described above, the
centos-art.sh script makes available the following common
environment functions once it is executed:
cli_checkFiles-d-e-f-h-xLOCATION
The cli_checkFiles standardizes the way
files are verified inside the centos-art.sh script. It tries
to answers questions like Is
LOCATION a regular file or
directory? or even, does
LOCATION have execution
rights?. You can provide several
LOCATION arguments to this function
in order to perform the verifications over them. Likewise, you
can combine different options to realize different
verifications over the same files. In case the verification
fails, an error message is printed and the script finishes its
execution.
The cli_checkFiles is an interface for
the test command and accepts the following
options:
Verifies whether LOCATION exists
and is a directory. If it doesn't exists or isn't a directory,
an error message is printed and the script finishes its
execution. Otherwise, if it exists and is a directory, the
script continues its execution normally.
Verifies whether LOCATION exists or
not. If it doesn't exist, an error message is printed and the
script finishes its execution. Otherwise, if it does exists,
the script continues its execution normally.
Verifies whether LOCATION exists
and is a regular file. If it doesn't exists or isn't a regular
file, an error message is printed and the script finishes its
execution. Otherwise, if it exists and is a regular file, the
script continues its execution normally.
Verifies whether LOCATION exists
and is a symbolic link. If it doesn't exists or isn't a
symbolic link, an error message is printed and the script
finishes its execution immediately. Otherwise, if it does
exist and is a symbolic link, the script continue its
execution normally.
Verifies whether LOCATION exists
and execution permission is granted. If it doesn't exist or
hasn't execution permission, the script finishes its execution
immediately. Otherwise, if it exists and has execution
permissions, the script continues its execution normally.
Use the cli_checkFiles function whenever
you need to verify files inside the &TCAR;.
cli_checkRepoDirSource
The cli_checkRepoDirSource function
standardizes the path construction to directories inside it
the working copy, using absolute paths. This function
transforms relative paths passed as non-option arguments to
centos-art.sh script command-line into
absolute paths inside the working copy and verifies whether
they really exist as directories inside the working copy or
not. If the path provided doesn't exist as directory inside
the working copy, the script will finish its execution
immediately with an error message. Otherwise, if the directory
exists, the variable ACTIONVAL is redefined
with the related absolute path for further use.
Use the cli_checkRepoDirSource function
whenever you need to be sure that non-option arguments passed
to centos-art.sh script command-line will
always point to directories inside the working copy.
cli_expandTMarkersLOCATION
The cli_expandTMarkers standardizes
construction of translation markers and their related
expansion. As convention, translation markers are set inside
source files (e.g., DocBook, SVG) and expanded inside temporal
instances used to produce final contents. The
LOCATION argument should point to
the temporal file where translation markers expansion takes
place in.
Translation markers written in source files must comply the
=[A-Z_]+= regular expression pattern. For
example, =UNKNOWN_MARKER= is a valid
translation marker without any replacement. To prevent
centos-art.sh script from expanding
translation markers, add a backslash (\)
between the first equal sign and the following letter. For
example, =\...= won't be expanded.
The cli_expandTMarkers supports the
following translation markers:
=\COPYRIGHT_YEAR_LAST==\COPYRIGHT_YEAR=
These translation markers expand to the last year used in
copyright notes. For example,
=COPYRIGHT_YEAR_LAST=.
=\COPYRIGHT_YEAR_LIST==\COPYRIGHT_YEARS_LIST=
This translation markers expand to the list of years used in
copyright notes. For example,
=COPYRIGHT_YEARS_LIST=. The first year
represents the time we began to work on &TCAR;.
=\COPYRIGHT_HOLDER=
This translation marker expands to the holder used in
copyright notes. For example,
=COPYRIGHT_HOLDER=.
=\COPYRIGHT_HOLDER_PREDICATE=
This translation marker expands both the holder and the
predicate used in copyright notes. For example,
=COPYRIGHT_HOLDER_PREDICATE=.
=\BRAND=
This translation marker expands to the brand name used on
files names and URLs inside &TCAR;. For example,
=BRAND=.
=\LICENSE=
This translation marker expands to the license information
used in files created by centos-art.sh
script. For example, =LICENSE=.
=\LICENSE_URL=
This translation marker expands to the license URL used in
files created by centos-art.sh script. For
example, =LICENSE_URL=.
=\THEME=
This translation marker expands to the theme portion of path
you are producing through centos-art.sh script. As
consequence, this translation marker should be used in
situations where you are producing theme components only.
This translation marker expands its value by retrieving the
theme part of the path you provide as non-option argument to
centos-art.sh script. For example, if you
provide the path
trunk/Identity/Images/Themes/Modern/2/Distro/5,
this translation will expand to the
Modern/2/ value.
In case you need to retrieve the theme name or version
separately one another, then you can use the
=\THEMENAME= and
=\THEMERELEASE= translation markers,
respectively. When you use these translation markers, forward
slashes are removed from result. So, if you provide the path
trunk/Identity/Images/Themes/Modern/2/Distro/5,
=\THEMENAME= will expand to
Modern and
=THEMERELEASE= will expand to
2.
=\RELEASE=
This translation marker expands to the current release
information of your CentOS distribution. By default this
information is retrieved from
/etc/redhat-release. In case the option
be passed, the value specified with
it will overwrite the default value and will be this the one
used as reference for this translation marker to retrieve the
release information. So, for example, if you are running a
CentOS-5.8 distribution and no
option is passed to centos-art.sh script,
this translation marker expands to 5.8. On
the other hand, if you are still running a CentOS-5.8
distribution but provide the
option to centos-art.sh script, this
translation marker expands to 6.3 instead.
In case you need to retrieve minor and major release numbers
separately one another, then you can use the
=\MINOR_RELEASE= and
=\MAJOR_RELEASE= translation makers,
respectively.
=\ARCH=
This translation marker expands to the current architecture of
your CentOS Distribution. By default this information is
retrieved from uname -i. In case the option
be passed, the value specified with it
will overwrite the default value and will be the one used as
reference. For example, if the uname -i
outputs the line i386, this
translation marker will expand to i386. On
the other hand, if you pass the
option to centos-art.sh script, this
translation marker will expand to x86_64
instead.
=\URL=
This translation marker expands to the URL which points to
&TCP; home page. For example, =URL=. In
case you are using the centos-art.sh script in a different
locale but English (en_US.UTF-8), this
translation marker expands as usual but with the language
information appended to the end of the string. For example, if
you are executing the centos-art.shscript for Spanish locale
(e.g., es_ES.UTF-8), this translation
marker expands to =URL=es/.
In case you need to expand other URL related to &TCP; domain,
use translation markers described in . Likewise
=\URL=, translation markers described in does
append the current language information to the end of the URL
string based on the locale information you are currently
executing the centos-art.sh script.
=\MAIL_DOCS=
This translation marker expands to CentOS documentation
mailing list address. For example,
=MAIL_DOCS=.
=\LOCALE=
This translation marker expands to the current locale
information used by centos-art.sh script.
This value is retrieved from the LANG
environment variable and should look like
=LOCALE=. In case you need to retrieve the
language and country part separately one another, you can use
the =\LOCALE_LL= and
=\LOCALE_CC=, respectively.
=\REPO_TLDIR=
This translation marker expands to the absolute path to
trunk/ directory inside
your workstation. For example,
/home/al/Projects/CentOS/artwork/trunk.
=\REPO_HOME==\TCAR_WORKDIR=
This translation marker expands to the absolute path of your
working copy. For example,
/home/al/Projects/CentOS/artwork.
See also: cli_exportFunctionsEXPORTID
The cli_exportFunctions function
standardizes the way specific functionalities are exported to
centos-art.sh script execution environment.
The EXPORTID argument points the
specific function initialization file relatively from
trunk/Scripts/Bash/Functions directory
on. For example, if we want to export the
render specific functionality, we use the
following construction:
cli_exportFunctions "Render/render"
In this construction, Render with the first
letter in upper case is the name of the directory under
trunk/Scripts/Bash/Functions
where the specific functionality is stored in, and
render with all letters in lower case is
the name of the specific functionality we want to export,
without its extension. This name is also used as suffix to
identify all files related to the specific functionality we
are exporting to centos-art.sh script
execution environment.
See also: cli_synchronizeRepoChangesLOCATION
The cli_synchronizeRepoChanges
standardizes the way changes are synchronized between the
working copy and the central repository using
LOCATION as reference. This
function is the interface we use inside the
centos-art.sh script to execute the
Svn functionality described in .
Use cli_synchronizeRepoChanges function
inside the centos-art.sh script whenever
you need to synchronize one or more changes at any
LOCATION inside the working copy.
cli_printMessageMESSAGE--as-separator-line--as-banner-line--as-cropping-line--as-tuningup-line--as-checking-line--as-combining-line--as-creating-line--as-reading-line--as-savedas-line--as-linkto-line--as-movedto-line--as-validating-line--as-template-line--as-configuration-line--as-palette-line--as-reponse-line--as-request-line--as-selection-line--as-error-line--as-toknowmore-line--as-yesornorequest-line--as-notrailingnew-line--as-stdout-line--as-stderr-line
The cli_printMessage function
standardizes the way centos-ar.sh scirpt prints messages. By
default, centos-art.sh script prints all messages to the
standard output with the exception of those messages printed
with the option, which are
printed to standard error output instead.
The cli_printMessage function requires
two arguments. The first argument specifies the
MESSAGE you want to print and the
second argument specifies the FORMAT you'll use to print that
message. Because this function is so used inside the
centos-art.sh script, it is convenient to provide localization
to strings passed as MESSAGE using
gettext contructions when they aren't
paths.
The cli_printMessage function accepts the
following formats as second argument:
This format takes the first character passed as
MESSAGE and repeats it horizontally
to build a separator line. Use this format whenever you need
to create a logical separation between different actions.
This format takes the string passed as
MESSAGE and puts it inside two
horizontal separator lines. Use this format whenever you need
to print header information for following lines.
This format is for two columns messages where
MESSAGE generally refers to a file
inside the repository. Use this format whenever you need to
imply the fact that certain file has been cropped.
This format is for two columns messages where
MESSAGE
generally refers to a file inside the repository. Use this
format whenever you need to imply the fact that certain file
has been tuned-up.
This format is for two columns messages where
MESSAGE generally refers to a file
inside the repository. Use this format whenever you need to
imply the fact that certain file has been checked or verified
(e.g., through cli_checkFiles
functionality).
This format is for two columns messages where
MESSAGE generally refers to a file
inside the repository. Use this format whenever you need to
imply the fact that certain file has been combined.
This format is for two columns messages where
MESSAGE generally refers to a file
inside the repository. Use this format whenever you need to
imply the fact that certain file has been created.
This format is for two columns messages where
MESSAGE generally refers to a file
inside the repository. Use this format whenever you need to
imply the fact that certain file has been read.
This format is for two columns messages where
MESSAGE generally refers to a file
inside the repository. Use this format whenever you need to
imply the fact that certain file has been saved.
This format is for two columns messages where
MESSAGE generally refers to a file
inside the repository. Use this format whenever you need to
imply the fact that certain file has been linked.
This format is for two columns messages where
MESSAGE generally refers to a file
inside the repository. Use this format whenever you need to
imply the fact that certain file has been moved.
This format is for two columns messages where
MESSAGE generally refers to a file
inside the repository. Use this format whenever you need to
imply the fact that certain file has been validated.
This format is for two columns messages where
MESSAGE generally refers to a file
inside the repository. Use this format whenever you need to
imply the fact that certain file is a template or design
model.
This format is for two columns messages where
MESSAGE generally refers to a file
inside the repository. Use this format whenever you need to
imply the fact that certain file is a configuration file.
This format is for two columns messages where
MESSAGE generally refers to a file
inside the repository. Use this format whenever you need to
imply the fact that certain file is a palette of colors.
This format adds --> at the begining of the
string passed as MESSAGE. Use this
format whenever you need to imply the fact that certain file
is considered part of a response. For example, when you need
to express that a group of files will take ceratin action, you
can use this option to doing so.
This format prints MESSAGE without
trailing new line. Use this format whenever you need to imply
a question or yes or no request.
This format uses each word in
MESSAGE as item of a selection
list. Use this format whenever you need to select one of the
items provided as MESSAGE.
This format prints error messages produced by centos-art.sh
script. It uses the caller built-in command
to display the line number and the filename where such error
was triggered. Later, it prints where to find more information
by using the option.
This format takes a function name as
MESSAGE and prints the command you
can use to find more information about it. When this option is
passed the script finishes its execution immediately. This
option is used in combination with
to finish the script
execution after an error.
This format takes a question as
MESSAGE and reads a yes or no
answer. When answer is negative, the script finishes its
execution immediately. When answer is affirmative, the script
continues its execution normally.
Print MESSAGE without any trailing
newline.
Print MESSAGE to standard output.
Print MESSAGE to standard error
output.
Use cli_printMessage function whenever
you need to print information inside the
centos-art.sh script.
cli_unsetFunctionsEXPORTID
...
See also: cli_getTemporalFileFILENAME
...
...
...