#!/bin/sh

usage() {
    echo 1>&2 "
Usage: rebundle bundle-file

Updates the contents of a bundle file to the current verions.
Previous bundle file is moved to ,bundlefile.
See bundle.
"
    exit 2
}

case $# in
0) usage
esac

bundlefile=$1

FILES=`awk '/======== / { print $2 }' $bundlefile`

case $FILES in
"")  usage
esac

mv $bundlefile ,$bundlefile

for x in $FILES
do
    if test -f $x -a -r $x
    then
	echo '========' $x
	cat $x
    fi
done > $bundlefile
echo '========' >> $bundlefile
