#!/bin/rc rfork ne 9fs sources cd $home/pkg tmp=/tmp/$pid contrib=/n/sources/contrib/$user fn sighup { rm -f $tmp; exit } fn sigint { rm -f $tmp; exit } fn sigexit { rm -f $tmp; exit } fn pushfile { if(! test -r $1){ echo $1 cannot read file } if not if(! test -f $2){ echo create $name fcp $1 $2 } if not if(test $1 -nt $2){ echo update $1 fcp $1 $2 } } fcp $contrib/INDEX $tmp grep -v '^[ ]*#|^[ ]*$' $home/lib/pkglist | while(s=`{read}){ name=`{basename $s(1)} src=$name.tbz if(test -f $src){ echo $src^'.tbz: ' $s(2-) >> $tmp pushfile $src $contrib/$src } src=misc/^$name if(test -f $src){ echo $src^': ' $s(2-) >> $tmp pushfile $src $contrib/$src } } exit '' echo update INDEX sort $tmp | uniq > $contrib/INDEX