aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
blob: 84869d26f3b3b6b63ba6d31ec14eb5c3ca547706 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#! /bin/sh
# This file is part of GNU direvent -*- autoconf -*-
# Copyright (C) 2012-2022 Sergey Poznyakoff
#
# GNU direvent 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 3, or (at your option)
# any later version.
#
# GNU direvent 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 GNU direvent.  If not, see <http://www.gnu.org/licenses/>.

if ! test -r configure.ac; then
    echo >&2 "$0: configure.ac not found"
    exit 1
fi

extract_package_name='divert(-1)[]changequote([,])[]define([AC_INIT],[divert(0)[]patsubst([$1],[GNU ],[])[]divert(-1)])'
package=`echo $extract_package_name | m4 - configure.ac | tr A-Z a-z`

if test -z "$package"; then
    echo >&2 "$0: can't deduce package name"
    exit 1
fi

get_po() {
    podir=po
    dndir=po/.download
    test -d $dndir || mkdir $dndir
    rsync -Lrtvz translationproject.org::tp/latest/$package/ $dndir || exit 1
    ls $dndir/*.po | sed 's|.*/||;s|\.po$||' > $podir/LINGUAS
    for lang in `cat $podir/LINGUAS`
    do
	if ! test -f $podir/$lang.po ||
	    ! cmp $podir/$lang.po $dndir/$lang.po >/dev/null; then
	    echo "updated $podir/$lang.po"
	    cp $dndir/$lang.po $podir
	fi
    done
}

#########################
unset po_only
while getopts "ph" opt
do
    case $opt in
	p) po_only=1;;
	h) cat - <<EOF
usage: $0 [-hp]

options:

  -h         display this help
  -p         get PO files and exit
EOF
           exit 0
           ;;
	*) exit 1
    esac
done

set -e

get_po
if [ -n "$po_only" ]; then
    exit 0
fi    

test -d am || mkdir am
git submodule update --init --recursive
autoreconf -f -i -s
    

Return to:

Send suggestions and report system problems to the System administrator.