summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Schermer <nick@xfce.org>2010-05-18 21:30:21 +0200
committerNick Schermer <nick@xfce.org>2010-05-18 21:30:21 +0200
commitacd4c4d8a86a68ac90f436e641fc069ea87e3b9f (patch)
tree9eec0f8ae768930c6e13a6b727fd3507675a6509
parent595635d926d8741847885ccdb21ac81336a83c99 (diff)
downloadxfce4-session-acd4c4d8a86a68ac90f436e641fc069ea87e3b9f.tar.gz
Automate the LINGUAS parsing.
-rwxr-xr-xautogen.sh66
-rw-r--r--po/LINGUAS2
2 files changed, 45 insertions, 23 deletions
diff --git a/autogen.sh b/autogen.sh
index 93d022d0..ba1a2792 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,11 +1,6 @@
#!/bin/sh
#
-# $Id$
-#
-# Copyright (c) 2002-2005
-# The Xfce development team. All rights reserved.
-#
-# Written for Xfce by Benedikt Meurer <benny@xfce.org>.
+# Copyright (c) 2002-2010 Xfce Development Team
#
(type xdt-autogen) >/dev/null 2>&1 || {
@@ -18,29 +13,58 @@ 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 ||
- git svn find-rev HEAD 2>/dev/null ||
- git svn find-rev master 2>/dev/null`
-else
- revision=`LC_ALL=C svn info $0 | awk '/^Revision: / {printf "%05d\n", $2}'`
+ 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 8e30ce56..00000000
--- a/po/LINGUAS
+++ /dev/null
@@ -1,2 +0,0 @@
-# set of available languages (in alphabetic order)
-ar am ast az be 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 si sk sq sv ta tr uk ur ur_PK vi zh_CN zh_TW