oldversion can be NULL, which would trigger an assertion in
pkg_version_cmp.