-
Notifications
You must be signed in to change notification settings - Fork 1
/
release-merged.sh
executable file
·133 lines (126 loc) · 4.41 KB
/
release-merged.sh
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/bash
# release-merged.sh
# copied from jfontmaps project and adapted
PROJECT="japanese-otf"
DIR=`pwd`/..
VER=${VER:-`date +%Y%m%d.0`}
DATE=`date +%Y/%m/%d`
TEMP=/tmp
echo "Making Release $VER. Ctrl-C to cancel."
read REPLY
if test -d "$TEMP/$PROJECT-$VER"; then
echo "Warning: the directory '$TEMP/$PROJECT-$VER' is found:"
echo
ls $TEMP/$PROJECT-$VER
echo $TEMP
echo
echo -n "I'm going to remove this directory. Continue? yes/No"
echo
read REPLY <&2
case $REPLY in
y*|Y*) rm -rf $TEMP/$PROJECT-$VER;;
*) echo "Aborted."; exit 1;;
esac
fi
echo
#git commit -m "Release $VER" --allow-empty
git archive --format=tar --prefix=$PROJECT-$VER/ HEAD | (cd $TEMP && tar xf -)
#git --no-pager log --date=short --format='%ad %aN <%ae>%n%n%x09* %s%d [%h]%n' > $TEMP/$PROJECT-$VER/ChangeLog
cd $TEMP
rm -rf $PROJECT-$VER-orig
rm -rf $PROJECT-nonfree-$VER
mkdir $PROJECT-nonfree-$VER
rm -rf $PROJECT-uptex-$VER
mkdir $PROJECT-uptex-$VER
for i in $PROJECT-$VER/* ; do
bn=`basename $i`
# japanese-otf(-uptex) contains Hiragino-specific TFM/VF,
# mark them as nonfree
# remove the non-free part in the main project
if test $bn = "japanese-otf"; then
mkdir -p $PROJECT-nonfree-$VER/ofm
for j in $PROJECT-$VER/$bn/ofm/*hira{min,kaku,maru}*.ofm ; do
mv $j $PROJECT-nonfree-$VER/ofm/
done
# We do not use japanese-otf/ofm/otf-cj*-{h,v}.ofm anymore.
rm -rf $PROJECT-$VER/$bn/ofm
fi
if test $bn = "japanese-otf" -o $bn = "japanese-otf-uptex"; then
mkdir -p $PROJECT-nonfree-$VER/tfm
for j in $PROJECT-$VER/$bn/tfm/*hira{min,kaku,maru}*.tfm ; do
mv $j $PROJECT-nonfree-$VER/tfm/
done
mkdir -p $PROJECT-nonfree-$VER/vf
for j in $PROJECT-$VER/$bn/vf/*hira{min,kaku,maru}*.vf ; do
mv $j $PROJECT-nonfree-$VER/vf/
done
rm $PROJECT-$VER/$bn/README
rm $PROJECT-$VER/$bn/README.nonfree
# we don't include fontmap/* for CTAN,
# as it contains files with parenthesis
# (ctan2tds also excludes them from installation)
rm -rf $PROJECT-$VER/$bn/fontmap
for dir in tfm vf sty ; do
mkdir -p $PROJECT-$VER/$dir
mv $PROJECT-$VER/$bn/$dir/* $PROJECT-$VER/$dir
rmdir $PROJECT-$VER/$bn/$dir
done
for dir in basepl script ; do
mkdir -p $PROJECT-$VER/src/$dir
mv $PROJECT-$VER/$bn/$dir/* $PROJECT-$VER/src/$dir
rmdir $PROJECT-$VER/$bn/$dir
done
mv $PROJECT-$VER/$bn/*makeotf* $PROJECT-$VER/src
mv $PROJECT-$VER/$bn/*mkjvf $PROJECT-$VER/src
for dir in test ; do
mkdir -p $PROJECT-$VER/doc/$dir
mv $PROJECT-$VER/$bn/$dir/* $PROJECT-$VER/doc/$dir
rmdir $PROJECT-$VER/$bn/$dir
done
mv $PROJECT-$VER/$bn/*{txt,maps,diff}* $PROJECT-$VER/doc
rm $PROJECT-$VER/$bn/COPYRIGHT
elif test $bn = "README.merged"; then
mv $PROJECT-$VER/$bn $PROJECT-$VER/README
elif test $bn = "README.merged.nonfree"; then
mv $PROJECT-$VER/$bn $PROJECT-nonfree-$VER/README
elif test $bn = "README.merged.uptex"; then
mv $PROJECT-$VER/$bn $PROJECT-uptex-$VER/README
elif test $bn = "COPYRIGHT.merged"; then
cp -p $PROJECT-$VER/$bn $PROJECT-nonfree-$VER/COPYRIGHT
mv $PROJECT-$VER/$bn $PROJECT-$VER/COPYRIGHT
elif test $bn = "ChangeLog.md"; then
echo
# mv $PROJECT-$VER/$bn $PROJECT-$VER/$bn
else
echo remove $bn
rm -rf $PROJECT-$VER/$bn
fi
done
rm -f $PROJECT-$VER/.gitignore
rmdir $PROJECT-$VER/japanese-otf
rmdir $PROJECT-$VER/japanese-otf-uptex
# sty
perl -pi.bak -e "s{20\d\d/\d\d/\d\d }{$DATE TeX JP org, }g" $PROJECT-$VER/sty/otf.sty
rm -f $PROJECT-$VER/sty/otf.sty.bak
# release date
perl -pi.bak -e "s/\\\$RELEASEDATE/$VER/g" $PROJECT-$VER/README
rm -f $PROJECT-$VER/README.bak
perl -pi.bak -e "s/\\\$RELEASEDATE/$VER/g" $PROJECT-nonfree-$VER/README
rm -f $PROJECT-nonfree-$VER/README.bak
# do not make japanese-otf-uptex-*.tar.gz anymore
rm -rf $PROJECT-uptex-$VER
# make archives
tar zcf $DIR/$PROJECT-$VER.tar.gz $PROJECT-$VER
tar zcf $DIR/$PROJECT-nonfree-$VER.tar.gz $PROJECT-nonfree-$VER
# tar zcf $DIR/$PROJECT-uptex-$VER.tar.gz $PROJECT-uptex-$VER
echo
echo You should execute
echo
echo " git push && git tag $VER && git push origin $VER"
echo
echo Informations for submitting CTAN:
echo " CONTRIBUTION: $PROJECT"
echo " SUMMARY: Advanced font selection for pLaTeX and its friends"
echo " DIRECTORY: language/japanese/$PROJECT"
echo " LICENSE: free/other-free"
echo " FILE: $DIR/$PROJECT-$VER.tar.gz"