[Top][All Lists]
[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, 03 Aug 2010 14:56:09 +0000 |
CVSROOT: /sources/trans-coord
Module name: trans-coord
Changes by: Yavor Doganov <yavor> 10/08/03 14:56:09
Modified files:
gnun/server/gnun: ChangeLog GNUmakefile NEWS TODO gnun.conf
gnun/server/gnun/doc: gnun.texi web-trans.texi
Log message:
Implement automatic announcements of new translations.
* GNUmakefile (extract-title, announce): New variables containing
canned command sequences for ANNOUNCE=yes.
($(subst /po/,/,$(1).html)): Use $(addfile) conditionally
depending on the value of ANNOUNCE. Use $(announce) prior to
$(validate-article) everywhere for the sake of announcements of
new translations.
(triggers): Add commands for handling *.hook-ann files.
* gnun.conf (ann-addr): New variable.
* doc/gnun.texi (Runtime Variables): Document ANNOUNCE.
(triggers): Elaborate about *.hook-ann behavior. Update crontab
example.
* doc/web-trans.texi (Mailing Lists): Document the new LANG-ann
topics.
* NEWS: Update.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.181&r2=1.182
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile?cvsroot=trans-coord&r1=1.76&r2=1.77
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/NEWS?cvsroot=trans-coord&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/TODO?cvsroot=trans-coord&r1=1.34&r2=1.35
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun.conf?cvsroot=trans-coord&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/doc/gnun.texi?cvsroot=trans-coord&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/doc/web-trans.texi?cvsroot=trans-coord&r1=1.12&r2=1.13
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -b -r1.181 -r1.182
--- ChangeLog 2 Aug 2010 13:54:10 -0000 1.181
+++ ChangeLog 3 Aug 2010 14:56:08 -0000 1.182
@@ -1,3 +1,21 @@
+2010-08-03 Yavor Doganov <address@hidden>
+
+ Implement automatic announcements of new translations.
+ * GNUmakefile (extract-title, announce): New variables containing
+ canned command sequences for ANNOUNCE=yes.
+ ($(subst /po/,/,$(1).html)): Use $(addfile) conditionally
+ depending on the value of ANNOUNCE. Use $(announce) prior to
+ $(validate-article) everywhere for the sake of announcements of
+ new translations.
+ (triggers): Add commands for handling *.hook-ann files.
+ * gnun.conf (ann-addr): New variable.
+ * doc/gnun.texi (Runtime Variables): Document ANNOUNCE.
+ (triggers): Elaborate about *.hook-ann behavior. Update crontab
+ example.
+ * doc/web-trans.texi (Mailing Lists): Document the new LANG-ann
+ topics.
+ * NEWS: Update.
+
2010-08-02 Yavor Doganov <address@hidden>
Move *-addr definitions to a new configuration file gnun.conf.
Index: GNUmakefile
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -b -r1.76 -r1.77
--- GNUmakefile 2 Aug 2010 13:54:11 -0000 1.76
+++ GNUmakefile 3 Aug 2010 14:56:08 -0000 1.77
@@ -223,6 +223,28 @@
exit 1
endef
+# The command to extract a meaningful human-readable title from a
+# .LANG.html. Some HTML entities that are sometimes used in titles
+# are transformed, to avoid annoying stuff in email subjects.
+# Used only in article-rules, and only if ANNOUNCE=yes.
+define extract-title
+$(GREP) --max-count=1 '<h2>' $$@ | $(SED) 's/<h2>\(.*\)<\/h2>/\1/' \
+ | $(SED) 's/\—/--/g' | $(SED) 's/\&..quo;/"/g'
+endef
+
+# Construct a command sequence suitable for `mail', if the .hook-ann
+# file exists. Only applicable for article-rules, if ANNOUNCE=yes.
+# The .hook-ann files are treated differently in the `triggers' rule,
+# because it is a valid (and often occurring in practice) scenario to
+# have a new translation which is invalid (X)HTML.
+define announce
+if test -f $$(@F).hook-ann; then \
+ echo "echo '<URL:$$(subst $(rootdir),http://www.gnu.org,$$@)>' \
+ | mail -s '[$(2)] New translation: `$(extract-title)`' \
+ -a Keywords:$(2)-ann $(ann-addr)" > $$(@F).hook-ann; \
+fi
+endef
+
# The command to validate an ordinary article, and create a hook in
# case validation fails. Used only in article-rules.
define validate-article
@@ -534,8 +556,21 @@
endif
exit 1
endif
+# A slightly modified version of $(addfile) that takes care to create
+# a .hook-ann file if ANNOUNCE is enabled and it is a new translation.
+ifeq (yes,$(ANNOUNCE))
+ [ -f $$@ ] || (touch $$@ $$(@F).hook-ann; $(VCSSKIP) $(vcs) add $$@)
+else
$$(addfile)
- PO=$(1).po ; $(check-po) || (touch $$$$PO ; exit 1)
+endif
+# If a new PO file is invalid, an empty .LANG.html will be committed
+# so it is not appropriate to announce it as a "new translation".
+# Record a magic string in the .hook-ann file to make the `triggers'
+# rule DTRT.
+ PO=$(1).po; $(check-po) || (touch $$$$PO; \
+ if test -f $$(@F).hook-ann; then \
+ echo "gnun-do-not-delete-me" > $$(@F).hook-ann; \
+ fi; exit 1)
# If a translator commits a PO file based on an old version of the
# POT, it is not msgmerge'd as `make' considers the corresponding
# `$(1).po' target up-to-date. As a result, the generated HTML
@@ -564,7 +599,7 @@
$(M4) $(1).m4 > $$@
# Skip HTML validation if the article is in `no-validate-articles'.
ifneq ($(basename $(1)), $(findstring $(basename
$(1)),$(no-validate-articles)))
- $(validate-article)
+ $(announce); $(validate-article)
endif
# Check if the article is not in `no-grace-articles'.
else ifneq ($(basename $(1)), \
@@ -579,31 +614,31 @@
ifneq ($(basename $(1)), $(findstring $(basename
$(1)),$(no-validate-articles)))
if ! $(GREP) --quiet "^#, fuzzy" $(1).po || ! test -s $$@; \
then \
- ($(M4) $(1).m4 > $$@ ; $(validate-article)) ; \
+ ($(M4) $(1).m4 > $$@; $(announce); $(validate-article)); \
else \
if [ "`date --date="$(GRACE) days ago" +%Y%m%d`" -ge \
"`$(AWK) '/POT-Creation-Date/ { gsub(/-/, ""); print $$$$2 }' \
- $(1).po`" ] ; \
+ $(1).po`" ]; \
then \
- $(M4) $(1).m4 > $$@ && $(validate-article) ; \
+ $(M4) $(1).m4 > $$@ && $(announce) && $(validate-article); \
else \
- sleep 1 ; touch $(1).po ; \
- fi ; \
+ sleep 1; touch $(1).po; \
+ fi; \
fi
else
if ! $(GREP) --quiet "^#, fuzzy" $(1).po || ! test -s $$@; \
- then $(M4) $(1).m4 > $$@ ; else \
+ then $(M4) $(1).m4 > $$@; else \
if [ "`date --date="$(GRACE) days ago" +%Y%m%d`" -ge \
"`$(AWK) '/POT-Creation-Date/ { gsub(/-/, ""); print $$$$2 }' \
- $(1).po`" ] ; \
- then $(M4) $(1).m4 > $$@ ; \
- else sleep 1 ; touch $(1).po ; fi ; fi
+ $(1).po`" ]; \
+ then $(M4) $(1).m4 > $$@; \
+ else sleep 1; touch $(1).po; fi; fi
endif
else
@echo 'Ignoring grace period for article "$(notdir $(basename $(1)))"'
$(M4) $(1).m4 > $$@
ifneq ($(basename $(1)), $(findstring $(basename
$(1)),$(no-validate-articles)))
- $(validate-article)
+ $(announce); $(validate-article)
endif
endif
endef
@@ -704,12 +739,27 @@
@echo "No triggers to process; build apparently successful."
else
# Execute the command recorded in every .hook file.
- @for t in *.hook ; do \
- echo -n "Processing $$t... " && bash $$t && echo done. ; \
+ @for t in *.hook; do \
+ echo -n "Processing $$t... " && bash $$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
+# Handle announcements of new translations.
+ifeq (,$(wildcard *.hook-ann))
+ @echo "No new translations."
+else
+# If the .hook-ann file contains "gnun-do-not-delete-me", it means
+# that the build failed in article-rules while checking the PO file.
+# The .LANG.html is empty, not suitable to be announced, so do nothing
+# in this case.
+ @for t in *.hook-ann; do \
+ if ! $(GREP) --quiet 'gnun-do-not-delete-me' $$t; then \
+ echo -n "Sending announcement for $$t... " \
+ && bash $$t && echo done.; $(RM) *.hook-ann; \
+ fi; \
+ done
+endif
### Everything that has a beginning has an end. ###
Index: NEWS
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/NEWS,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- NEWS 2 Aug 2010 13:54:11 -0000 1.26
+++ NEWS 3 Aug 2010 14:56:08 -0000 1.27
@@ -9,6 +9,18 @@
The definitions of the `*-addr' variables are moved to this file,
which is installed in sysconfdir.
+** Automatic email announcements of new translations.
+ With ANNOUNCE=yes (enabled in the official GNUN build), email
+ notifications for new translations are delivered to the address
+ defined in the `ann-addr' variable (address@hidden for
+ the official instance). Separate Mailman topics are available per
+ language, so it is possible to track only new translations for a
+ particular language (or several user-selected languages), avoiding
+ mail traffic that is not of interest.
+
+ For more details, see the manuals ('(gnun)Runtime Variables' and
+ '(web-trans)Mailing Lists') and/or the homepage.
+
* Changes in GNUnited Nations 0.4 (2009-11-11)
** New script `gnun-clear-previous'.
Index: TODO
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/TODO,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- TODO 28 Sep 2009 12:10:21 -0000 1.34
+++ TODO 3 Aug 2010 14:56:08 -0000 1.35
@@ -114,14 +114,11 @@
plus probably other useful things that would save purely mechanical
work.
-** Implement notifications for new articles and translations.
- When the .pot of a new article is 'cvs add'-ed, or a fresh
- .LANG.html, it would be nice to generate messages for
- trans-coord-news. They can include a Keywords: header, so it would
- be possible to use Mailman's topic feature to subscribe for
- specific notifications. This could be widely advertised if it
- works well. Currently, it is not feasible for articles until most
- of the present become listed at gnun.mk.
+** Implement notifications for new articles.
+ When the .pot of a new article is 'cvs add'-ed, it would be nice to
+ generate messages for trans-coord-news. Currently, it is not
+ feasible until most of the present become listed at gnun.mk. OTOH,
+ important new articles ought to be announced via whatsnew.
** Internationalization.
Index: gnun.conf
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/gnun.conf,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gnun.conf 2 Aug 2010 13:58:05 -0000 1.2
+++ gnun.conf 3 Aug 2010 14:56:08 -0000 1.3
@@ -1,8 +1,10 @@
# -*-makefile-gmake-*-
# GNUnited Nations configuration file.
-# Email addresses to send notifications if NOTIFY=yes. Each variable
-# can be defined to multiple comma or space separated addresses.
+# Email addresses to send notifications about errors if NOTIFY=yes, or
+# announcements of new translations if ANNOUNCE=yes. Each variable
+# can be defined to multiple comma or space separated addresses, and
+# they can be overriden from the command line.
# Possible errors that are likely to be fixed by developers only.
devel-addr := address@hidden
@@ -14,3 +16,6 @@
# Errors in .po files, or XHTML validation of generated .LANG.html;
# translators' responsibility.
transl-addr := address@hidden
+
+# Announcements of new translations (only in effect if ANNOUNCE=yes).
+ann-addr := address@hidden
Index: doc/gnun.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/doc/gnun.texi,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- doc/gnun.texi 2 Aug 2010 13:54:11 -0000 1.22
+++ doc/gnun.texi 3 Aug 2010 14:56:08 -0000 1.23
@@ -522,6 +522,21 @@
the configuration file @file{gnun.conf} and by default are set to
@email{bug-gnun@@gnu.org}.
address@hidden new translations, notifications/announcements
address@hidden announce
address@hidden ANNOUNCE=yes
+If defined, automatic announcements for new translations will be sent to
+the address defined in the @code{ann-addr} variable (in
address@hidden). The email messages contain the translated article
+title as Subject, and the URL of the translation as its body. For the
+official GNUN build, they are delivered to the
address@hidden@@gnu.org} mailing list and each language has its
+own Mailman @dfn{topic}. It is possible to subscribe to the list and
+receive only traffic related to a specific language. @xref{Mailing
+Lists, , , web-trans, GNU Web Translators Manual}.
+
+The default behavior is not to send such announcements.
+
@cindex VERBOSE
@cindex output, detailed
@item VERBOSE=yes
@@ -691,6 +706,19 @@
based on the timestamp of the target that must be rebuilt. Finally, it
deletes all those @file{*.hook} files.
+In addition, this is the rule that takes care of actually sending the
+announcements if @code{ANNOUNCE=yes}. Since it is a completely valid
+scenario to have a new translation which is initially invalid XHTML, the
+canned command sequence for announcements is recorded in
address@hidden files, and they are treated by @code{triggers} in a
+different way. A newly added @address@hidden file may be invalid,
+in which case GNUN will commit an empty @address@hidden
+file---it is not appropriate to announce it as a new translation as it
+is an empty file completely useless for the general public. The
address@hidden rule detects this case, and postpones the announcement
+to the next build attempt, when the generated HTML translation is
+supposed to be human-readable.
+
To summarize, for effective operation GNUN should be invoked
automatically as @code{make ; cvs|svn commit -m @dots{} ; make
triggers}. To illustrate this, here is a concrete example showing the
@@ -699,8 +727,9 @@
@example
@group
25 4,12,20 * * * 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 \
+ make -j4 -C server/gnun VCS=yes VALIDATE=yes; \
+ NOTIFY=yes VERBOSE=yes GRACE=30; ANNOUNCE=yes; \
+ cvs commit -m \
"Automatic update by GNUnited Nations."; \
make -C server/gnun triggers
@end group
Index: doc/web-trans.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/doc/web-trans.texi,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- doc/web-trans.texi 14 Jul 2010 12:22:44 -0000 1.12
+++ doc/web-trans.texi 3 Aug 2010 14:56:09 -0000 1.13
@@ -5,7 +5,7 @@
@settitle GNU Web Translators Manual
@c FIXME: Would be nice to have it in the format `%:b %:d, %:y', but
@c in English.
address@hidden lastupdate 14.07.2010
address@hidden lastupdate 03.08.2010
@afourpaper
@c %**end of header
@@ -1565,9 +1565,15 @@
is very low. If you want to track only GNUN release announcements,
subscribe to the @samp{gnun} topic via Mailman's user interface.
Likewise, if you want to recieve only @dfn{What's New} updates,
-subscribe to the @samp{whatsnew} topic. In the near future, there will
-be automatic announcements for newly available English articles and
-translations.
+subscribe to the @samp{whatsnew} topic.
+
+Automatic announcements for new gnu.org translations (provided they're
+handled by GNUN) are also delivered here. There are separate
address@hidden@var{lang}-ann} topics for every GNUN-aware language, so it is a
+good idea to advertise this capability widely among your local
+community. For example, if a reader wants to be informed only about new
+Spanish translations, she can just subscribe to the @samp{es-ann}
+mailing list topic.
This is a public mailing list.