Debian Codegraph @

po/reautopoint

raw
1 #! /bin/bash
2
3 # script to regenerate the gettext-related files from autopoint
4
5 die() {
6 echo ${@}
7 exit 1
8 }
9
10 [ -f configure.in ] || die "Must be called from the root directory"
11
12 # "sandbox" autopoint, since it assumes a certain directory structure.
13
14 tmpdir="`pwd`/tmp.XXXXXX"
15 tmpdir=$(mktemp -d "$tmpdir")
16 trap "rm -rf \"$tmpdir\"" EXIT INT QUIT
17
18 # get just enough of configure.in in there to run autopoint
19 grep AM_GNU_GETTEXT_VERSION configure.in > "$tmpdir/configure.in" || die "no AM_GNU_GETTEXT_VERSION in configure.in"
20
21 # run autopoint in the sandbox
22 ( cd "$tmpdir" && autopoint) || die "Error running autopoint"
23
24 # copy the files to their real destinations
25
26 # TODO include this file..
27 # cp "$tmpdir/ABOUT-NLS" .
28
29 # blow away the old gettext macros, so 'svn' will flag them with '!'
30 rm -f config/gettext-macros/* || die "Error removing old gettext macros"
31 cp "$tmpdir/m4/"* config/gettext-macros || die "Error copying new gettext macros"
32
33 # there are valuable things in po/, so we can't just blow it away..
34 cp "$tmpdir/po/"* po/ || die "Error copying new files to po/"
35
36 # clean out stuff we don't need
37 rm -f po/Makevars.template po/Makefile.in.in
38
39 # and patch up the rest..
40 patch -p0 -E < po/reautopoint.patch
41
42 svn status