-
Notifications
You must be signed in to change notification settings - Fork 0
/
repo.roaster
executable file
·70 lines (58 loc) · 2.11 KB
/
repo.roaster
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
#!/usr/bin/env bash
source repo.conf
##################################################################
#
# Roaster: for the latest two svn branches run:
# ./roaster --svn-repo-fetch-all
#
############# don't change anything below this line ##############
RWD=$(pwd)
RSR="$RRR/src/library"
RTR="$RRR/library/translations/it/LC_MESSAGES/"
RPP="./packages"
if [[ -d $RRR ]]; then
echo -e "\n\e[32m--- R base packages ---\e[0m"
for i in 'base' 'compiler' 'graphics' 'grDevices' 'grid' \
'methods' 'parallel' 'splines' 'stats' 'stats4' 'tcltk' \
'tools' 'utils'; do
echo -e "\n$i:"
# Copy .po files from local dir to roaster dir
cp $REL/src/library/$i/po/*.po $RSR/$i/po/
# Copy .pot files from roaster dir to local dir
cp $RSR/$i/po/*.pot $REL/src/library/$i/po/
# msgmerge $LANG.po R.pot --update --backup=t
# msgmerge R-$LANG.po R-$LANG.pot --update --backup=t
# msgmerge RGui-$LANG.po RGui-$LANG.pot --update --backup=t
if [[ ! -d $RSR/$i/inst/po/$LANG ]]; then
mkdir -p $RSR/$i/inst/po/$LANG/LC_MESSAGES
fi
if [[ -f $RSR/$i/po/$LANG.po ]]; then msgfmt -c --statistics \
-o $RSR/$i/inst/po/$LANG/LC_MESSAGES/$i.mo $RSR/$i/po/$LANG.po
fi
if [[ -f $RSR/$i/po/RGui-$LANG.po ]]; then msgfmt -c --statistics \
-o $RSR/$i/inst/po/$LANG/LC_MESSAGES/RGui.mo $RSR/$i/po/RGui-$LANG.po
fi
if [[ -f $RSR/$i/po/R-$LANG.po ]]; then msgfmt -c --statistics \
-o $RSR/$i/inst/po/$LANG/LC_MESSAGES/R-$i.mo $RSR/$i/po/R-$LANG.po
fi
done
# Copy all .mo in the right place
cp $RSR/*/inst/po/$LANG/LC_MESSAGES/*.mo $RSR/translations/inst/$LANG/LC_MESSAGES/
echo -e "\n\e[32m--- External Packages ---\e[0m"
cd $RPP
for i in `ls -d *`; do
echo -e "\n$i"
if [[ -f $i/po/$LANG.po ]]; then
msgfmt -c --statistics -o $RTR/$i.mo $i/po/$LANG.po
fi
if [[ -f $i/po/R-$LANG.po ]]; then
msgfmt -c --statistics -o $RTR/R-$i.mo $i/po/R-$LANG.po
fi
done
# Last check
echo -e "\n\e[32m--- Updating pkg-po ---\e[0m\n"
cd $RRR/po && make update-pkg-po update-RGui
else
echo -e "This script require an existing ~/.roaster directory."
echo -e "(informations: https://github.com/dmedri/roaster/)"
fi