4 echo "Usage: `basename $0` <draft file> <release directory>"
6 echo " -c : Copy mode. By default, sed is used to remove JM comments."
7 echo " -f : Force Override the existing page"
8 echo " -v : Verbose mode"
17 while getopts "cfgqv" OPT
28 shift `expr $OPTIND - 1`
31 # if [ "$1" = "-f" ]; then
36 if [ -z "$1" -a -z "$2" ]; then
43 MANPAGE=`basename $DRAFT`
44 SECTION_NAME=$(basename $(dirname $DRAFT))
45 RELSECDIR=$RELDIR/$SECTION_NAME
46 RELEASE=$RELSECDIR/$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 [ ! -d $RELSECDIR ]; then
60 echo "Created $RELSECDIR."
63 if test -f $RELEASE && cmp $DRAFT $RELEASE > /dev/null; then
64 if [ $VERBOSE -eq 1 ]; then
65 echo "Skipped $(basename $DRAFT): draft and release pages are same."
70 if [ -f $RELEASE -a $FORCE -ne 1 ]; then
71 echo -n "Overwrite $RELEASE (y/N) "
73 if [ "$ret" = "y" -o "$ret" = "Y" ]; then
74 echo "Remove $RELEASE"
77 echo "Can't overwrite $RELEASE. Aborted"
82 if [ $COPY -eq 1 ]; then
83 if [ $QUIET -eq 0 ]; then
86 cp -fp $OPT_V $DRAFT $RELEASE
88 sed -e '/^\.\\\"O /d' $DRAFT > $RELEASE
89 if [ $QUIET -eq 0 ]; then
90 echo "$DRAFT -> $RELEASE"