-
Notifications
You must be signed in to change notification settings - Fork 0
/
repo.archives
executable file
·56 lines (49 loc) · 1.47 KB
/
repo.archives
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
#!/usr/bin/env bash
source repo.conf
DESC="italian translation - updates"
HOW="svn"
# -------------------------------------------------------
DTM=$(date +"%Y%m%d%H%M")
TAG=$(git tag | sort -V | tail -1 )
NAME="$REL-$LANG-$DTM.tgz"
RPP="./packages"
OUT="./archives"
# if not available, create the output directory
if [ ! -d $OUT ]; then
mkdir $OUT
fi
# R base translations
echo -e "\n$REL:\n * $OUT/$NAME"
if [[ -d $REL ]]; then
# R base archive
tar zcvf $OUT/$NAME $REL/src/library/*/po/*.po 1>/dev/null
# Script: copy new .po files to trunk/R repository
echo "#!/usr/bin/env bash" > $OUT/trunk.sh
echo -e "\nRPATH=\"$REL/src/library\"" >> $OUT/trunk.sh
echo -e "OPATH=\"trunk/R/src/library\"" >> $OUT/trunk.sh
cd ./$REL/src/library/
for i in `ls -d *`; do
echo -e "\n# $i" >> ../../../$OUT/trunk.sh
for j in `ls $i/po/*.po`; do
echo "cp \$RPATH/$j \$OPATH/$j" >> ../../../$OUT/trunk.sh
done
done
# Script: svn/git add-commits
echo "#!/usr/bin/env bash" > ../../../$OUT/$HOW.sh
echo -e "\nOPATH=\"trunk/R/src/library\"" >> ../../../$OUT/$HOW.sh
for i in `ls -d *`; do
echo -e "\n# $i" >> ../../../$OUT/$HOW.sh
for j in `ls $i/po/*.po`; do
echo "$HOW add \$OPATH/$j" >> ../../../$OUT/$HOW.sh
done
echo "$HOW commit -m \"$i: $DESC\"" >> ../../../$OUT/$HOW.sh
done
fi
# External packages
echo -e "\nPackages:"
cd ../../../$RPP
for i in `ls -d *`; do
echo -e " * $OUT/$i-$LANG.tgz"
tar zcvf ../$OUT/$i-$LANG.tgz $i/po/*.po 1>/dev/null
done
echo -e "\nDone.\n"