Blame Manuals/Texinfo/Directories/trunk/Scripts/Functions/Tuneup.texinfo

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

Title

e3ad4e

Title

e3ad4e

Title

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