# Create the body of the 'packages' appendix
# 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).
FILE=packages_body.mm
if [ ! -f $FILE ]; then 		# no $FILE file yet,
  touch $FILE
fi
sort -t\| < INDEX | awk -F\| '{print $1 "#T{\n" $7 "\nT}#T{\n" $4 "\nT}" }' >$FILE.new
if [ -f $FILE ]; then	# already have one, is it the same?
  cmp $FILE $FILE.new 2> /dev/null  >/dev/null
  if [ $? -ne 0 ]; then		# changed
    echo +++ $FILE changed - need to repeat format
    mv $FILE.new $FILE
  else
    rm $FILE.new
  fi
else
  mv $FILE.new $FILE
fi

  
