Packages pkgs = repo.getParentRepo().getPackages(pkgName);
// check if installed package matches required version
if (pkgs != null) {
if (version != null) {
Package latest = pkgs.latest();
DependencyVersion depVersion = version.getDependencyVersion();
if (depVersion.isCompatible(latest.getVersion())) {
isInstalled = true;
} else {
LOG.debug("Package " + pkgName + " needs to be upgraded");
if (enforceDeps) {
throw new PackageException("Package requires version " + version.toString() +