Blame Manuals/Repository/trunk/Scripts/Bash/Functions/Verify.texi

ad1d7b
@subsection Goals
ad1d7b
ad1d7b
This section exists to organize files related to @file{centos-art.sh}
ad1d7b
script @samp{verify} functionality.  The @samp{verify}
ad1d7b
functionality of @file{centos-art.sh} script helps you to verify the
ad1d7b
workstation configuration you are planning to use as host for your
ad1d7b
working copy of CentOS Artwork Repository.
ad1d7b
ad1d7b
@subsection Description
ad1d7b
ad1d7b
The first time you download CentOS Artwork Repository you need to
ad1d7b
configure your workstation in order to use @file{centos-art.sh}
ad1d7b
script.  These preliminar configurations are based mainly on auxiliar
ad1d7b
RPM packages installation, symbolic links creations, and environment
ad1d7b
variables definitions.  The @samp{verify} functionality of
ad1d7b
@file{centos-art.sh} script guides you through this preliminar
ad1d7b
configuration process.  
ad1d7b
ad1d7b
If this is the first time you run @file{centos-art.sh} script, the
ad1d7b
appropriate way to use its @samp{verify} functionality is not using
ad1d7b
the @file{centos-art.sh} script directly, but the absolute path to
ad1d7b
@command{centos-art.sh} script instead (i.e.,
ad1d7b
@file{~/artwork/trunk/Scripts/Bash/centos-art.sh}).  This is necessary
ad1d7b
because @file{centos-art} symbolic link, under @file{~/bin/}
ad1d7b
directory, has not been created yet.
ad1d7b
ad1d7b
@subsubsection Packages
ad1d7b
ad1d7b
Installation of auxiliar RPM packages provides the software required
ad1d7b
to manipulate files inside the repository (e.g., image files,
ad1d7b
documentation files, translation files, script files, etc.). Most of
ad1d7b
RPM packages @command{centos-art.sh} script uses are shipped with
ad1d7b
CentOS distribution, and can be installed from CentOS base repository.
ad1d7b
The only exception is @samp{inkscape}, the package we use to
ad1d7b
manipulate SVG files.  The @samp{inkscape} package is not inside
ad1d7b
CentOS distribution so it needs to be installed from third party
ad1d7b
repositories.
ad1d7b
ad1d7b
@quotation
ad1d7b
@strong{Note} Configuration of third party repositories inside CentOS
ad1d7b
distribution is described in CentOS wiki, specifically in the
ad1d7b
following URL:
ad1d7b
@url{http://wiki.centos.org/AdditionalResources/Repositories}
ad1d7b
@end quotation
ad1d7b
ad1d7b
Before installing packages, the @file{centos-art.sh} script uses
ad1d7b
@command{sudo} to request root privileges to execute @command{yum}
ad1d7b
installation functionality.  If your user isn't defined as a
ad1d7b
privileged user---at least to run @command{yum} commands--- inside
ad1d7b
@file{/etc/sudoers} configuration file, you will not be able to
ad1d7b
perform package installation tasks as set in @file{centos-art.sh}
ad1d7b
script @samp{verify} functionality. 
ad1d7b
ad1d7b
Setting sudo privileges to users is an administrative task you have to
ad1d7b
do by yourself. If you don't have experience with @command{sudo}
ad1d7b
command, please read its man page running the command: @command{man
ad1d7b
sudo}. This reading will be very useful, and with some practice, you
ad1d7b
will be able to configure your users to have @command{sudo}
ad1d7b
privileges.
ad1d7b
ad1d7b
@subsubsection Links
ad1d7b
ad1d7b
Creation of symbolic links helps us to alternate between different
ad1d7b
implementations of @file{centos-art.sh} script-line (e.g.,
ad1d7b
@file{centos-art.sh}, for Bash implementation; @file{centos-art.py},
ad1d7b
for Python implementation; @file{centos-art.pl}, for Perl
ad1d7b
implementation; and so on for other implementations). The
ad1d7b
@file{centos-art.sh} script-line definition takes place inside your
ad1d7b
personal binary (@file{~/bin/}) directory in order to make the script
ad1d7b
implementation ---the one that @file{centos-art} links to--- available
ad1d7b
to @var{PATH} environment variable.
ad1d7b
ad1d7b
Creation of symbolic links helps us to reuse components from repository
ad1d7b
working copy. For example, color information files maintained inside
ad1d7b
your working copy must never be duplicated inside program-specific
ad1d7b
configuration directories that uses them in your workstation (e.g.,
ad1d7b
Gimp, Inkscape, etc.).  Instead, a symbolic link must be created for
ad1d7b
each one of them, from program-specific configuration directories to
ad1d7b
files in the working copy.  In this configuration, when someone
ad1d7b
commits changes to color information files up to central repository,
ad1d7b
they---the changes committed--- will be immediatly available to your
ad1d7b
programs the next time you update your working copy ---the place
ad1d7b
inside your workstation those color information files are stored---.
ad1d7b
ad1d7b
Creation of symbolic links helps us to make @file{centos-art.sh}
ad1d7b
script functionalities available outside @file{trunk/} repository
ad1d7b
directory structure, but at its same level in repository tree. This is
ad1d7b
useful if you need to use the ``render'' functionality of
ad1d7b
@command{centos-art.sh} under @file{branches/} repository directory
ad1d7b
structure as you usually do inside @file{trunk/} repository directory
ad1d7b
structure. As consequence of this configuration, automation scripts
ad1d7b
cannot be branched under @file{branches/Scripts} directory structure.
ad1d7b
ad1d7b
@subsubsection Environment variables
ad1d7b
ad1d7b
Definition of environemnt variables helps us to set default values to
ad1d7b
our user session life. The user session environment variable defintion
ad1d7b
takes place in the user's @file{~/.bash_profile} file.  The
ad1d7b
@samp{verify} functionality of @file{centos-art.sh} script doesn't
ad1d7b
modify your @file{~/.bash_profile} file.  
ad1d7b
ad1d7b
The @samp{verify} functionality of @file{centos-art.sh} script
ad1d7b
evaluates the following environment variables:
ad1d7b
ad1d7b
@table @env
ad1d7b
@item EDITOR
ad1d7b
Default text editor. 
ad1d7b
ad1d7b
The @file{centos-art.sh} script uses default text @env{EDITOR} to edit
ad1d7b
pre-commit subversion messages, translation files, configuration
ad1d7b
files, script files, and similar text-based files.
ad1d7b
ad1d7b
If @env{EDITOR} environment variable is not set, @file{centos-art.sh}
ad1d7b
script uses @file{/usr/bin/vim} as default text editor. Otherwise, the
ad1d7b
following values are recognized by @file{centos-art.sh} script:
ad1d7b
ad1d7b
@itemize
ad1d7b
@item @file{/usr/bin/vim}
ad1d7b
@item @file{/usr/bin/emacs}
ad1d7b
@item @file{/usr/bin/nano}
ad1d7b
@end itemize
ad1d7b
ad1d7b
If no one of these values is set in @env{EDITOR} environment variable,
ad1d7b
@file{centos-art.sh} uses @file{/usr/bin/vim} text editor by default. 
ad1d7b
ad1d7b
@item TEXTDOMAIN
ad1d7b
ad1d7b
Default domain used to retrieve translated messages.  This variable is
ad1d7b
set in @file{initFunctions.sh} and shouldn't be changed.
ad1d7b
ad1d7b
@item TEXTDOMAINDIR
ad1d7b
ad1d7b
Default directory used to retrieve translated messages.  This variable
ad1d7b
is set in @file{initFunctions.sh} and shouldn't be changed.
ad1d7b
ad1d7b
@item LANG
ad1d7b
ad1d7b
Default locale information.
ad1d7b
ad1d7b
This variable is initially set in the configuration process of CentOS
ad1d7b
distribution installer (i.e., Anaconda), specifically in the
ad1d7b
@samp{Language} step; or once installed using the
ad1d7b
@command{system-config-language} tool.
ad1d7b
ad1d7b
The @file{centos-art.sh} script uses the @var{LANG} environment
ad1d7b
variable to know in which language the script messages are printed
ad1d7b
out.
ad1d7b
ad1d7b
@item TZ
ad1d7b
ad1d7b
Default time zone representation.
ad1d7b
ad1d7b
This variable is initially set in the configuration process of CentOS
ad1d7b
distribution installer (i.e., Anaconda), specifically in the
ad1d7b
@samp{Date and time} step; or once installed using the
ad1d7b
@command{system-config-date} tool.
ad1d7b
ad1d7b
The @file{centos-art.sh} script doesn't use the @var{TZ} environment
ad1d7b
variable information at all. Instead, this variable is used by the
ad1d7b
system shell to show the time information according to your phisical
ad1d7b
location on planet Earth.  
ad1d7b
ad1d7b
Inside your computer, the time information is firstly set in the BIOS
ad1d7b
clock (which may need correction), and later in the configuration
ad1d7b
process of CentOS distribution installer (or later, by any of the
ad1d7b
related configuration tools inside CentOS distribution).  Generally,
ad1d7b
setting time information is a straight-forward task and configuration
ad1d7b
tools available do cover most relevant location. However, if you need
ad1d7b
a time precision not provided by the configuration tools available
ad1d7b
inside CentOS distribution then, using @var{TZ} variable may be
ad1d7b
necessary.
ad1d7b
ad1d7b
@quotation
ad1d7b
@strong{Convenction} In order to keep changes syncronized between
ad1d7b
central repository and its working copies: configure both repository
ad1d7b
server and workstations (i.e., the place where each working copy is
ad1d7b
set on) to use Coordinated Universal Time (UTC) as base time
ad1d7b
representation.  Later, correct the time information for your specific
ad1d7b
location using time zone correction.
ad1d7b
@end quotation
ad1d7b
ad1d7b
The format of @var{TZ} environment variable is described in
ad1d7b
@file{tzset(3)} manual page.
ad1d7b
ad1d7b
@end table
ad1d7b
ad1d7b
@subsection Usage
ad1d7b
ad1d7b
@table @command
ad1d7b
ad1d7b
@item centos-art verify --packages
ad1d7b
ad1d7b
Verify required packages your workstation needs in order to run the
ad1d7b
@file{centos-art.sh} script correctly.  If there are missing packages,
ad1d7b
the @file{centos-art.sh} script asks you to confirm their
ad1d7b
installation. When installing packages, the @file{centos-art.sh}
ad1d7b
script uses the @command{yum} application in order to achieve the
ad1d7b
task.
ad1d7b
ad1d7b
In case all packages required by @file{centos-art.sh} script are
ad1d7b
already installed in your workstation, the message @samp{The required
ad1d7b
packages are already installed.} is output for you to know. 
ad1d7b
ad1d7b
@item centos-art verify --links
ad1d7b
ad1d7b
Verify required links your workstation needs in order to run the
ad1d7b
centos-art command correctly.  If any required link is missing, the
ad1d7b
@command{centos-art.sh} script asks you to confirm their installation.
ad1d7b
To install required links, the @command{centos-art.sh} script uses the
ad1d7b
@command{ln} command.
ad1d7b
ad1d7b
In case all links required by @file{centos-art.sh} script are already
ad1d7b
created in your workstation, the message @samp{The required links are
ad1d7b
already installed.} is output for you to know. 
ad1d7b
ad1d7b
In case a regular file exists with the same name of a required link,
ad1d7b
the @file{centos-art.sh} script outputs the @samp{Already exists as
ad1d7b
regular file.} message when listing required links that will be
ad1d7b
installed. Of course, as there is already a regular file where must be
ad1d7b
a link, no link is created. In such cases the @file{centos-art.sh}
ad1d7b
script will fall into a continue installation request for that missing
ad1d7b
link.  To end this continue request you can answer @samp{No}, or
ad1d7b
remove the existent regular file to let @file{centos-art.sh} script
ad1d7b
install the link on its place.
ad1d7b
ad1d7b
@item centos-art verify --environment
ad1d7b
@itemx centos-art verify --environment --filter='regex'
ad1d7b
ad1d7b
Output a brief description of environment variables used by
ad1d7b
@file{centos-art.sh} script. 
ad1d7b
ad1d7b
If @samp{--filter} option is provided, output is reduced as defined in
ad1d7b
the @samp{regex} regular expression value. If @samp{--filter} option
ad1d7b
is specified but @samp{regex} value is not, the @file{centos-art.sh}
ad1d7b
script outputs information as if @samp{--filter} option had not been
ad1d7b
provided at all.  
ad1d7b
ad1d7b
@end table
ad1d7b
ad1d7b
@subsection See also
ad1d7b
ad1d7b
@menu
ad1d7b
* trunk Scripts Bash::
ad1d7b
* trunk Scripts Bash Functions::
ad1d7b
@end menu