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


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

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

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

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


desc
@Create the index
@


1.4
log
@Minor mods
@
text
@# Build a new index.mm.  If an old one exists and has the same contents,
# don't replace it (otherwise we'll rebuild the book for nothing).
if [ ! -f index.mm ]; then 		# no index.mm file yet,
  touch index.mm
fi
outfile=$1
shift
cd Toc; grep -h '><INDEX:' $* | sed 's*><INDEX:**' | sort -f | uniq | ../mkindex > ../$outfile.new
cd ..
if [ -f $outfile ]; then	# already have one, is it the same?
  cmp $outfile $outfile.new 2> /dev/null  >/dev/null
  if [ $? -ne 0 ]; then		# changed
    echo +++ $outfile changed - need to repeat format
    mv $outfile.new $outfile
  else
    rm $outfile.new
  fi
else
  mv $outfile.new $outfile
fi

  
@


1.3
log
@Minor mods
@
text
@a15 1
    echo +++ $outfile unchanged
@


1.2
log
@Minor corrections
@
text
@d6 3
a8 1
cd Toc; grep -h '><INDEX:' $* | sed 's*><INDEX:**' | sort -f | uniq | ../mkindex > ../index.mm.new
d10 2
a11 2
if [ -f index.mm ]; then	# already have one, is it the same?
  cmp index.mm index.mm.new 2> /dev/null  >/dev/null
d13 2
a14 2
    echo +++ index.mm changed - need to repeat format
    mv index.mm.new index.mm
d16 2
a17 2
    echo +++ index.mm unchanged
    rm index.mm.new
d20 1
a20 1
  mv index.mm.new index.mm
@


1.1
log
@Initial revision
@
text
@d3 3
@
