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

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

trans-coord/gnun/prep/gnun ChangeLog GNUmakefil...


From: Yavor Doganov
Subject: trans-coord/gnun/prep/gnun ChangeLog GNUmakefil...
Date: Sat, 26 Jan 2008 20:09:16 +0000

CVSROOT:        /cvsroot/trans-coord
Module name:    trans-coord
Changes by:     Yavor Doganov <yavor>   08/01/26 20:09:16

Modified files:
        gnun/prep/gnun : ChangeLog GNUmakefile TODO 

Log message:
        Complete support for VCS=(yes|always).
        * GNUmakefile (CVS): Define to cvs.
        (vc-add-always): New conditional Phony target.
        (all): Depend on vcs-add-always.
        (generic_rules): Simplify and delete the double-colon rule; no
        longer needed.  Remove Subversion-specific conditionals.
        ($(rootdir)/po/home.pot, $(rootdir)/home.$(1).shtml): Adjust as
        above.
        ($(template_dir)/po/%.pot, $(template_dir)/%.$(1).html, $(1).pot)
        ($(subst /po/,/,$(1).html)): Add ($addfile) or$(addfile_dbl) as
        first command to the recipe, where appropriate. 
        (sync): Use the CVS variable for consistency.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/prep/gnun/ChangeLog?cvsroot=trans-coord&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/prep/gnun/GNUmakefile?cvsroot=trans-coord&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/prep/gnun/TODO?cvsroot=trans-coord&r1=1.3&r2=1.4

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/trans-coord/trans-coord/gnun/prep/gnun/ChangeLog,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- ChangeLog   26 Jan 2008 19:22:50 -0000      1.6
+++ ChangeLog   26 Jan 2008 20:09:16 -0000      1.7
@@ -1,3 +1,18 @@
+2008-01-26  Yavor Doganov  <address@hidden>
+
+       Complete support for VCS=(yes|always).
+       * GNUmakefile (CVS): Define to cvs.
+       (vc-add-always): New conditional Phony target.
+       (all): Depend on vcs-add-always.
+       (generic_rules): Simplify and delete the double-colon rule; no
+       longer needed.  Remove Subversion-specific conditionals.
+       ($(rootdir)/po/home.pot, $(rootdir)/home.$(1).shtml): Adjust as
+       above.
+       ($(template_dir)/po/%.pot, $(template_dir)/%.$(1).html, $(1).pot)
+       ($(subst /po/,/,$(1).html)): Add ($addfile) or$(addfile_dbl) as
+       first command to the recipe, where appropriate. 
+       (sync): Use the CVS variable for consistency.
+
 2008-01-26  Kaloian Doganov  <address@hidden>
 
        * GNUmakefile (template_rules, home_rules)

Index: GNUmakefile
===================================================================
RCS file: /cvsroot/trans-coord/trans-coord/gnun/prep/gnun/GNUmakefile,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- GNUmakefile 26 Jan 2008 19:23:32 -0000      1.10
+++ GNUmakefile 26 Jan 2008 20:09:16 -0000      1.11
@@ -30,11 +30,12 @@
 
 PO4A_XHTMLFLAGS = --format=xhtml -o ontagerror=silent -o "tags=<gnu.org-i18n>"
 
-# FIXME: Change to `cvs' when we start using it but it is still useful
-# (although not much) to have it as a variable.
-CVS := svn
+# This variable exists only for the purpose of defining it to a
+# non-standard executable while testing future cvs releases.  The
+# rules already depend on cvs-specific options.
+CVS := cvs
 
-# Do not change any files by default unless VCS=yes.
+# Do not `cvs add' any files by default unless VCS=yes.
 ifneq (,$(findstring yes,$(VCS)))
 CVSOPTS :=
 else
@@ -79,14 +80,12 @@
 $(info articles_translated = $(articles_translated))   # for debugging purposes
 ### End of variables declaration (all articles) ###
 
-.PHONY: all
-all: $(template_translated) $(home_translated) $(ALL_POTS) 
$(articles_translated)
+.PHONY: all vcs-add-always
+all: $(template_translated) $(home_translated) $(ALL_POTS) \
+     $(articles_translated) vcs-add-always
 
 # The command to add a file to the repository.
 define addfile
-# FIXME: Since there is no way for automatic variables to work with
-# `make' conditionals, variations of this command sequence are
-# repeated along all rules.
 [ -f $@ ] || ($(TOUCH) $@ ; $(CVS) $(CVSOPTS) add $@)
 endef
 
@@ -98,24 +97,8 @@
 # Ensure that generic.LANG.html is always present for the homepage and
 # articles' generation.
 define generic_rules
-# If VCS=always, the file is always added.  The command sequence exits
-# with a zero code status because cvs will return 1 if the file is
-# already added.
-# FIXME: A better way is to check for the `Unknown' status, but it is
-# slower and incompatible with Subversion.
-ifneq (,$(findstring always,$(VCS)))
-generic.$(1).html::
-       ($(TOUCH) $$@ ; $(CVS) add $$@ ; exit 0)
-else
 generic.$(1).html:
-# Just a workaround, SVN does not accept `-n' as argment so VCS=yes
-# does nothing with Subversion. 
-ifeq ($(CVS), svn)
-       [ -f $$@ ] || $(TOUCH) $$@
-else
        $(addfile_dbl)
-endif
-endif
 endef
 
 $(foreach h_lang,$(HOME_LINGUAS),$(eval $(call generic_rules,$(h_lang))))
@@ -124,6 +107,7 @@
 ### Specific rules for the templates ###
 .PRECIOUS: $(template_dir)/po/%.pot
 $(template_dir)/po/%.pot: $(template_dir)/%.html
+       $(addfile)
        @echo Generating POT...
        $(PO4A-GETTEXTIZE) $(PO4A_XHTMLFLAGS) $(PO4A-GETTEXTIZEFLAGS) --master 
$< --po $@
 
@@ -133,6 +117,7 @@
        $(MSGMERGE) --update $$@ $$< && $(TOUCH) $$@
 
 $(template_dir)/%.$(1).html: $(template_dir)/%.html 
$(template_dir)/po/%.$(1).po
+       $(addfile_dbl)
        @echo Generating the translated article...
        $(PO4A-TRANSLATE) $(PO4A_XHTMLFLAGS) $(PO4A-TRANSLATEFLAGS) --master 
$$< --po \
                $(template_dir)/po/$$(*F).$(1).po --localized $$@
@@ -152,19 +137,7 @@
        $(SED) --in-place "s/\$$Date.*\$$/<gnu.org-i18n>\0<\/gnu.org-i18n>/g" $@
 
 $(rootdir)/po/home.pot: $(rootdir)/po/home.proto
-# FIXME: Obviously, this does not work when one has already invoked
-# `make' because the target is considered up to date.  The
-# double-colon rule approach is not feasible, so it has to be reworked
-# to check the CVS/SVN status of the target.
-ifneq (,$(findstring always,$(VCS)))
-       ($(TOUCH) $@ ; $(CVS) add $@ ; exit 0)
-else
-ifeq ($(CVS), svn)
-       [ -f $@ ] || $(TOUCH) $@
-else
        $(addfile)
-endif
-endif
        $(PO4A-GETTEXTIZE) $(PO4A_XHTMLFLAGS) $(PO4A-GETTEXTIZEFLAGS) --master 
$< --po $@
 
 define home_rules
@@ -173,16 +146,7 @@
        $(TOUCH) $$@
 
 $(rootdir)/home.$(1).shtml: $(rootdir)/po/home.proto 
$(rootdir)/po/home.$(1).po generic.$(1).html
-# FIXME: Does not work.
-ifneq (,$(findstring always,$(VCS)))
-       ($(TOUCH) $$@ ; $(CVS) add $$@ ; exit 0)
-else
-ifeq ($(CVS), svn)
-       [ -f $$@ ] || $(TOUCH) $$@
-else
        $(addfile_dbl)
-endif
-endif
        $(PO4A-TRANSLATE) $(PO4A_XHTMLFLAGS) $(PO4A-TRANSLATEFLAGS) --master 
$$< --po $(rootdir)/po/home.$(1).po --localized $(rootdir)/po/home.$(1).m4
        $(SED) --in-place 
"s/\(<gnu.org-i18n>include(\`.*\)\([.]html')<\/gnu.org-i18n>\)/\1.$(1)\2/g" 
$(rootdir)/po/home.$(1).m4
        $(SED) --in-place "s/<gnu.org-i18n>\(.*\)<\/gnu.org-i18n>/\1/g" 
$(rootdir)/po/home.$(1).m4
@@ -212,6 +176,7 @@
        $(SED) --in-place 
"s/\$$$$Date.*\$$$$/<gnu.org-i18n>\0<\/gnu.org-i18n>/g" $(1).proto
 
 $(1).pot: $(1).proto
+       $(addfile_dbl)
        $(PO4A-GETTEXTIZE) $(PO4A_XHTMLFLAGS) $(PO4A-GETTEXTIZEFLAGS) --master 
$$< --po $$@
 endef
 
@@ -221,6 +186,7 @@
        $(TOUCH) $$@
 
 $(subst /po/,/,$(1).html): $(basename $(1)).proto $(basename $(1)).translinks 
$(1).po generic.$(2).html
+       $(addfile_dbl)
        $(PO4A-TRANSLATE) $(PO4A_XHTMLFLAGS) $(PO4A-TRANSLATEFLAGS) --master 
$$< --po $(1).po --localized $(1).m4
        $(SED) --in-place 
"s/\(<gnu.org-i18n>include(\`.*\)\([.]html')<\/gnu.org-i18n>\)/\1.$(2)\2/g" 
$(1).m4
        $(SED) --in-place "s/<gnu.org-i18n>\(.*\)<\/gnu.org-i18n>/\1/g" $(1).m4
@@ -236,6 +202,19 @@
 $(foreach po_base,$(ALL_POS_BASE),$(eval $(call 
article_rules,$(po_base),$(subst .,,$(suffix $(po_base))))))
 ### End of all articles' rules ###
 
+# If VCS=always, add all necessary files.  The templates' POT are not
+# handled for the moment, but they are more or less stable.  Also,
+# there is no sense in adding home.pot as this should happen only once.
+# WARNING: This is horribly slow and is implemented just in case.
+ifneq (,$(findstring always,$(VCS)))
+vcs-add-always:
+       for file in $(template_translated) $(home_translated) $(ALL_POTS) \
+         $(articles_translated) $(wildcard generic.*.html); do \
+         ($(CVS) add $$file ; exit 0) ; done
+else
+vcs-add-always: ;
+endif
+
 # Special target to sync the original English articles from the `www'
 # repository.  It is intended to be invoked by a fencepost cron job
 # and will be useful even when GNUN is deployed.  Automatic adding and
@@ -252,4 +231,4 @@
        for file in $(abs-files-to-sync) ; do \
          cp -p --update $(wwwdir)/$$file $(rootdir)/$$file ; done
        cd $(rootdir) ; \
-         cvs commit -m "Automatic sync from the master www repository."
+         $(CVS) commit -m "Automatic sync from the master www repository."

Index: TODO
===================================================================
RCS file: /cvsroot/trans-coord/trans-coord/gnun/prep/gnun/TODO,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- TODO        26 Jan 2008 19:25:46 -0000      1.3
+++ TODO        26 Jan 2008 20:09:16 -0000      1.4
@@ -19,16 +19,6 @@
 ** Experiment with msgmerge's `--previous' option and make it the
    default, if feasible.  Requires gettext >= 0.16.
 
-** Add commands to the necessary targets that will cvs add the
-   generated POT and the translated HTML, where appropriate.
-
-   More specifically, the system should cvs add these files if they are
-   created by the make process:
-
-    /prep/i18n/generic.xx.html (empty file)
-    /foo/article.pot (when web-translators managers add a new article)
-    /foo/article.xx.html (when a translator commits article.xx.po).
-
 ** Write a script that will itself invoke $(MAKE), log all output in a
    file and cvs commit everything ought to be committed.  Deal with SSH
    woes in order the whole operation to be performed automatically.




reply via email to

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