common implementation for package version checking