2012-08-26 18:04:35 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2012-08-26 18:13:29 +02:00
|
|
|
# USAGE: dev/dist.sh ttyponies
|
|
|
|
# or dev/dist.sh pdfmanual
|
|
|
|
# or dev/dist.sh tag VERSION [OTHER OPTIONS FOR `git tag`]
|
2012-10-23 18:59:30 +02:00
|
|
|
# or dev/dist.sh beigepdf
|
2012-08-26 18:13:29 +02:00
|
|
|
|
2012-08-26 18:04:35 +02:00
|
|
|
|
|
|
|
ttyponies()
|
|
|
|
{
|
2013-04-01 16:13:46 +02:00
|
|
|
defaultoutparams=--colourful y --left - --right - --top - --bottom - --balloon n --fullcolour y
|
2012-08-26 18:04:35 +02:00
|
|
|
mkdir -p "ttyponies"
|
|
|
|
for pony in $(ls --color=no "ponies/"); do
|
|
|
|
if [ ! "$pony" = '.info' ]; then
|
|
|
|
echo "building ttypony: $pony"
|
|
|
|
if [ "`readlink "ponies/$pony"`" = '' ]; then
|
2013-04-01 16:13:46 +02:00
|
|
|
ponytool --import ponysay --file "ponies/$pony" --export ponysay --platform linux --file "ttyponies/$pony" $defaultoutparams
|
|
|
|
git add "ttyponies/$pony"
|
2012-08-26 18:04:35 +02:00
|
|
|
else
|
|
|
|
ln -sf `readlink "ponies/$pony"` "ttyponies/$pony"
|
|
|
|
git add "ttyponies/$pony"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
mkdir -p "extrattyponies"
|
|
|
|
for pony in $(ls --color=no "extraponies/"); do
|
|
|
|
if [ ! "$pony" = '.info' ]; then
|
|
|
|
echo "building extrattypony: $pony"
|
|
|
|
if [ "`readlink "extraponies/$pony"`" = '' ]; then
|
2013-04-01 16:13:46 +02:00
|
|
|
ponytool --import ponysay --file "extraponies/$pony" --export ponysay --platform linux --file "extrattyponies/$pony" $defaultoutparams
|
2012-08-26 18:04:35 +02:00
|
|
|
git add "extrattyponies/$pony"
|
|
|
|
else
|
|
|
|
ln -sf `readlink "extraponies/$pony"` "extrattyponies/$pony"
|
|
|
|
git add "extrattyponies/$pony"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pdfmanual()
|
|
|
|
{
|
2012-08-26 18:13:29 +02:00
|
|
|
texi2pdf "manuals/ponysay.texinfo"
|
2012-09-24 01:37:08 +02:00
|
|
|
for ext in `echo aux cp cps fn ky log pg toc tp vr op ops pgs vrs bak`; do
|
2012-08-26 19:23:04 +02:00
|
|
|
if [ -f "ponysay.$ext" ]; then
|
2012-08-26 18:13:29 +02:00
|
|
|
unlink "ponysay.$ext"
|
2012-08-26 18:04:35 +02:00
|
|
|
fi
|
2012-08-26 18:13:29 +02:00
|
|
|
done
|
|
|
|
if [ -d "ponysay.t2d" ]; then
|
|
|
|
rm -r "ponysay.t2d";
|
|
|
|
fi
|
2012-10-23 18:59:30 +02:00
|
|
|
git add "manuals/ponysay.texinfo" "ponysay.pdf"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
beigepdf()
|
|
|
|
{
|
|
|
|
pdfjam --pagecolor 249,246,240 -o "ponysay+beige.pdf" "ponysay.pdf"
|
2012-08-26 18:13:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-08-26 19:23:04 +02:00
|
|
|
pdf()
|
|
|
|
{
|
|
|
|
pdfmanual "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-08-26 18:13:29 +02:00
|
|
|
tag()
|
|
|
|
{
|
|
|
|
version=`./setup.py version`
|
2012-08-27 01:00:03 +02:00
|
|
|
if [ "$version" = 'Ponysay '"$1"' installer' ]; then
|
2012-08-26 18:13:29 +02:00
|
|
|
git tag -a "$@" && git checkout "$1" && git push -u origin "$1"
|
|
|
|
else
|
|
|
|
echo 'Setup script reports. '"$version"
|
|
|
|
echo 'This is not consistent with desired tag version: '"$1"
|
|
|
|
echo 'Make sure the version is correct in setup.py and that all change logs are up to date'
|
|
|
|
fi
|
2012-08-26 18:04:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[ "$1" = './dist.sh' ] && cd ..
|
|
|
|
"$@"
|
2013-04-01 16:13:46 +02:00
|
|
|
|