]> Sergey Matveev's repositories - paster.git/blob - contrib/paster
Use Texinfo 7.0 features
[paster.git] / contrib / paster
1 #!/bin/sh -e
2 DST=${DST:-nc paster.example.com 2020}
3 if [ -s "$1" ]; then
4     src="$1"
5     bn="${1##*/}"
6     _ext="${bn##*.}"
7     [ "$bn" = "$_ext" ] || ext="1:e${#_ext}:$_ext"
8 else
9     src=`mktemp`
10     trap "rm -f $src" HUP PIPE INT QUIT TERM EXIT
11     cat > $src
12     [ $# -eq 0 ] || ext="1:e${#1}:$1"
13 fi
14 size=`perl -e 'print -s $ARGV[0]' $src`
15 ( echo -n "d${ext}1:v${size}:" ; cat $src ; echo -n e ) | $DST