[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
trans-coord/gnun/server/gnun ChangeLog GNUmakef...
From: |
Pavel Kharitonov |
Subject: |
trans-coord/gnun/server/gnun ChangeLog GNUmakef... |
Date: |
Mon, 28 Apr 2014 09:55:46 +0000 |
CVSROOT: /sources/trans-coord
Module name: trans-coord
Changes by: Pavel Kharitonov <ineiev> 14/04/28 09:55:46
Modified files:
gnun/server/gnun: ChangeLog GNUmakefile NEWS
gnun/server/gnun/doc: gnun.texi
Log message:
* GNUmakefile (insert-ssi-vars, mark-outdated): Insert
Apache variables at the beginning of the file rather than after the
marker.
(generate-translinks): Replace ` ' with
a more breakable ` '.
(update-translinks-include): Remove an instruction used
to remove the `article_name' Apache variable.
(insert-outdated-date): Use `X-Outdated-Since' instead of
`Outdated-Since'.
(extract-outdated-date, remove-outdated-date): Recognize
`X-Outdated-Since' as well as `Outdated-Since'.
(update-po-status): Simplify a regular expression.
(vcs-add-always): Shedule removal after GNUN-0.10.
* doc/gnun.texi (Runtime Variables): Remove documentation on
`VCS=always'; the feature is not supported.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.408&r2=1.409
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile?cvsroot=trans-coord&r1=1.179&r2=1.180
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/NEWS?cvsroot=trans-coord&r1=1.105&r2=1.106
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/doc/gnun.texi?cvsroot=trans-coord&r1=1.97&r2=1.98
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.408
retrieving revision 1.409
diff -u -b -r1.408 -r1.409
--- ChangeLog 11 Apr 2014 15:32:13 -0000 1.408
+++ ChangeLog 28 Apr 2014 09:55:46 -0000 1.409
@@ -1,3 +1,21 @@
+2014-04-28 Pavel Kharitonov <address@hidden>
+
+ * GNUmakefile (insert-ssi-vars, mark-outdated): Insert
+ Apache variables at the beginning of the file rather than
+ after the marker.
+ (generate-translinks): Replace ` ' with
+ a more breakable ` '.
+ (update-translinks-include): Remove an instruction used
+ to remove the `article_name' Apache variable.
+ (insert-outdated-date): Use `X-Outdated-Since' instead of
+ `Outdated-Since'.
+ (extract-outdated-date, remove-outdated-date): Recognize
+ `X-Outdated-Since' as well as `Outdated-Since'.
+ (update-po-status): Simplify a regular expression.
+ (vcs-add-always): Shedule removal after GNUN-0.10.
+ * doc/gnun.texi (Runtime Variables): Remove documentation on
+ `VCS=always'; the feature is not supported.
+
2014-04-11 Pavel Kharitonov <address@hidden>
* GNUmakefile: Fix obsolete comments.
Index: GNUmakefile
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile,v
retrieving revision 1.179
retrieving revision 1.180
diff -u -b -r1.179 -r1.180
--- GNUmakefile 11 Apr 2014 15:32:13 -0000 1.179
+++ GNUmakefile 28 Apr 2014 09:55:46 -0000 1.180
@@ -114,18 +114,20 @@
endef
# Issue a command to add some SSI variable definitions at the beginning of
-# a HTML file produced with make-proto; template files don't contain
+# a proto file; template files don't contain
# the comment about being automatically generated by GNUN, so they are
# not affected.
# Usage: $(call
insert-ssi-vars,file.$(lang).html.${draft-suffix},file.$(lang).html)
define insert-ssi-vars
file=$(2); file_base=$$$${file%.*.html}; \
file_base=$$$${file_base#${rootdir}}; \
+if $(GREP) '<!-- This file is automatically generated by GNUnited Nations!
-->'\
+ $(1) &> /dev/null; then \
$(SED) --in-place \
- 's%<!-- This file is automatically generated by GNUnited Nations! -->%&\n\
-<!--#set var="ENGLISH_PAGE"\
-value="'"$$$${file_base}"'$(if $(findstring no, \
- $(MULTIVIEWS)),,.en).html" -->\n%' $(1)
+ '1s%^%<!--#set var="ENGLISH_PAGE"\
+ value="'"$$$${file_base}"'$(if $(findstring no, \
+ $(MULTIVIEWS)),,.en).html" -->%' $(1); \
+fi
endef
### Special variables for the `www' master templates ###
@@ -429,7 +431,7 @@
echo -n '<span dir="ltr"'$$$$class'><a lang="'$$$$code'"\
hreflang="'$$$$code'" href="'$$$${url_stem}$$$${url_suffix}.html'">' \
>> $$$${file}; \
- echo $$$${name}'</a> ['$$$${code}']</span> ' >>
$$$${file}; \
+ echo $$$${name}'</a> ['$$$${code}']</span> ' >> $$$${file};
\
fi; \
done; \
cat translist-tail.html >> $$$${file};
@@ -442,8 +444,7 @@
'<!--#include virtual="/server/gnun/initial-translations-list\.html" ' \
$(subst /po/,/,$(1).html); then \
$(SED) --in-place \
- '/^<!--#set var="article_name"/d;\
- s/<!--#include virtual="\/server\/gnun\/initial-translations-list\.html/\
+ 's/<!--#include virtual="\/server\/gnun\/initial-translations-list\.html/\
<!--#include virtual="$(subst /,\/,$(subst $(rootdir),,$(1))).translist/'
\
$(subst /po/,/,$(1).html); \
fi
@@ -491,21 +492,25 @@
comma := ,
# Generate diff file against latest translated revision
-# when available.
+# when available (if we have $(WDIFF)).
# Add notice about the translation being out of date.
# The notice is inserted after every line beginning with
# "<!--GNUN: OUT-OF-DATE NOTICE-->"
# If no such lines are found in the file, the notice
-# is inserted after <!--#include virtual="/server/banner"-->.
+# is inserted after the lines starting with
+# <!--#include virtual="/server/banner"-->.
+# Additional Apache variables are injected at the beginning
+# of the file.
# Limitation: it doesn't notice that GRACE is expired
# unless the POT file is updated at least once after
# the HTML file is marked outdated. In practice this doesn't
-# matter since GRACE value is very high.
+# matter since GRACE is very high.
define mark-outdated
marker='GNUN: OUT-OF-DATE NOTICE'; \
-$(GREP) '^<!--'"$$$${marker}-->" $(1) &> /dev/null \
+$(GREP) '^[[:space:]]*<!--'"$$$${marker}-->" $(1) &> /dev/null \
|| marker='#include virtual="\/server\/banner'; \
-original=$(1); original=$$$${original%$(2).html}html; \
+if $(GREP) '^[[:space:]]*<!--'"$$$${marker}" $(1) &> /dev/null; then \
+ original=$(1); original=$$$${original%$(2).html}html; \
$(if $(WDIFF), \
saved_file=$$$${original%/*.html}/po/$$$${original##*/}; \
saved_file=$$$${saved_file%html}$(2);\
@@ -532,29 +537,34 @@
, diff_file=""; \
) \
$(SED) --in-place \
-'/^<!--#set var="PO_FILE"/,/<!--#include virtual="\/server\/outdated/d;\
- /^<!--'"$$$${marker}"'/a\
- <!--#set var="PO_FILE"\n \
- value='"'<a href=\"http://www.gnu.org$$$${PO#$(rootdir)}\">\n\
- http://www.gnu.org$$$${PO#$(rootdir)}</a>'"' -->\n\
- <!--#set var="ORIGINAL_FILE" value="'"$$$${original#$(rootdir)}"'" -->\n \
- <!--#set var="DIFF_FILE" value="'"$$$${diff_file#$(rootdir)}"'" -->\n \
- <!--#set var="OUTDATED_SINCE"\
- value="'"`$(call extract-outdated-date,$$$$PO) | $(SED) 's/ .*//'`"'" -->\n \
+'/^<!--#set var="PO_FILE"/,/^[[:space:]]*<!--#set var="OUTDATED_SINCE"/d;\
+ /<!--#include virtual="\/server\/outdated/d;\
+ 1s%^%<!--#set var="PO_FILE"\n\
+ value='"'<a href=\"/$$$${PO#$(rootdir)}\">\n\
+ http://www.gnu.org$$$${PO#$(rootdir)}</a>'"'\n \
+ --><!--#set var="ORIGINAL_FILE" value="'"$$$${original#$(rootdir)}"'"\n\
+ --><!--#set var="DIFF_FILE" value="'"$$$${diff_file#$(rootdir)}"'"\n\
+ --><!--#set var="OUTDATED_SINCE"\
+ value="'"`$(call extract-outdated-date,$$$$PO) | $(SED) 's/ .*//'`"'"\
+ -->\n%;\
+ /^[[:space:]]*<!--'"$$$${marker}"'/a\
<!--#include virtual="/server/outdated.$(2).html" -->' $(1) \
- || true
+ || true; \
+fi
endef
# Get the generation date of the oldest POT with incomplete
-# translation stored in `Outdated-Since' field of the header.
+# translation stored in `X-Outdated-Since' field of the header.
define extract-outdated-date
($(SED) --quiet \
- '1,/^msgstr/d;/^$$$$/q 0;/^"Outdated-Since:/{s/^"Outdated-Since:
\(.*\).."$$$$/\1/;p;q 1;}' $(1); \
+ '1,/^msgstr/d;/^$$$$/q 0;\
+ /^"\(X-\)\?Outdated-Since:/{ \
+ s/^"\(X-\)\?Outdated-Since: \(.*\).."$$$$/\2/;p;q 1;}' $(1); \
test $$$$? != 0 \
)
endef
-# Copy POT generation date to `Outdated-Since' field
+# Copy POT generation date to `X-Outdated-Since' field
# unless the latter is already present.
# Insert the field after `Content-Transfer-Encoding'
# whither msgmerge would move it.
@@ -562,21 +572,21 @@
($(call extract-outdated-date,$(1)) > /dev/null \
|| $(SED) --in-place \
'1,/^"POT-Creation-Date:/{\
- p;s/^"POT-Creation-Date:/"Outdated-Since:/;h;d};\
+ p;s/^"POT-Creation-Date:/"X-Outdated-Since:/;h;d};\
1,/^"Content-Transfer-Encoding:/{\
s/^\("Content-Transfer-Encoding: \)/\1/;p;t insert;d;\
:insert x}' $(1))
endef
-# Remove `Outdated-Since' field from the header.
+# Remove `X-Outdated-Since' field from the header.
define remove-outdated-date
$(SED) --in-place \
- '/^msgid ""$$$$/,/^$$$$/{s/^"Outdated-Since: //;t rm;p;:rm d}' $(1)
+ '/^msgid ""$$$$/,/^$$$$/{/^"\(X-\)\?Outdated-Since: /d;}' $(1)
endef
define update-po-status
if LC_ALL=C $(MSGFMT) --statistics -o /dev/null $(1) 2>&1 \
- | $(EGREP) '(fuzzy|untranslated)[^:]*$$$$' > /dev/null; then \
+ | $(EGREP) '(fuzzy|untranslated)' > /dev/null; then \
$(call insert-outdated-date,$(1)); \
else \
$(call remove-outdated-date,$(1)); \
@@ -846,7 +856,7 @@
else ifneq ($(basename $(1)), \
$(findstring $(basename $(1)),$(no-grace-items)))
# If the translation is outdated, compare
-# the Outdated-Since in the $(1).po${po-suffix} with the current time
+# the X-Outdated-Since in the $(1).po${po-suffix} with the current time
# shifted by value of the $(GRACE) period and invoke regeneration only
# if the grace period is over. Likewise, check against
# $(OUTDATED-GRACE) and insert a notice into the HTML file when the
@@ -902,6 +912,7 @@
# If VCS=always, add all necessary files. The templates' POT are not
# handled for the moment, but they are more or less stable.
# WARNING: This is implemented just in case, rarely used and probably broken.
+# TODO: remove after GNUN-0.10.
ifneq (,$(findstring always,$(VCS)))
vcs-add-always: $(template-translated) $(ALL_POTS) \
$(articles-translated) \
Index: NEWS
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/NEWS,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -b -r1.105 -r1.106
--- NEWS 8 Apr 2014 06:21:21 -0000 1.105
+++ NEWS 28 Apr 2014 09:55:46 -0000 1.106
@@ -2,6 +2,9 @@
* Changes in GNUnited Nations 0.9 (????-??-??)
+** Apache variables are inserted at the beginning of the generated
+ HTML file.
+
** `make-prototype.awk' was modified to enclose translator's notes
in `<div class="translators-notes">' rather than in
`<div style="font-size: small;">'; the `<p>' element preceeding
Index: doc/gnun.texi
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/doc/gnun.texi,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -b -r1.97 -r1.98
--- doc/gnun.texi 3 Apr 2014 16:52:04 -0000 1.97
+++ doc/gnun.texi 28 Apr 2014 09:55:46 -0000 1.98
@@ -492,14 +492,6 @@
the server templates will be added, computed on the basis of the
@code{extra-templates} and @code{optional-templates} variables.
address@hidden VCS=always
-Because GNU Make considers the targets up-to-date after a successful
-build, if it was performed with no VCS interaction, the important newly
-created files will not be added (and committed when you do
address@hidden|svn|bzr commit}) in the repository. Assigning this value
-enables additional check and forcefully adds all files. Use it
-sparingly, since it is very slow and generally less reliable.
-
@cindex VALIDATE
@cindex validation
@cindex sanity checks
@@ -598,12 +590,6 @@
@end table
-Note that @code{VCS=yes,always} is a valid combination: because POT
-files of the server templates are not handled by @code{always}, running
-the build this way will commit any newly added files as specified in
address@hidden and will perform additional check at the end,
address@hidden|svn|bzr add}-ing all necessary files.
-
@cindex validation
When validation is enabled, the
original English articles are validated first, before any commands