Debian Codegraph @

scripts/update-pot.sh

raw symbols SCIP
1 #!/bin/bash
2 #
3 # Authors:
4 # Pavel Březina <[email protected]>
5 #
6 # Copyright (C) 2020 Red Hat
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #
21 #
22 # Update pot files.
23 #
24 # Usage: update-pot.sh
25 #
26
27 if [ ! -f "rpm/authselect.spec.in" ]; then
28 echo "Make sure you are in authselect root directory."
29 exit 1
30 fi
31
32 git diff-index --quiet HEAD -- &> /dev/null
33 if [ $? -ne 0 ]; then
34 echo "Please commit all changes first."
35 exit 1
36 fi
37
38 # Update C pot file
39 make distclean &> /dev/null
40 ./configure
41
42 make -C "po" update-po &> /dev/null
43 if [ $? -ne 0 ]; then
44 echo 'Unable to run: make -C "po" update-po'
45 exit 1
46 fi
47
48 # Update man pages pot files
49 DIR="./src/man"
50 for file in $DIR/*.adoc; do
51 name=`basename $file`
52 po4a-updatepo -f asciidoc -m $file -p "$DIR/po/$name.pot" > /dev/null
53 if [ $? -ne 0 ]; then
54 exit 1
55 fi
56 done
57
58 # Exclude changes in po files
59 git checkout po/*.po
60
61 # Commit changes
62 git commit -a -m "pot: update pot files"
63
64 # Cleanup
65 make distclean &> /dev/null