aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
blob: 0be9aaaa24dd9a71e07619d6040ccb2e2e1a5576 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#! /bin/sh
# Copyright (C) 2011-2023 Free Software Foundation, Inc.
#
# GDBM 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.
#
# GDBM 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 GDBM. If not, see <http://www.gnu.org/licenses/>. */

force=
get_po_only=
no_po=

refdir=po/.reference

usage() {
    cat <<EOF
Usage: $0 [--force] [--no-po]
   or: $0 --get-po
Bootstraps the GNU dbm project from git repository and/or updates translation
files.

Options are:

  --force     force bootstrapping overriding the safety checks
  --no-po     don't download translation files
  --get-po    only update translation files, don't bootstrap

See README-hacking for details.
EOF
}

get_po() {
  test -d $refdir || mkdir $refdir
  # Get PO files.
  rsync --delete -Lrtvz translationproject.org::tp/latest/gdbm/ $refdir
  langs=`cd $refdir && ls *.po | sed 's/\.po$//' | sort`
  if test "$langs" != '*'; then
    for lang in $langs
    do
      if test -f po/$lang.po && cmp po/$lang.po $refdir/$lang.po >/dev/null
      then
        :
      else
        cp $refdir/$lang.po po
      fi
    done
  fi
  # Create LINGUAS
  (echo "# This file is generated automatically; don't edit"
   ls po/*.po 2>/dev/null | sed 's^.*/^^;s/\.po$//' | sort) > po/LINGUAS
}  

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

while [ $# -gt 0 ]
do
    case $1 in
	--force)
	    force=1
	    ;;

	--get-po)
	    get_po_only=1
	    ;;

	--no-po)
	    no_po=1
	    ;;
	
	--help|-h)
	    usage
	    exit 0
	    ;;

	*) echo >&2 "$0: unrecognized argument"
	   usage >&2
	   exit 1
    esac
    shift
done

if [ -n "$get_po_only" ]; then
    if [ -n "$force$no_po" ]; then
	echo >&2 "$0: conflicting arguments"
	usage >&2
	exit 1
    fi
    get_po
else
    if ! test -f README-hacking && test -z "$force"; then
	echo >&2 "$0: bootstrapping from a non-checked-out distribution is risky"
	echo >&2 "$0: use --force if you really want it"
	exit 1
    fi

    if [ -z "$no_po" ]; then
	get_po
    fi
    
    test -d m4 || mkdir m4
    if [ -f ChangeLog ]; then
	cat > ChangeLog <<EOF
# This file is a placeholder.  Run make to generate actual ChangeLog.
EOF
    fi

    autoreconf -f -i -s
fi

Return to:

Send suggestions and report system problems to the System administrator.