#!/bin/rc rfork e if(! ~ $#* 0){ echo 'usage: patch/pull' >[1=2] exit usage } . /rc/bin/patch/defs mountfs test -e $SD/dist/patch/applied || fail no nix patches test -e /n/dist/386 || bind /root /n/dist || fail no dist patches=`{cat $SD/dist/patch/applied} for(p in $patches){ if(! grep -s '^'^$p^'$' /n/dist/dist/patch/applied>[2]/dev/null){ if(test -d $PD/$p){ echo patch/apply $p patch/apply $p || fail apply failed patch/applied $p } if not { echo patch $p no longer exists. ignored. >[1=2] } } } if(test -x /bin/up){ if(! up -s $SD/rc/bin/patch /rc/bin/patch){ echo there is a new version of the patch tools. >[1=2] echo run this to update them: >[1=2] up $SD/rc/bin/patch /rc/bin/patch >[1=2] exit '' } } echo up to date >[1=2] exit ''