trans-coord-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trans-coord/gnun/server/gnun ChangeLog GNUmakef...


From: Yavor Doganov
Subject: trans-coord/gnun/server/gnun ChangeLog GNUmakef...
Date: Tue, 17 Jun 2008 12:44:59 +0000

CVSROOT:        /sources/trans-coord
Module name:    trans-coord
Changes by:     Yavor Doganov <yavor>   08/06/17 12:44:59

Modified files:
        gnun/server/gnun: ChangeLog GNUmakefile gnun.texi 

Log message:
        Implement `triggers' to cope with validation errors that don't
        trigger a rebuild of the faulty targets in the automatic builds.
        * GNUmakefile (touch-hook): New variable containing a canned
        command sequence.
        ($(template-dir)/po/whatsnew.%.html, $(rootdir)/home.$(1).shtml)
        ($(subst /po/,/,$(1).html)): Use it instead of the `sleep ... ;
        touch ...' sequence.
        (triggers): New Phony target.
        * gnun.texi (triggers): New node.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.89&r2=1.90
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile?cvsroot=trans-coord&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun.texi?cvsroot=trans-coord&r1=1.32&r2=1.33

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -b -r1.89 -r1.90
--- ChangeLog   15 Jun 2008 09:57:15 -0000      1.89
+++ ChangeLog   17 Jun 2008 12:44:58 -0000      1.90
@@ -1,3 +1,15 @@
+2008-06-17  Yavor Doganov  <address@hidden>
+
+       Implement `triggers' to cope with validation errors that don't
+       trigger a rebuild of the faulty targets in the automatic builds.
+       * GNUmakefile (touch-hook): New variable containing a canned
+       command sequence.
+       ($(template-dir)/po/whatsnew.%.html, $(rootdir)/home.$(1).shtml)
+       ($(subst /po/,/,$(1).html)): Use it instead of the `sleep ... ;
+       touch ...' sequence.
+       (triggers): New Phony target.
+       * gnun.texi (triggers): New node.
+
 2008-06-15  Yavor Doganov  <address@hidden>
 
        Fix a bug in the templates POT generation.

Index: GNUmakefile
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- GNUmakefile 15 Jun 2008 08:12:45 -0000      1.47
+++ GNUmakefile 17 Jun 2008 12:44:58 -0000      1.48
@@ -187,6 +187,24 @@
 chmod +w $@
 endef
 
+# The command to touch the prerequisite $PO if HTML validation fails.
+# Unfortunately, merely touching it does not work for the automatic
+# build, because `cvs commit' is invoked after `make' and it resets
+# the `Date' keyword of the faulty target (thus resetting its
+# timestamp), so it becomes newer than the prerequisite.  `touch-hook'
+# creates an unique file in $(CURDIR) based on the target, which is
+# then processed by the `triggers' rule.  In a normal situation, the
+# filename shouldn't be unique as `make' fails on the first
+# encountered error.  However, this is necessary for `make -j' so it
+# has to be parallel safe like all the rules.  Also for `make -k'.
+# Touching the prerequisite is still needed for local non-VCS builds
+# DTRT and halt when $PO is not rectified.
+# The first test implementation was using `at + 1 hours' but it is
+# much less reliable in general.
+define touch-hook
+sleep 1 ; touch $$PO ; echo $$PO > $(@F).hook ; exit 1
+endef
+
 # Ensure that generic.LANG.html is always present for the homepage and
 # articles' generation.
 
@@ -354,7 +372,7 @@
          $(template-dir)/po/whatsnew.$*.m4
        $(M4) $(template-dir)/po/whatsnew.$*.m4 > $@
        $(VALIDATESKIP) ./validate-html-notify $(NOTIFYSKIP) $(transl-addr) \
-         $@ || (sleep 1 ; touch $(template-dir)/po/whatsnew.$*.po ; exit 1)
+         $@ || (PO=$(template-dir)/po/whatsnew.$*.po ; $(touch-hook))
 # Copy the target where it belongs.
        cp $@ $(template-dir)
 ### End of the whatsnew-specific rules ###
@@ -411,11 +429,8 @@
          "s/\(<!--#include file=\"gnusflashes*\)\(.include\" 
-->\)/\1.$(1)\2/g" \
          $(rootdir)/po/home.$(1).m4
        $(M4) $(rootdir)/po/home.$(1).m4 > $$@
-# Touching the prerequisite does not help for the automatic build,
-# since `cvs commit' run from the cronjob after make modifies the
-# target and thus it becomes newer than the prerequisite.
        $(VALIDATESKIP) ./validate-html-notify $(NOTIFYSKIP) $(transl-addr) \
-         $$@ || (sleep 1 ; touch $(rootdir)/po/home.$(1).po ; exit 1)
+         $$@ || (PO=$(rootdir)/po/home.$(1).po ; $$(touch-hook))
 endef
 
 $(foreach h-lang,$(HOME_LINGUAS),$(eval $(call home-rules,$(h-lang))))
@@ -482,7 +497,7 @@
        done
        $(M4) $(1).m4 > $$@
        $(VALIDATESKIP) ./validate-html-notify $(NOTIFYSKIP) $(transl-addr) \
-         $$@ || (sleep 1 ; touch $(1).po ; exit 1)
+         $$@ || (PO=$(1).po ; $$(touch-hook))
 endef
 
 $(foreach base,$(ALL_BASE),$(eval $(call article-pot-rules,$(base))))
@@ -566,3 +581,21 @@
          -exec $(MSGFMT) --statistics -o /dev/null '{}' \; 2>&1 \
            | sort | egrep '(fuzzy|untranslated)' \
          || echo "All translations seem to be up-to-date."
+
+# Special target to touch all the prerequisites of the targets that
+# failed HTML validation and thus to trigger a rebuild in the next
+# run.
+.PHONY: triggers
+triggers:
+ifeq (,$(wildcard *.hook))
+       @echo "No triggers to process; build apparently successful."
+else
+       @for t in *.hook ; do \
+         echo -n "Processing $$t... " && touch `cat $$t` && echo done. ; \
+       done
+# Delete all *.hook files, or else there will be useless rebuilds
+# every time updating the `Date' timestamp in .LANG.html.
+       $(RM) *.hook
+endif
+
+### Everything that has a beginning has an end. ###

Index: gnun.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/gnun.texi,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- gnun.texi   12 Jun 2008 10:35:11 -0000      1.32
+++ gnun.texi   17 Jun 2008 12:44:58 -0000      1.33
@@ -5,7 +5,7 @@
 @c FIXME: Would be nice to have it in the format `%:b %:d, %:y', but
 @c in English.  This is going to be changed anyway when GNUN is released
 @c as a GNU package.
address@hidden lastupdate 12.06.2008
address@hidden lastupdate 17.06.2008
 @afourpaper
 @c %**end of header
 
@@ -561,6 +561,7 @@
 @menu
 * sync::
 * report::
+* triggers::
 * clean::
 * distclean::
 @end menu
@@ -626,6 +627,48 @@
 up-to-date.  In fact, this is one of the main reasons GNUN is being
 developed, if you recall.
 
address@hidden triggers
address@hidden The @code{triggers} target
+
+This is a special target intended to be run by the automatic build
+after the main build and @emph{after} @code{cvs commit}.
+
+When a @acronym{GNUN} build completes and some translations fail at the
+XHTML validation stage, the result is checked in the repository, as
+explained earlier (@pxref{Runtime Variables}).  Thus, CVS updates the
address@hidden RCS keyword (or any other keywords, for that matter) and
+resets the file(s) timestamp.  Next time @command{make} is invoked, the
+target appears newer than the prerequisite so no rebuild is triggered.
+The purpose of the @code{triggers} target is to ``save'' the information
+of the faulty targets during the main build, and to touch their
+prerquisites in order such invalid articles not to remain online
+unnoticed.
+
+The @code{triggers} target currently @command{touch}-es the contents of
+the files named @address@hidden@var{lang}.html.hook} in the
address@hidden/gnun} directory---these files are created during the main
+build and each of them contains the relative location of the
+prerequisite that must be touched.  Finally, it deletes all those
address@hidden files.
+
+To summarize, for effective operation @acronym{GNUN} should be invoked
+automatically as @code{make ; cvs commit -m @dots{} ; make triggers}.
+To illustrate this, here is a concrete example showing the official job
+running at fencepost.gnu.org:
+
address@hidden
address@hidden
+25 16 * * *  cd $HOME/projects/www ; cvs -q update &>/dev/null ; \
+             make -C server/gnun VCS=yes VALIDATE=yes NOTIFY=yes \
+             VERBOSE=yes ; cvs commit -m \
+             "Automatic update by GNUnited Nations." ; \
+             make -C server/gnun triggers
address@hidden group
address@hidden example
+
+In the future, this target may be extended further to do other useful
+things that should be ``triggered'' after the main build.
+
 @node clean
 @subsubsection The @code{clean} target
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]