#!/bin/sh

if builtin type -P transactional-update &> /dev/null && [ "$TRANSACTIONAL_UPDATE" != "true" ]; then
  # Do not clean previous environment on T-U systems when not in transaction
  exit 0
fi

if [ -d "VENV_LOCATION_PLACEHOLDER/lib/prev_env" ]; then
  rm -r "VENV_LOCATION_PLACEHOLDER/lib/prev_env" || :
fi
if [ -L "VENV_LOCATION_PLACEHOLDER/lib/PLACEHOLDER" ]; then
  unlink "VENV_LOCATION_PLACEHOLDER/lib/PLACEHOLDER" || :
fi
