Blame Manuals/RepoReferences/en_US/Directories/trunk/Scripts/Functions/Tuneup.texinfo

b32b45
@subheading Name
b32b45
b32b45
The @code{tuneup} functionlity is part of @command{centos-art.sh}
b32b45
script and standardizes tasks related to file maintainance inside the
b32b45
working copy of CentOS Artwork Repository.
b32b45
b32b45
@subheading Synopsis
b32b45
b32b45
@command{centos-art tuneup [OPTIONS] path/to/dir}
b32b45
b32b45
The @file{path/to/dir} parameter specifies what directory structure
b32b45
inside the working copy of CentOS Artwork Repository you want to
b32b45
process. 
b32b45
b32b45
The @code{tuneup} functionality of @command{centos-art.sh} script
b32b45
accepts the following options:
b32b45
b32b45
@table @option
b32b45
@item --quiet
b32b45
b32b45
Supress all output messages except error messages.  When this option
b32b45
is passed, all confirmation requests are supressed as well and a
b32b45
possitive answer is assumed for them, just as if the
b32b45
@option{--answer-yes} option had been provided.
b32b45
b32b45
@item --answer-yes
b32b45
b32b45
Assume `yes' to all confirmation requests.
b32b45
b32b45
@item --filter="REGEX"
b32b45
b32b45
Reduce the list of files to process using @samp{REGEX} as pattern.
b32b45
You can use this option in combination with @file{path/to/dir} in
b32b45
order to control the amount of files you want to produce as
b32b45
base-rendition.  The deeper you go into the directory structure the
b32b45
more specific you'll be about the component you want to produce. When
b32b45
you cannot go deeper into the directory structure, you can use
b32b45
@option{--filter} option to reduce the list of files.
b32b45
b32b45
@item --dont-commit-changes
b32b45
b32b45
Supress all commit and update actions realized over files, before and
b32b45
after the action itself had took place over files in the working copy.
b32b45
b32b45
@end table
b32b45
b32b45
@subheading Description
b32b45
b32b45
Tasks related to file maintainance are repetitive. You might find
b32b45
yourself doing them time after time inside the working copy of CentOS
b32b45
Artwork Repository. Some of these maintainance tasks do update top
b32b45
comments on shell scripts, create table of contents for web pages,
b32b45
update metadata related to design models and remove unused definitions
b32b45
from design models.
b32b45
b32b45
When you execute the @code{tuneup} functionality of
b32b45
@command{centos-art.sh} script, it looks for all files that match the
b32b45
supported extensions (e.g., @file{.sh}, @file{.svg} and @file{.xhtml})
b32b45
in the directory specified, builds a list with them and applies the
b32b45
maintainance tasks using file extensions as reference.
b32b45
b32b45
@subsubheading Maintaining @file{.sh} files
b32b45
b32b45
If shell scripts are found, the @code{tuneup} functionality of
b32b45
@command{centos-art.sh} script reads a comment template from
b32b45
@file{trunk/Scripts/Functions/Prepare/Config/shell_topcomment.sed} and
b32b45
applies it to shell scripts found, one by one. As result, all shell
b32b45
scripts will end up having the same copyright and license information
b32b45
the comment template does.
b32b45
b32b45
In order for the shell script top comment template to be applied
b32b45
correctly, the shell scripts you write must have the following
b32b45
structure:
b32b45
b32b45
@verbatim
b32b45
 1| #!/bin/bash
b32b45
 2| #
b32b45
 3| # doSomething.sh -- The function description goes here.
b32b45
 4| # 
b32b45
 5| # Copyright
b32b45
 6| #
b32b45
 7| # ...
b32b45
 8| #
b32b45
 9| # ----------------------------------------------------------------------
b32b45
10| # $Id$
b32b45
11| # ----------------------------------------------------------------------
b32b45
12|
b32b45
13| function doSomething {
b32b45
14|     
b32b45
15| }
b32b45
@end verbatim
b32b45
b32b45
The @code{tuneup} functionality of @command{centos-art.sh} script
b32b45
replaces all lines between the @samp{Copyright} line (e.g., line 5)
b32b45
and the first separator line (e.g., line 9), inclusively. Everything
b32b45
else in the file will remain immutable.
b32b45
b32b45
@subsubheading Maintaining @file{.svg} files
b32b45
b32b45
If scalable vector graphics are found, the @code{tuneup} functionality
b32b45
reads a metadata template
b32b45
(@file{trunk/Scripts/Functions/Tuneup/Config/svg_metadata.sed}) and
b32b45
applies it to all files found, one by one. Immediatly after the
b32b45
metadata template has been applied and, before passing to next file,
b32b45
all unused definition are removed from file, too.
b32b45
b32b45
The metadata we apply from the metadata template is created dynamicaly
b32b45
combining the file absolute path, the workstation time information and
b32b45
the @command{centos-art.sh} script copyright holder information as
b32b45
reference.  Additionally, the @emph{Creative Common
b32b45
Distribution-ShareAlike 3.0 License} is also set in the metadata.
b32b45
b32b45
The elimination of unused definitions inside SVG files takes place
b32b45
through the @option{--vacuum-defs} option of @command{inkscape}
b32b45
command-line interface which is described in its man page
b32b45
(@command{man inkscape}).
b32b45
b32b45
@subsubheading Maintaining @file{.xhtml} files
b32b45
b32b45
If web pages are found, the @code{tuneup} functionality of
b32b45
@command{centos-art.sh} script transforms web page headings to make
b32b45
them accessible through a table of contents.  The table of contents is
b32b45
expanded in place, wherever the @code{
} piece
b32b45
of code be in the page. 
b32b45
b32b45
Once the @code{
} piece of code has be expanded,
b32b45
there is no need to put anything else in the page. You can run the
b32b45
@code{tuneup} functionality everytime you update the heading
b32b45
information so as to update the table of contents, too.
b32b45
b32b45
In order for the @code{tuneup} functionality of
b32b45
@command{centos-art.sh} script to transform headings, you need to put
b32b45
headings in just one line using one of the following forms:
b32b45
b32b45
@verbatim
b32b45

Title

b32b45

Title

b32b45

Title

b32b45
@end verbatim
b32b45
b32b45
In the example above, h1 can vary from h1 to h6. Closing tag must be
b32b45
present and also match the openning tag. The value of @option{name}
b32b45
and @option{href} options from the anchor element are set dynamically
b32b45
using the md5sum output of combining the page location, the
b32b45
@code{head-} string and the heading string.  If any of the components
b32b45
used to build the heading reference changes, you need to run the the
b32b45
@code{tuneup} functionality of @command{centos-art.sh} script in order
b32b45
for the anchor elements to use the correct information.
b32b45
b32b45
@subheading Examples
b32b45
b32b45
@table @command
b32b45
@item centos-art tuneup trunk/Scripts
b32b45
b32b45
Update the copyright and license notice of all the shell scripts we
b32b45
have in @file{trunk/Scripts} directory structure.
b32b45
b32b45
@item centos-art tuneup trunk/Identity/Models/Brands --filter="symbol"
b32b45
Update metadata and remove unused definitions from all design models
b32b45
in @file{trunk/Identity/Models/Brands} which have the word
b32b45
@samp{symbol} in the file name.
b32b45
b32b45
@item centos-art tuneup trunk/Identity/Webenv/App/Home
b32b45
Update headings and the related table of contents to all web pages
b32b45
inside @file{trunk/Identity/Webenv/App/Home}, recusively.
b32b45
@end table
b32b45
b32b45
@subheading Author
b32b45
b32b45
Written by Alain Reguera Delgado.
b32b45
b32b45
@subheading Reporting bugs
b32b45
b32b45
Report bugs to @email{centos-artwork@@centos.org} mailing list.
b32b45
b32b45
@subheading Copyright
b32b45
b32b45
Copyright @copyright{}  2009, 2010, 2011 The CentOS Project.
b32b45
b32b45
This is free software.  You may redistribute copies of it under the
b32b45
terms of the GNU General Public License (@pxref{GNU General Public
b32b45
License}).  There is NO WARRANTY, to the extent permitted by law.
b32b45
b32b45
@subheading See also
b32b45
b32b45
@itemize
b32b45
@item @ref{Directories trunk Scripts Functions}
b32b45
@item @ref{Directories trunk Scripts}
b32b45
@item @ref{Directories trunk}
b32b45
@end itemize