#!/bin/rc rfork en . funcs rm -rf $build/sources/patch mkdir $build/sources/patch cd $build/sources/patch if(~ $patches '') patches=$dir/list local=`{grep '^/' $patches | awk -F' ' '{print $1}'} http=`{grep '^http://' $patches | awk -F' ' '{print $1}'} remote=`{grep . $patches | grep -v '^#' | grep -v '^/' | grep -v '^http://' | awk -F' ' '{print $1}'} for(i in $remote) { echo '#' hget $uri_patch/$i.diff hget -o $i $uri_patch/$i.diff || exit hget } for(i in $http) { echo '#' hget $http hget -o $i $http || exit hget } cd $build/sources/plan9 for(i in $local) { echo '#' $i if(test -f $i) ape/patch -p1 < $i } for(i in $remote) { echo '#' $i ape/patch -p1 < $build/sources/patch/$i } for(i in $http) { echo '#' $i n=`{basename $i | sed 's/\.diff$//'} ape/patch -p1 < $build/sources/patch/$n }