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

Nick Schermer noreply at xfce.org
Tue May 18 21:34:03 CEST 2010


Updating branch refs/heads/xfce-4.6
         to f96f72255ad9646339db81ed651985cff0b14672 (commit)
       from 09286203180e54bf8ccc7fc0dddc60162c244f85 (commit)

commit f96f72255ad9646339db81ed651985cff0b14672
Author: Nick Schermer <nick at xfce.org>
Date:   Tue May 18 21:32:41 2010 +0200

    Automate the LINGUAS parsing.

 autogen.sh |   73 +++++++++++++++++++++++++++++++++++++++++++++--------------
 po/LINGUAS |    2 -
 2 files changed, 55 insertions(+), 20 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index 295c4e9..ba1a279 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,23 +1,7 @@
 #!/bin/sh
 #
-# vi:set et ai sw=2 sts=2 ts=2: */
-#-
-# Copyright (c) 2009 Jannis Pohlmann <jannis at xfce.org>
+# Copyright (c) 2002-2010 Xfce Development Team
 #
-# This program is free software; you can redistribute it and/or 
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of 
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public 
-# License along with this program; if not, write to the Free 
-# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-# Boston, MA 02110-1301, USA.
 
 (type xdt-autogen) >/dev/null 2>&1 || {
   cat >&2 <<EOF
@@ -29,5 +13,58 @@ EOF
   exit 1
 }
 
-XDT_AUTOGEN_REQUIRED_VERSION="4.7.0" exec xdt-autogen $@
+# 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
+if test -d .git/svn; then
+    revision=`git svn find-rev trunk 2>/dev/null ||
+              git svn find-rev origin/trunk 2>/dev/null ||
+              git svn find-rev HEAD 2>/dev/null ||
+              git svn find-rev master 2>/dev/null`
+elif test -d .git; then
+    revision=`git rev-parse --short HEAD`
+elif test -d .svn; then
+    revision=`LC_ALL=C svn info $0 | $AWK '/^Revision: / {printf "%05d\n", $2}'`
+fi
+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 e08138a..0000000
--- a/po/LINGUAS
+++ /dev/null
@@ -1,2 +0,0 @@
-# set of available languages (in alphabetic order)
-am ar ast az be bg bn_IN ca cs da de dz el en_GB eo es es_MX et eu fa fi fr gl gu he hi hu id it ja ka ko lt lv mk mr ms nb nl pa pl pt_BR pt ro ru sk sq sv ta tr uk ur ur_PK vi zh_CN zh_TW



More information about the Xfce4-commits mailing list