aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
blob: d8b74937bbe54e2e206bdeb39ef4d8144f3272c8 (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
#! /bin/sh
# This file is part of Mailfromd.
# Copyright (C) 2005-2018 Sergey Poznyakoff
#
# 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 3, 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, see <http://www.gnu.org/licenses/>.

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

git submodule init || exit $?
git submodule update || exit $?

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
}

# #################################

get_po

cat > ChangeLog <<EOT
This file is a placeholder. It will be replaced with the actual ChangeLog
by make dist.  Run make ChangeLog if you wish to create it earlier.
EOT
test -d m4 || mkdir m4
autoreconf -f -i -s

Return to:

Send suggestions and report system problems to the System administrator.