#! /bin/sh
#
# This script ensures that the var directory remains a symbolic link in
# the miniroot.

if [ ! -z "$PKGDBARG" ]; then 
  echo $PKGDBARG | grep "^\-C" > /dev/null 2>&1
  if [ $? -eq 0 ] && [ "$PKG_NONABI_SYMLINKS" != "true" ]; then
   cat <<EOF

   It appears that you are trying to install this patch onto the miniroot
   of a Net Install Image.  This patch contains files that are to be 
   installed under the "var" directory in the miniroot.  Since "var" is 
   a symbolic link under the miniroot, you must first set the following 
   patchadd environment variable to "true" in order to avoid clobbering
   the "var" symbolic link:

    # PKG_NONABI_SYMLINKS="true"
    # export PKG_NONABI_SYMLINKS
  
   Aborting installation ...
  
EOF

   exit 1

  fi
fi

exit 0
