Name
----

The tuneup functionlity is part of centos-art.sh script and standardizes tasks related to file maintainance inside the working copy of CentOS Artwork Repository.

Synopsis
--------

centos-art tuneup [OPTIONS] path/to/dir

The path/to/dir parameter specifies what directory structure inside the working copy of CentOS Artwork Repository you want to process.

The tuneup functionality of centos-art.sh script accepts the following options:

--quiet

     Supress all output messages except error messages.  When this option is passed, all confirmation requests are supressed as well and a possitive answer is assumed for them, just as if the --answer-yes option had been provided.

--answer-yes

     Assume `yes' to all confirmation requests.

--filter="REGEX"

     Reduce the list of files to process using REGEX as pattern. You can use this option in combination with path/to/dir in order to control the amount of files you want to produce as base-rendition.  The deeper you go into the directory structure the more specific you'll be about the component you want to produce. When you cannot go deeper into the directory structure, you can use --filter option to reduce the list of files.

--dont-commit-changes

     Supress all commit and update actions realized over files, before and after the action itself had took place over files in the working copy.

Description
-----------

Tasks related to file maintainance are repetitive. You might find yourself doing them time after time inside the working copy of CentOS Artwork Repository. Some of these maintainance tasks do update top comments on shell scripts, create table of contents for web pages, update metadata related to design models and remove unused definitions from design models.

When you execute the tuneup functionality of centos-art.sh script, it looks for all files that match the supported extensions (e.g., .sh, .svg and .xhtml) in the directory specified, builds a list with them and applies the maintainance tasks using file extensions as reference.

Maintaining .sh files
.....................

If shell scripts are found, the tuneup functionality of centos-art.sh script reads a comment template from trunk/Scripts/Functions/Prepare/Config/shell_topcomment.sed and applies it to shell scripts found, one by one. As result, all shell scripts will end up having the same copyright and license information the comment template does.

In order for the shell script top comment template to be applied correctly, the shell scripts you write must have the following structure:

 1| #!/bin/bash
 2| #
 3| # doSomething.sh -- The function description goes here.
 4| #
 5| # Copyright
 6| #
 7| # ...
 8| #
 9| # ----------------------------------------------------------------------
10| # $Id$
11| # ----------------------------------------------------------------------
12|
13| function doSomething {
14|
15| }

The tuneup functionality of centos-art.sh script replaces all lines between the Copyright line (e.g., line 5) and the first separator line (e.g., line 9), inclusively. Everything else in the file will remain immutable.

Maintaining .svg files
......................

If scalable vector graphics are found, the tuneup functionality reads a metadata template (trunk/Scripts/Functions/Tuneup/Config/svg_metadata.sed) and applies it to all files found, one by one. Immediatly after the metadata template has been applied and, before passing to next file, all unused definition are removed from file, too.

The metadata we apply from the metadata template is created dynamicaly combining the file absolute path, the workstation time information and the centos-art.sh script copyright holder information as reference.  Additionally, the Creative Common Distribution-ShareAlike 3.0 License is also set in the metadata.

The elimination of unused definitions inside SVG files takes place through the --vacuum-defs option of inkscape command-line interface which is described in its man page (man inkscape).

Maintaining .xhtml files
........................

If web pages are found, the tuneup functionality of centos-art.sh script transforms web page headings to make them accessible through a table of contents.  The table of contents is expanded in place, wherever the <div class="toc"></div> piece of code be in the page.

Once the <div class="toc"></div> piece of code has be expanded, there is no need to put anything else in the page. You can run the tuneup functionality everytime you update the heading information so as to update the table of contents, too.

In order for the tuneup functionality of centos-art.sh script to transform headings, you need to put headings in just one line using one of the following forms:

<h1><a name="">Title</a></h1>
<h1><a href="">Title</a></h1>
<h1><a name="" href="">Title</a></h1>

In the example above, h1 can vary from h1 to h6. Closing tag must be present and also match the openning tag. The value of name and href options from the anchor element are set dynamically using the md5sum output of combining the page location, the head- string and the heading string.  If any of the components used to build the heading reference changes, you need to run the the tuneup functionality of centos-art.sh script in order for the anchor elements to use the correct information.

Examples
--------

centos-art tuneup trunk/Scripts

     Update the copyright and license notice of all the shell scripts we have in trunk/Scripts directory structure.

centos-art tuneup trunk/Identity/Models/Brands --filter="symbol"
     Update metadata and remove unused definitions from all design models in trunk/Identity/Models/Brands which have the word symbol in the file name.

centos-art tuneup trunk/Identity/Webenv/App/Home
     Update headings and the related table of contents to all web pages inside trunk/Identity/Webenv/App/Home, recusively.

Author
------

Written by Alain Reguera Delgado.

Reporting bugs
--------------

Report bugs to centos-artwork@centos.org mailing list.

Copyright
---------

Copyright ©  2009, 2010, 2011 The CentOS Project.

This is free software.  You may redistribute copies of it under the terms of the GNU General Public License (see GNU General Public License).  There is NO WARRANTY, to the extent permitted by law.

See also
--------

  * Directories trunk Scripts Functions

  * Directories trunk Scripts

  * Directories trunk