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

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

trans-coord/gnun/server/gnun GNUmakefile.team C...


From: Pavel Kharitonov
Subject: trans-coord/gnun/server/gnun GNUmakefile.team C...
Date: Thu, 22 Nov 2012 16:05:37 +0000

CVSROOT:        /sources/trans-coord
Module name:    trans-coord
Changes by:     Pavel Kharitonov <ineiev>       12/11/22 16:05:37

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

Log message:
        (ECHO): Remove the variable.
        (MSGMERGEFLAGS): New variable.
        (sync): Cleanup.  Improve output.  Ignore empty lines
        and comments when comparing PO files.
        (format): Rewrap all files unconditionally.
        (report-pos): Output statistics for files that need updating.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/GNUmakefile.team?cvsroot=trans-coord&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/ChangeLog?cvsroot=trans-coord&r1=1.303&r2=1.304

Patches:
Index: GNUmakefile.team
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/GNUmakefile.team,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- GNUmakefile.team    13 Sep 2012 07:40:45 -0000      1.14
+++ GNUmakefile.team    22 Nov 2012 16:05:36 -0000      1.15
@@ -43,6 +43,7 @@
 
 # Adjust these variables if you don't have the programs in your PATH.
 MSGMERGE := msgmerge
+MSGMERGEFLAGS := --previous --backup=none
 MSGFMT := msgfmt
 MSGCAT := msgcat
 CVS := cvs
@@ -72,7 +73,6 @@
 $(info Repository: $(REPO))
 $(info translations = $(translations))
 MSGMERGEVERBOSE := --verbose
-ECHO := echo $$file: ;
 CVSQUIET :=
 # Applicable for Bzr, Git and Hg.
 QUIET := --verbose
@@ -128,17 +128,22 @@
        @for file in $(translations); do \
          if [ ! -f $(wwwdir)`dirname $$file`/po/`basename \
            $${file/.$(TEAM).po/.pot}` ]; then \
-           echo "Warning: $(notdir $$file) has no equivalent .pot in www."; \
+           echo "Warning: $${file#./} has no equivalent .pot in www."; \
          else \
-           $(ECHO) www_po=$(wwwdir)`dirname $$file`/po/`basename $${file}`; \
-             if test -f $${www_po} ;then \
+           echo -n "$${file#./}: "; \
+           www_po=$(wwwdir)`dirname $$file`/po/`basename $${file}`; \
+           if test -f $${www_po}; then \
                comp="-C $${www_po}"; \
              else \
                comp=; \
              fi; \
-           diff -q $${file} $${www_po} 2>/dev/null \
-             || $(MSGMERGE) $(MSGMERGEVERBOSE) $${comp} --quiet --update \
-               --previous $$file $${www_po%.$(TEAM).po}.pot; \
+           diff -q -I "^$$" -I "^#" $${file} $${www_po} &>/dev/null \
+             && echo "Already in sync." \
+             || { \
+                  echo -n "Merging"; \
+                  $(MSGMERGE) $(MSGMERGEFLAGS) $(MSGMERGEVERBOSE) $${comp} \
+                    --update $$file $${www_po%.$(TEAM).po}.pot 2>&1; \
+               } \
          fi; \
        done
 ifeq ($(VCS),yes)
@@ -190,9 +195,10 @@
 define report-pos
 @$(if $(1), $(if $(2), echo "  "$(strip $(2)); echo;) \
     for file in $(1); do \
-      LC_ALL=C $(MSGFMT) --statistics -o /dev/null $$file 2>&1 \
-                | egrep '(fuzzy|untranslated)[^:]*$$' \
-       && echo "$${file#./} needs updating." || true ; \
+      statistics=`LC_ALL=C $(MSGFMT) --statistics -o /dev/null $$file 2>&1 \
+                  | egrep '(fuzzy|untranslated)'`; \
+      test -n "$$statistics" && echo "$${file#./}:" $$statistics \
+      || true ; \
     done; $(if $(2), echo;))
 endef
 
@@ -214,10 +220,13 @@
 .PHONY: format
 format:
        @echo Formatting .po files with msgcat:
+# Earlier used `if [ wc --max-line-length $$file -gt 80 ] ; then $(MSGCAT)...'
+# is not adequate because (0) msgcat doesn't wrap long comment lines
+# and (1) msgmerge in the GNUN cron job rewraps strings with short lines,
+# so there still would be a non-zero difference.  On the other hand,
+# it doesn't take too long time to rewrap the files unconditionally.
        @for file in $(translations); do \
-         if [ `LC_ALL=C <$$file wc --max-line-length` -gt 80 ]; then \
            $(MSGCAT) -o $$file $$file && echo "  $${file#./}"; \
-         fi; \
        done
 
 # Helper target to copy all (supposedly) modified files to the `www'

Index: ChangeLog
===================================================================
RCS file: /sources/trans-coord/trans-coord/gnun/server/gnun/ChangeLog,v
retrieving revision 1.303
retrieving revision 1.304
diff -u -b -r1.303 -r1.304
--- ChangeLog   19 Nov 2012 15:14:25 -0000      1.303
+++ ChangeLog   22 Nov 2012 16:05:36 -0000      1.304
@@ -1,3 +1,12 @@
+2012-11-22  Pavel Kharitonov  <address@hidden>
+
+       * GNUmakefile.team (ECHO): Remove the variable.
+       (MSGMERGEFLAGS): New variable.
+       (sync): Cleanup.  Improve output.  Ignore empty lines
+       and comments when comparing PO files.
+       (format): Rewrap all files unconditionally.
+       (report-pos): Output statistics for files that need updating.
+
 2012-11-19  Pavel Kharitonov  <address@hidden>
 
        Add `gnun-diff-po'.  Minor gettext-related cleanup



reply via email to

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