[cmucl-cvs] CMUCL commit: src (lisp/GNUmakefile tools/make-extra-dist.sh)

Raymond Toy rtoy at common-lisp.net
Thu Sep 16 02:29:38 UTC 2010

    Date: Wednesday, September 15, 2010 @ 22:29:38
  Author: rtoy
    Path: /project/cmucl/cvsroot/src

Modified: lisp/GNUmakefile tools/make-extra-dist.sh

o Don't overwrite the CVS po file with the merged version; the merged
  version is written to the build directory.  
o The mo file is created from the merged version in the build
o Compare the newly merged version with the original CVS version and
  print a message if they are different.  (Sort the files first to
  remove any issues with order of the various fields.  It is known
  that the versions of msgmerge on FreeBSD and Mac OS X will put the
  Language line in different places.

o Be sure to install the po file from the build directory and not the
  source directory.  (But do we really need to distribute the po

 lisp/GNUmakefile         |   23 +++++++++++++++++++----
 tools/make-extra-dist.sh |    6 +++---
 2 files changed, 22 insertions(+), 7 deletions(-)

Index: src/lisp/GNUmakefile
diff -u src/lisp/GNUmakefile:1.37 src/lisp/GNUmakefile:1.38
--- src/lisp/GNUmakefile:1.37	Thu Jul 29 00:28:49 2010
+++ src/lisp/GNUmakefile	Wed Sep 15 22:29:37 2010
@@ -1,4 +1,4 @@
-# $Header: /project/cmucl/cvsroot/src/lisp/GNUmakefile,v 1.37 2010-07-29 04:28:49 rtoy Exp $
+# $Header: /project/cmucl/cvsroot/src/lisp/GNUmakefile,v 1.38 2010-09-16 02:29:37 rtoy Exp $
 all: lisp.nm
@@ -74,16 +74,31 @@
 # Convert locale names to the appropriate path where we want the mo files to go.
 LOCALE_DIRS = $(patsubst %, i18n/locale/%/LC_MESSAGES, $(LOCALES))
+# When processing the translations, we merge the po file from the src
+# directory with the appropriate pot file.  The result is placed in
+# the build directory.  Then we compare the original po file with the
+# newly generated one (but sorting both before comparing).  If they
+# are different we print out a note so that we know to look into it
+# and decide if the po file in the src directory needs to be updated.
+# The sorting is done so that differences in order of the lines is not
+# important.  In particular, msgmerge on OSX wants to put the
+# Language: line after the Content-Transfer-Encoding line.  But on
+# FreeBSD, it moves the line to after the Language-Team line.  This
+# makes things messy.  Hence, sort and diff.
 	for pot in ../../src/i18n/locale/*.pot; do \
 	  for po in $(LOCALE_DIRS); do \
             d=`dirname $$pot`; \
 	    f=`basename $$pot .pot`; \
-	    touch ../../src/$$po/$$f.po; \
 	    echo ; \
 	    echo '***' Processing $$f.pot:  $$po; \
-	    msgmerge -v ../../src/$$po/$$f.po $$pot -o ../../src/$$po/$$f.po; \
-	    msgfmt -v  ../../src/$$po/$$f.po -o ../$$po/$$f.mo; \
+	    msgmerge -v ../../src/$$po/$$f.po $$pot -o ../$$po/$$f.po; \
+	    msgfmt -v  ../$$po/$$f.po -o ../$$po/$$f.mo; \
+	    sort < ../$$po/$$f.po > /tmp/$$$$-updated-$$f.po; \
+	    sort < ../../src/$$po/$$f.po > /tmp/$$$$-orig-$$f.po; \
+	    diff -uwB /tmp/$$$$-orig-$$f.po /tmp/$$$$-updated-$$f.po || echo "Warning:  $$po/$$f.po changed"; \
+	    rm -f /tmp/$$$$-updated-$$f.po /tmp/$$$$-orig-$$f.po; \
 	  done; done
 .PHONY : translations
Index: src/tools/make-extra-dist.sh
diff -u src/tools/make-extra-dist.sh:1.12 src/tools/make-extra-dist.sh:1.13
--- src/tools/make-extra-dist.sh:1.12	Mon Jul  5 16:32:33 2010
+++ src/tools/make-extra-dist.sh	Wed Sep 15 22:29:37 2010
@@ -121,12 +121,12 @@
     install ${GROUP} ${OWNER} -m 0644 $TARGET/i18n/$f $DESTDIR/lib/cmucl/lib/$DIR
-# Install po files
-for f in `(cd src/i18n; find locale -type f -print | egrep -v 'CVS|~.*~|.*~')`
+# Install po files.  (Do we really need to distribute the po files?)
+for f in `(cd $TARGET/i18n; find locale -type f -print | egrep -v 'CVS|~.*~|.*~')`
     FILE=`basename $f`
     DIR=`dirname $f`
-    install ${GROUP} ${OWNER} -m 0644 src/i18n/$f $DESTDIR/lib/cmucl/lib/$DIR
+    install ${GROUP} ${OWNER} -m 0644 $TARGET/i18n/$f $DESTDIR/lib/cmucl/lib/$DIR
 if [ -z "$INSTALL_DIR" ]; then

More information about the cmucl-cvs mailing list