pre_upgrade() {
  if (( $(vercmp $2 20210603) < 0 )); then
    local olddir=/etc/ca-certificates/trust-source/blacklist
    local newdir=/etc/ca-certificates/trust-source/blocklist
    cat <<MSG
  > $olddir has been renamed to
    $newdir
MSG

    if [[ ! -e $olddir ]]; then
      :  # Do nothing
    elif [[ -e $newdir ]]; then
      cat <<MSG
  > WARNING: $newdir already exists.
    You must migrate your blocked certificates manually.
MSG
    else
      mv -Tn $olddir $newdir
    fi
  fi
}

# vim:set sw=2 sts=-1 et:
