[Xfce4-commits] <libxfce4util:xfce-4.6> Automate the LINGUAS parsing.

Nick Schermer noreply at xfce.org
Tue May 18 21:26:02 CEST 2010


Updating branch refs/heads/xfce-4.6
         to 10fe8cfb55779c3be55b5a279a314f60f6e6e65c (commit)
       from a4419f9534dafa26cf82d98098978a6f699d48e8 (commit)

commit 10fe8cfb55779c3be55b5a279a314f60f6e6e65c
Author: Nick Schermer <nick at xfce.org>
Date:   Tue May 18 21:25:51 2010 +0200

    Automate the LINGUAS parsing.

 autogen.sh |   48 +++++++++++++++++++++++++++++++++---------------
 po/LINGUAS |    2 --
 2 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index 1e4b69d..ba1a279 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,11 +1,6 @@
 #!/bin/sh
 #
-# $Id$
-#
-# Copyright (c) 2002-2006
-#         The Xfce development team. All rights reserved.
-#
-# Written for Xfce by Benedikt Meurer <benny at xfce.org>.
+# Copyright (c) 2002-2010 Xfce Development Team
 #
 
 (type xdt-autogen) >/dev/null 2>&1 || {
@@ -18,17 +13,27 @@ EOF
   exit 1
 }
 
-# verify that po/LINGUAS is present
-(test -f po/LINGUAS) >/dev/null 2>&1 || {
-  cat >&2 <<EOF
-autogen.sh: The file po/LINGUAS could not be found. Please check your snapshot
-            or try to checkout again.
-EOF
+# portability for awk
+awk_tests="gawk mawk nawk awk"
+if test -z "$AWK"; then
+  for a in $awk_tests; do
+    if type $a >/dev/null 2>&1; then
+      AWK=$a
+      break
+    fi
+  done
+else
+  if ! type $AWK >/dev/null 2>/dev/null; then
+    unset AWK
+  fi
+fi
+if test -z "$AWK"; then
+  echo "autogen.sh: The 'awk' program (one of $awk_tests) is" >&2
+  echo "            required, but cannot be found." >&2
   exit 1
-}
+fi
 
-# substitute revision and linguas
-linguas=`sed -e '/^#/d' po/LINGUAS`
+# substitute revision
 if test -d .git/svn; then
     revision=`git svn find-rev trunk 2>/dev/null ||
               git svn find-rev origin/trunk 2>/dev/null ||
@@ -43,10 +48,23 @@ if test "x$revision" = "x"; then
     revision="UNKNOWN"
 fi
 
+# substitute the linguas
+linguas=`cd "po" 2>/dev/null && ls *.po 2>/dev/null | $AWK 'BEGIN { FS="."; ORS=" " } { print $1 }'`
+if test "x$linguas" = "x"; then
+    echo "autogen.sh: No po files were found, aborting." >&2
+    exit 1
+fi
+
 sed -e "s/@LINGUAS@/${linguas}/g" \
     -e "s/@REVISION@/${revision}/g" \
     < "configure.in.in" > "configure.in"
 
 exec xdt-autogen $@
 
+# xdt-autogen clean does not remove all generated files
+(test x"clean" = x"$1") && {
+  rm -f configure.in
+  rm -f INSTALL
+} || true
+
 # vi:set ts=2 sw=2 et ai:
diff --git a/po/LINGUAS b/po/LINGUAS
deleted file mode 100644
index 7ae2a1b..0000000
--- a/po/LINGUAS
+++ /dev/null
@@ -1,2 +0,0 @@
-# set of available languages (in alphabetic order)
-am ar ast ca cs cy da de dz en_GB es et eu fi fr gl he hu id ja ka kk ko lt lv mk nb nl pl pt_BR pt ro ru si sl sq sv tr ug uk ur_PK ur zh_CN



More information about the Xfce4-commits mailing list