#!/bin/sh

ARCH=`arch`
rm -rf $1.cvswrap
mv $1 $1.cvswrap

if gzip -qt $1.cvswrap 2>&1 /dev/null > /dev/null; then
  echo "    fromcvs (gunzipuntar) --> $1"
  gzcat $1.cvswrap | /usr/cvs/$ARCH/bin/tar --alpha-order --no-owners --no-mtime -x -f -
else
  echo -n "    fromcvs (untar) --> $1"
  if /usr/cvs/$ARCH/bin/tar --alpha-order --no-owners --no-mtime -x -f $1.cvswrap; then
    echo " ... ok"
  else
    echo " ... failed"
    echo "    trying (gunzipuntar) --> $1"
    gzcat $1.cvswrap | /usr/cvs/$ARCH/bin/tar --alpha-order --no-owners --no-mtime -x -f -
  fi
fi
