8 echo "Usage: `basename $0` <draft file> <release directory>"
10 echo " -f : Force Override the existing page"
11 echo " -g : Guess the release directory from the draft location"
26 shift `expr $OPTIND - 1`
29 # if [ "$1" = "-f" ]; then
34 if [ -z "$1" -a -z "$2" ]; then
41 MANPAGE=`basename $DRAFT`
42 if [ $GUESS -eq 1 ]; then
43 RELEASE=`echo $RELDIR/$(dirname $DRAFT | sed -e 's/^.*\///')/$MANPAGE`
45 RELEASE=`echo $RELDIR/$MANPAGE`
48 if [ ! -f $DRAFT ]; then
49 echo "draft file $DRAFT does not exist!"
53 if [ ! -d $RELDIR ]; then
54 echo "release directory $RELDIR does not exist!"
58 if [ -f $RELEASE -a $FORCE -ne 1 ]; then
59 echo -n "Overwrite $RELEASE (y/N) "
61 if [ "$ret" = "y" -o "$ret" = "Y" ]; then
62 echo "Remove $RELEASE"
65 echo "Can't overwrite $RELEASE. Aborted"
70 $SED -e '/^\.\\\"O/d' $DRAFT > $RELEASE
71 echo "$DRAFT -> $RELEASE"