#! /bin/sh
# extraction tool to unpack split uuencoded compressed tar
# archives (say that ten times quick).  this assumes that the files
# have had any header information stripped off of them.
# if you have unshar just switch the values of the unshar variable.

echo "Extracting split files..."
echo ""

# this weirdness is used to automatically strip headers of a shar
# file.
for i in shar.*
do
  cat << EOF > tmp.shar
#! /bin/sh
cat << '#! /bin/sh' > /dev/null
EOF
  cat $i >> tmp.shar
  chmod +x tmp.shar
  sh tmp.shar
  rm tmp.shar
done

echo ""
echo "Unsplitting uuencoded file..."

# unsplit the archives.  we use "sort" to ensure order although most
# sh's should do that for us.
rm -f xl.tar.Z.uue
for i in `echo split.* | sort`
do 
  cat $i >> xl.tar.Z.uue
done
rm split.*

echo ""
echo "Uudecoding compressed tar file..."

# uudecode the uue file
uudecode xl.tar.Z.uue
rm xl.tar.Z.uue

echo ""
echo "Unpacking compressed tar file..."

# unpack the archive
uncompress -c xl.tar.Z | tar xvf -

echo "Done."
