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_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.
...
...