#! /bin/sh

root_of_x_tree=../..
here=contrib/sgi

#
# This shell script applies the SGI changes to an X source tree it assumes
# that we are running from the contrib/sgi subdirectory under the X tree.
#

cd newfiles
tocopy=`find . -type f -a -print | sed -e s/^..//`
cd ../diffs
topatch=`find . -type f -a -print | sed -e s/^..//`
cd ..
cd $root_of_x_tree

mkdir server/ddx/sgi
mkdir server/ddx/sgi/4d
mkdir server/ddx/sgi/cfb

for filetocopy in $tocopy
do
    ln $here/newfiles/$filetocopy $filetocopy
done

for filetopatch in $topatch
do
    patch $filetopatch < $here/diffs/$filetopatch
done
