head	2.1;
access;
symbols
	fourth_edition:2.1;
locks
	grog:2.1; strict;
comment	@# @;


2.1
date	97.12.07.08.34.53;	author grog;	state Exp;
branches;
next	1.6;

1.6
date	96.06.26.11.04.04;	author grog;	state Exp;
branches;
next	1.5;

1.5
date	96.04.08.12.07.27;	author grog;	state Exp;
branches;
next	1.4;

1.4
date	96.02.24.16.31.45;	author grog;	state Exp;
branches;
next	1.3;

1.3
date	96.02.24.15.23.44;	author grog;	state Exp;
branches;
next	1.2;

1.2
date	96.02.24.12.17.12;	author grog;	state Exp;
branches;
next	1.1;

1.1
date	96.02.18.10.39.13;	author grog;	state Exp;
branches;
next	;


desc
@Make a section of the man pages for the installation book
@


2.1
log
@Base second edition
@
text
@# makeshortsect: make a section of the reference manual
#
# Usage: makeshortsect Section.<number>
#
# If the file 'lastpage' exists, it will be read to get the initial page number
#
# This differs from makesection by not making a table of contents, and also
# in where it puts the files.
#
# $Id: makeshortsect,v 1.6 1996/06/26 11:04:04 grog Exp grog $
#
# $Log: makeshortsect,v $
# Revision 1.6  1996/06/26 11:04:04  grog
# Checkpoint 30 June, maybe final version of long book for 2.1.5?
#
# Revision 1.5  1996/04/08  12:07:27  grog
# Minor mods (do we need this any more?)
#
# Revision 1.4  1996/02/24  16:31:45  grog
# More mods
#
# Revision 1.2  1996/02/24  12:17:12  grog
# minor mods
#
# Revision 1.1  1996/02/18  10:39:13  grog
# Initial revision
#
#
sect=`echo $1 | sed 's:Section.::; s:Chapter/short/::'`
if [ -f lastpage ]; then
  read page < lastpage
  page=`expr $page + 1`
else
  page=1
fi
TEMPFILE=/tmp/filelist.$$ export TEMPFILE
cat preferences/$1 > $TEMPFILE
GROFF_TMAC_PATH=`pwd`/../tools export GROFF_TMAC_PATH
PATH=`pwd`/../tools:$PATH
cd man$sect
rm -rf ../Chapter/short/$sect  ../Toc/$sect
mkdir -p ../Chapter/short/$sect
echo --- eliminating duplicates
find . -type f -name "*.gz" | xargs ls -l | sort +4 \
   | sed 's:^.* ::; s:^\./::; s:\.gz$::' >> $TEMPFILE
   xargs <$TEMPFILE elimdup
printf "%-28s\t%s\t%s\t%s\n\n" "Man page" First Last Pages
for i in `xargs < ../filelist`; do		# ../filelist is created by elimdup
  printf "%-30s\t%d\t" $i $page
  cleanup $i <$i | gsoelim | ${TBL} |
  groff -rD1 -rP$page -r%$page -r$$ -rLL=${HEIGHT} -rIN=${WIDTH} -rN2 -mpic ${MACROFILE} - \
   >../Chapter/short/$sect/$i 2>>../Toc/$sect
#   echo   lastpage=\`awk \< ../Chapter/short/$sect/$i '/%%Page:/ {page=$2 }; END {print page}'\`
   lastpage=`awk < ../Chapter/short/$sect/$i '/%%Page:/ {page=$2 }; END {print page}'`
   if [ $lastpage -ge $page ]; then
     pages=`expr $lastpage - $page + 1`
     page=$lastpage
   else
     echo '***' $i has incorrect page numbering
     pages=1
   fi
   printf "%d\t%d\n" $page $pages
   page=`expr $page + 1`
   rm -f $i
done
echo $page > ../lastpage
echo
cd ..
echo Merging PostScript files
cd Chapter/short
rm -f Section.$sect
find $sect -type f | xargs ../merge >> Section.$sect
rm -rf $sect Section.$sect~
@


1.6
log
@Checkpoint 30 June, maybe final version of long book for 2.1.5?
@
text
@d10 1
a10 1
# $Id: makeshortsect,v 1.5 1996/04/08 12:07:27 grog Exp grog $
d13 3
@


1.5
log
@Minor mods (do we need this any more?)
@
text
@d10 1
a10 1
# $Id: makeshortsect,v 1.4 1996/02/24 16:31:45 grog Exp grog $
d13 3
d26 1
a26 1
sect=`echo $1 | sed 's:Section.::; s:Chapter.short/::'`
d38 2
a39 2
rm -rf ../Chapter.short/$sect  ../Toc/$sect
mkdir -p ../Chapter.short/$sect
d49 3
a51 3
   >../Chapter.short/$sect/$i 2>>../Toc/$sect
#   echo   lastpage=\`awk \< ../Chapter.short/$sect/$i '/%%Page:/ {page=$2 }; END {print page}'\`
   lastpage=`awk < ../Chapter.short/$sect/$i '/%%Page:/ {page=$2 }; END {print page}'`
d67 1
a67 1
cd Chapter.short
@


1.4
log
@More mods
@
text
@d10 1
a10 1
# $Id: makeshortsect,v 1.2 1996/02/24 12:17:12 grog Exp grog $
d13 3
d23 1
a23 1
sect=`echo $1 | sed 's:Section.::; s:Chapter/::'`
d35 2
a36 2
rm -rf ../Chapter/$sect  ../Toc/$sect
mkdir -p ../Chapter/$sect
d46 3
a48 3
   >../Chapter/$sect/$i 2>>../Toc/$sect
#   echo   lastpage=\`awk \< ../Chapter/$sect/$i '/%%Page:/ {page=$2 }; END {print page}'\`
   lastpage=`awk < ../Chapter/$sect/$i '/%%Page:/ {page=$2 }; END {print page}'`
d64 1
a64 1
cd Chapter
@


1.3
log
@more minor nits
@
text
@d23 1
@


1.2
log
@minor mods
@
text
@d10 1
a10 1
# $Id: makeshortsect,v 1.1 1996/02/18 10:39:13 grog Exp grog $
d13 3
d63 1
a63 2
# XXX Are we screwing up fonts again?
# rm -rf $sect Section.$sect~
@


1.1
log
@Initial revision
@
text
@d10 1
a10 1
# $Id$
d12 3
a14 1
# $Log$
d16 1
d53 1
a53 3
if [ -f ../lastpage ]; then		# care, we're one directory level down
  echo $page > ../lastpage
fi
d60 2
a61 1
rm -rf $sect Section.$sect~
@
