#!	/bin/csh	-f

set BDIR	= /local/bin
set PDIR	= /local/lib/palias
set MAPDIR	= /local/lib/palias/uumap
set NEWSDIR	= /news/comp/mail/maps
set LOG		= $PDIR/makemap.log

set BASE = `cat $MAPDIR/.last`
cd $NEWSDIR
set MAPS = ( `ls` )
if ( $#MAPS == 0 ) exit

foreach m ( $MAPS )
    if ( $m > $BASE ) then
	$BDIR/unshar -n -c$MAPDIR $m >>& $LOG
	set NEWMAP
    endif
end
if ( ! $?NEWMAP ) exit

echo $m > $MAPDIR/.last
cd $PDIR
rm paths.pag paths.dir
mv paths paths.old
$BDIR/pathalias Path.* uumap/[du].* | sed -e 's/	ptsfa\!/	/' -e '/^ptsfa/d'  | sort | $BDIR/pathprune > paths
$BDIR/makedb -o paths paths
#add sentinel for uumail >>& $LOG
$BDIR/makedb -a -o paths @@@ >>& $LOG
