Next: , Previous: report, Up: Special Targets


2.1.2.3 The triggers target

This is a special target intended to be run by the automatic build after the main build and after cvs|svn commit.

When a GNUN build completes and some translations fail at the XHTML validation stage, the result is checked in the repository, as explained earlier (see Runtime Variables). Thus, CVS updates the $Date$ RCS keyword (or any other keywords, for that matter) and resets the file(s) timestamp. Next time make is invoked, the target appears newer than the prerequisite so no rebuild is triggered. The purpose of the triggers target is to “save” the information of the faulty targets during the main build, and to touch their prerequisites in order such invalid articles not to remain online unnoticed.

The triggers target currently executes the files named article.lang.html.hook in the server/gnun directory—these files are created during the main build and each of them contains the command to update the timestamp of the prerequisite based on the timestamp of the target that must be rebuilt. Finally, it deletes all those *.hook files.

To summarize, for effective operation GNUN should be invoked automatically as make ; cvs|svn commit -m ... ; make triggers. To illustrate this, here is a concrete example showing the official job running at fencepost.gnu.org:

     25 4,16 * * *  cd $HOME/projects/www ; cvs -q update &>/dev/null ; \
                      make -j4 -C server/gnun VCS=yes VALIDATE=yes NOTIFY=yes \
                      VERBOSE=yes GRACE=30 ; cvs commit -m \
                      "Automatic update by GNUnited Nations." ; \
                      make -C server/gnun triggers

In the future, this target may be extended further to do other useful things that should be “triggered” after the main build.