anchor.diff:  function create_symlinks(){
       if [ -n $USE_RELEASE_DIRECTORY ] ; then
           export CURRENT_DIR="$INSTALL_ROOT/current"
  -	if [ -e "$CURRENT_DIR" ] ; then
  -	    rm "$CURRENT_DIR"
  -	fi
  -	ln -s "$INSTALL_DIR" "$CURRENT_DIR"
  -	log "Symlinked '$INSTALL_DIR' to '$CURRENT_DIR'"
  +        if [ -e "$CURRENT_DIR" ] ; then
  +            rm "$CURRENT_DIR"
  +        fi
  +        ln -s "$INSTALL_DIR" "$CURRENT_DIR"
  +        log "Symlinked '$INSTALL_DIR' to '$CURRENT_DIR'"
       fi
   }
   
  
positive.code: #
  # The post install scripts are called with INSTALL_ROOT, INSTALL_DIR and VERBOSE exported
  # into the environment for their use.
  # 
  # INSTALL_ROOT = the path passed in with -i or a relative directory of the name of the package
  #                file with no extension
  # INSTALL_DIR  = the same as INSTALL_ROOT unless -c (capistrano release directory) argumetn
  
negative.code: # VERBOSE      = is set if the package was called with -v for verbose output
  function main() {
      set_install_dir
      unpack_payload
      create_symlinks
      run_post_install
  
      log "Installation complete."
  }
  
  function set_install_dir(){
      # if INSTALL_ROOT isn't set by parsed args, use basename of package file with no extension
      DEFAULT_DIR=$(echo $(basename $0) | sed -e 's/\.[^\.]*$//')
      INSTALL_DIR=${INSTALL_ROOT:-$DEFAULT_DIR}
  
      if [ -n $USE_RELEASE_DIRECTORY ] ; then
          RELEASE_ID=<%= release_id %>
          DATESTAMP=$(date +%Y%m%d%H%M%S)
          INSTALL_DIR="$INSTALL_DIR/releases/${RELEASE_ID:-$DATESTAMP}"
      fi
  
      mkdir -p "$INSTALL_DIR" || die "Unable to create install directory $INSTALL_DIR"
  
      export INSTALL_DIR
  
      log "Installing package to '$INSTALL_DIR'"
  }
  
  