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

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

[gnu.org-i18n] r317 - in gnu.org-i18n/po4a/www: . prep/i18n


From: Corellia
Subject: [gnu.org-i18n] r317 - in gnu.org-i18n/po4a/www: . prep/i18n
Date: Fri, 28 Dec 2007 01:47:31 +0200

Author: yavor
Date: Fri Dec 28 01:47:30 2007
New Revision: 317

Log:
Initial partially working VCS support for generic.xx.html and the
homepages.
(CVS): New variable.
(CVSOPTS): New conditionally defined variable, based on the value
of VCS.
(addfile, addfile_dbl): Define command sequences for convenience.
(generic_rules): Use them.  Implement a conditional double-colon
template rule and modified commands based on VCS=always and
CVS=svn.
($(rootdir)/po/home.pot, $(rootdir)/home.$(1).shtml): Add
conditional commands for adding the targets under VCS control.
Does not work reliably (or should I say "at all") with `make
VCS=always' when the targets are considered up-to-date. 


Modified:
   gnu.org-i18n/po4a/www/ChangeLog
   gnu.org-i18n/po4a/www/prep/i18n/GNUmakefile

Modified: gnu.org-i18n/po4a/www/ChangeLog
==============================================================================
--- gnu.org-i18n/po4a/www/ChangeLog     (original)
+++ gnu.org-i18n/po4a/www/ChangeLog     Fri Dec 28 01:47:30 2007
@@ -1,3 +1,19 @@
+2007-12-28  Yavor Doganov  <address@hidden>
+
+       Initial partially working VCS support for generic.xx.html and the
+       homepages.
+       * prep/i18n/GNUmakefile (CVS): New variable.
+       (CVSOPTS): New conditionally defined variable, based on the value
+       of VCS.
+       (addfile, addfile_dbl): Define command sequences for convenience.
+       (generic_rules): Use them.  Implement a conditional double-colon
+       template rule and modified commands based on VCS=always and
+       CVS=svn.
+       ($(rootdir)/po/home.pot, $(rootdir)/home.$(1).shtml): Add
+       conditional commands for adding the targets under VCS control.
+       Does not work reliably (or should I say "at all") with `make
+       VCS=always' when the targets are considered up-to-date. 
+
 2007-12-12  Yavor Doganov  <address@hidden>
 
        * home.bg.shtml: Regenerate.

Modified: gnu.org-i18n/po4a/www/prep/i18n/GNUmakefile
==============================================================================
--- gnu.org-i18n/po4a/www/prep/i18n/GNUmakefile (original)
+++ gnu.org-i18n/po4a/www/prep/i18n/GNUmakefile Fri Dec 28 01:47:30 2007
@@ -31,6 +31,17 @@
 
 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
+
+# Do not change any files by default unless VCS=yes.
+ifneq (,$(findstring yes,$(VCS)))
+CVSOPTS :=
+else
+CVSOPTS := -n
+endif
+
 rootdir := ../..
 replaceable_includes := header banner footer footer-short footer-min
 
@@ -72,11 +83,40 @@
 .PHONY: all
 all: $(template_translated) $(home_translated) $(ALL_POTS) 
$(articles_translated)
 
+# 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
+
+# This is the same as `addfile', but with double expansion.
+define addfile_dbl
+[ -f $$@ ] || ( $(TOUCH) $$@ ; $(CVS) $(CVSOPTS) add $$@ )
+endef
+
 # 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))))
@@ -104,14 +144,27 @@
 
 ### Specific rules for the homepages ###
 $(rootdir)/po/home.proto: $(rootdir)/home.shtml
-       # Delete the target if the script exits with a non-zero status
-       # in order to prevent further messing up in the chain.  For
-       # extra safety, exit with an error so that make does not
-       # proceed to the next command.
+# Delete the target if the script exits with a non-zero status
+# in order to prevent further messing up in the chain.  For
+# extra safety, exit with an error so that make does not
+# proceed to the next command.
        $(MAKE-PROTOTYPE-HOME) $< generic.html $@ || ($(RM) $@ ; exit 1)
        $(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
@@ -120,6 +173,16 @@
        $(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




reply via email to

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