8 echo "Usage: `basename $0` <draft file> <release directory>"
10 echo " -c : Copy mode. By default, sed is used to remove JM comments."
11 echo " -f : Force Override the existing page"
12 echo " -v : Verbose mode"
21 while getopts "cfgqv" OPT
32 shift `expr $OPTIND - 1`
35 # if [ "$1" = "-f" ]; then
40 if [ -z "$1" -a -z "$2" ]; then
47 MANPAGE=`basename $DRAFT`
48 SECTION_NAME=$(basename $(dirname $DRAFT))
49 RELSECDIR=$RELDIR/$SECTION_NAME
50 RELEASE=$RELSECDIR/$MANPAGE
52 if [ ! -f $DRAFT ]; then
53 echo "draft file $DRAFT does not exist!"
57 if [ ! -d $RELDIR ]; then
58 echo "release directory $RELDIR does not exist!"
62 if [ ! -d $RELSECDIR ]; then
64 echo "Created $RELSECDIR."
67 if test -f $RELEASE && cmp $DRAFT $RELEASE > /dev/null; then
68 if [ $VERBOSE -eq 1 ]; then
69 echo "Skipped $(basename $DRAFT): draft and release pages are same."
74 if [ -f $RELEASE -a $FORCE -ne 1 ]; then
75 echo -n "Overwrite $RELEASE (y/N) "
77 if [ "$ret" = "y" -o "$ret" = "Y" ]; then
78 echo "Remove $RELEASE"
81 echo "Can't overwrite $RELEASE. Aborted"
86 if [ $COPY -eq 1 ]; then
87 if [ $QUIET -eq 0 ]; then
90 cp -fp $OPT_V $DRAFT $RELEASE
92 $SED -e '/^\.\\\"O /d' $DRAFT > $RELEASE
93 if [ $QUIET -eq 0 ]; then
94 echo "$DRAFT -> $RELEASE"