2012-08-26 16:04:35 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2012-08-26 16:13:29 +00: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 16:59:30 +00:00
|
|
|
# or dev/dist.sh beigepdf
|
2013-04-01 19:43:49 +00:00
|
|
|
# or dev/dist.sh remaster
|
2012-08-26 16:13:29 +00:00
|
|
|
|
2012-08-26 16:04:35 +00:00
|
|
|
|
|
|
|
ttyponies()
|
|
|
|
{
|
2013-04-05 08:47:56 +00:00
|
|
|
defaultinparams="--left - --right - --top - --bottom -"
|
2013-04-01 19:44:47 +00:00
|
|
|
defaultoutparams="--colourful y --left - --right - --top - --bottom - --balloon n --fullcolour y"
|
2013-04-01 19:43:49 +00:00
|
|
|
for x in '' 'extra'; do
|
|
|
|
mkdir -p "${x}ttyponies"
|
|
|
|
for pony in $(find "${x}ponies/" | grep -v '/\.' | grep '\.pony$' | sed -e "s_^${x}ponies/__"); do
|
|
|
|
echo "building ${x}ttypony: $pony"
|
|
|
|
if [ ! -L "${x}ponies/$pony" ]; then
|
2013-04-05 08:47:56 +00:00
|
|
|
ponytool --import ponysay --file "${x}ponies/$pony" $defaultinparams \
|
2013-04-01 19:43:49 +00:00
|
|
|
--export ponysay --platform linux --file "${x}ttyponies/$pony" $defaultoutparams
|
|
|
|
git add "${x}ttyponies/$pony"
|
2012-08-26 16:04:35 +00:00
|
|
|
else
|
2013-04-01 19:43:49 +00:00
|
|
|
ln -sf "$(readlink "${x}ponies/$pony")" "${x}ttyponies/$pony"
|
|
|
|
git add "${x}ttyponies/$pony"
|
2012-08-26 16:04:35 +00:00
|
|
|
fi
|
2013-04-01 19:43:49 +00:00
|
|
|
done
|
2012-08-26 16:04:35 +00:00
|
|
|
done
|
2013-04-01 19:43:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
remaster()
|
|
|
|
{
|
2013-04-05 08:47:56 +00:00
|
|
|
inparams="--left - --right - --top - --bottom -"
|
2013-04-01 19:52:28 +00:00
|
|
|
xtermoutparams="--left - --right - --top - --bottom - --balloon n"
|
|
|
|
linuxoutparams="--colourful y --left - --right - --top - --bottom - --balloon n --fullcolour y"
|
2013-04-01 19:43:49 +00:00
|
|
|
for x in '' 'extra'; do
|
|
|
|
mkdir -p "${x}ttyponies"
|
|
|
|
for pony in $(find "${x}ponies/" | grep -v '/\.' | grep '\.pony$' | sed -e "s_^${x}ponies/__"); do
|
|
|
|
echo "remastering ${x}pony: $pony"
|
|
|
|
if [ ! -L "${x}ponies/$pony" ]; then
|
2013-04-05 08:47:56 +00:00
|
|
|
ponytool --import ponysay --file "${x}ponies/$pony" $inparams \
|
2013-04-01 19:52:28 +00:00
|
|
|
--export ponysay --file "${x}ponies/$pony" $xtermoutparams \
|
|
|
|
--export ponysay --platform linux --file "${x}ttyponies/$pony" $linuxoutparams
|
2013-04-01 19:43:49 +00:00
|
|
|
git add "${x}ponies/$pony" "${x}ttyponies/$pony"
|
2012-08-26 16:04:35 +00:00
|
|
|
else
|
2013-04-01 19:43:49 +00:00
|
|
|
ln -sf "$(readlink "${x}ponies/$pony")" "${x}ttyponies/$pony"
|
|
|
|
git add "${x}ttyponies/$pony"
|
2012-08-26 16:04:35 +00:00
|
|
|
fi
|
2013-04-01 19:43:49 +00:00
|
|
|
done
|
2012-08-26 16:04:35 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pdfmanual()
|
|
|
|
{
|
2012-08-26 16:13:29 +00:00
|
|
|
texi2pdf "manuals/ponysay.texinfo"
|
2012-09-23 23:37:08 +00:00
|
|
|
for ext in `echo aux cp cps fn ky log pg toc tp vr op ops pgs vrs bak`; do
|
2012-08-26 17:23:04 +00:00
|
|
|
if [ -f "ponysay.$ext" ]; then
|
2012-08-26 16:13:29 +00:00
|
|
|
unlink "ponysay.$ext"
|
2012-08-26 16:04:35 +00:00
|
|
|
fi
|
2012-08-26 16:13:29 +00:00
|
|
|
done
|
|
|
|
if [ -d "ponysay.t2d" ]; then
|
|
|
|
rm -r "ponysay.t2d";
|
|
|
|
fi
|
2012-10-23 16:59:30 +00:00
|
|
|
git add "manuals/ponysay.texinfo" "ponysay.pdf"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
beigepdf()
|
|
|
|
{
|
|
|
|
pdfjam --pagecolor 249,246,240 -o "ponysay+beige.pdf" "ponysay.pdf"
|
2012-08-26 16:13:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-08-26 17:23:04 +00:00
|
|
|
pdf()
|
|
|
|
{
|
|
|
|
pdfmanual "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-08-26 16:13:29 +00:00
|
|
|
tag()
|
|
|
|
{
|
2013-04-05 10:42:39 +00:00
|
|
|
echo 'Testing executability'
|
|
|
|
./src/__main__.py -l >/dev/null || exit 1
|
|
|
|
./src/__main__.py -L >/dev/null || exit 1
|
|
|
|
./src/__main__.py +l >/dev/null || exit 1
|
|
|
|
./src/__main__.py +L >/dev/null || exit 1
|
|
|
|
./src/__main__.py -A >/dev/null || exit 1
|
|
|
|
./src/__main__.py +A >/dev/null || exit 1
|
|
|
|
./src/__main__.py -B >/dev/null || exit 1
|
|
|
|
./src/__main__.py -of pinkie >/dev/null || exit 1
|
|
|
|
./src/__main__.py -o +f faust >/dev/null || exit 1
|
|
|
|
./src/__main__.py -o -F faust >/dev/null || exit 1
|
|
|
|
echo test | ./src/__main__.py -f pinkie >/dev/null || exit 1
|
|
|
|
echo 'No error was thrown'
|
|
|
|
|
2012-08-26 16:13:29 +00:00
|
|
|
version=`./setup.py version`
|
2012-08-26 23:00:03 +00:00
|
|
|
if [ "$version" = 'Ponysay '"$1"' installer' ]; then
|
2012-08-26 16:13:29 +00: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 16:04:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-05 10:42:39 +00:00
|
|
|
[ "$0" = './dist.sh' ] && cd ..
|
2012-08-26 16:04:35 +00:00
|
|
|
"$@"
|
2013-04-01 14:13:46 +00:00
|
|
|
|