| |
continue;
|
| |
|
| |
rpkg = NULL;
|
| - |
if (pkg->type == PKG_INSTALLED) {
|
| - |
npkg = get_local_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), 0);
|
| + |
npkg = get_local_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), 0);
|
| + |
if (npkg == NULL) {
|
| + |
/*
|
| + |
* We have a package installed, but its dependencies are not,
|
| + |
* try to search a remote dependency
|
| + |
*/
|
| + |
npkg = get_remote_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), 0);
|
| |
if (npkg == NULL) {
|
| - |
/*
|
| - |
* We have a package installed, but its dependencies are not,
|
| - |
* try to search a remote dependency
|
| - |
*/
|
| - |
npkg = get_remote_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), 0);
|
| - |
if (npkg == NULL) {
|
| - |
/* Cannot continue */
|
| - |
pkg_emit_error("Missing dependency matching '%s'", pkg_dep_get(d, PKG_DEP_ORIGIN));
|
| - |
return (EPKG_FATAL);
|
| - |
}
|
| - |
}
|
| - |
else if (j->type == PKG_JOBS_UPGRADE) {
|
| - |
/* For upgrade jobs we need to ensure that we do not have a newer version */
|
| - |
rpkg = get_remote_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), 0);
|
| - |
if (rpkg != NULL) {
|
| - |
if (!pkg_need_upgrade(rpkg, npkg, j->flags & PKG_FLAG_RECURSIVE)) {
|
| - |
pkg_free(rpkg);
|
| - |
rpkg = NULL;
|
| - |
}
|
| - |
}
|
| + |
/* Cannot continue */
|
| + |
pkg_emit_error("Missing dependency matching '%s'", pkg_dep_get(d, PKG_DEP_ORIGIN));
|
| + |
return (EPKG_FATAL);
|
| |
}
|
| |
}
|
| - |
else {
|
| - |
npkg = get_remote_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), 0);
|
| - |
if (npkg == NULL) {
|
| - |
npkg = get_local_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), 0);
|
| - |
if (npkg == NULL) {
|
| - |
/* Cannot continue */
|
| - |
pkg_emit_error("Missing dependency matching '%s'", pkg_dep_get(d, PKG_DEP_ORIGIN));
|
| - |
return (EPKG_FATAL);
|
| + |
else if (j->type == PKG_JOBS_UPGRADE) {
|
| + |
/* For upgrade jobs we need to ensure that we do not have a newer version */
|
| + |
rpkg = get_remote_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), 0);
|
| + |
if (rpkg != NULL) {
|
| + |
if (!pkg_need_upgrade(rpkg, npkg, j->flags & PKG_FLAG_RECURSIVE)) {
|
| + |
pkg_free(rpkg);
|
| + |
rpkg = NULL;
|
| |
}
|
| |
}
|
| |
}
|
| |
if (unit != NULL)
|
| |
continue;
|
| |
|
| - |
if (pkg->type == PKG_INSTALLED) {
|
| - |
npkg = get_local_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), 0);
|
| + |
npkg = get_local_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), 0);
|
| + |
if (npkg == NULL) {
|
| + |
/*
|
| + |
* We have a package installed, but its dependencies are not,
|
| + |
* try to search a remote dependency
|
| + |
*/
|
| + |
npkg = get_remote_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), 0);
|
| |
if (npkg == NULL) {
|
| - |
/*
|
| - |
* We have a package installed, but its dependencies are not,
|
| - |
* try to search a remote dependency
|
| - |
*/
|
| - |
npkg = get_remote_pkg(j, pkg_dep_get(d, PKG_DEP_ORIGIN), 0);
|
| - |
if (npkg == NULL) {
|
| - |
/* Cannot continue */
|
| - |
pkg_emit_error("Missing dependency matching '%s'", pkg_dep_get(d, PKG_DEP_ORIGIN));
|
| - |
return (EPKG_FATAL);
|
| - |
}
|
| + |
/* Cannot continue */
|
| + |
pkg_emit_error("Missing dependency matching '%s'", pkg_dep_get(d, PKG_DEP_ORIGIN));
|
| + |
return (EPKG_FATAL);
|
| |
}
|
| |
}
|
| - |
else {
|
| - |
/* Do not care about remote rdeps */
|
| - |
continue;
|
| - |
}
|
| - |
|
| |
if (pkg_jobs_add_universe(j, npkg, recursive) != EPKG_OK)
|
| |
return (EPKG_FATAL);
|
| |
}
|
| |
if (unit != NULL)
|
| |
continue;
|
| |
|
| - |
if (pkg->type == PKG_INSTALLED) {
|
| - |
/* We assume that we cannot have conflicts installed */
|
| - |
npkg = get_remote_pkg(j, pkg_conflict_origin(c), 0);
|
| - |
if (npkg == NULL) {
|
| - |
continue;
|
| - |
}
|
| - |
}
|
| - |
else {
|
| - |
/* Check both local and remote conflicts */
|
| - |
npkg = get_remote_pkg(j, pkg_conflict_origin(c), 0);
|
| - |
if (pkg_jobs_add_universe(j, npkg, recursive) != EPKG_OK)
|
| - |
return (EPKG_FATAL);
|
| - |
npkg = get_local_pkg(j, pkg_conflict_origin(c), 0);
|
| - |
if (npkg == NULL) {
|
| - |
continue;
|
| - |
}
|
| + |
/* Check both local and remote conflicts */
|
| + |
npkg = get_remote_pkg(j, pkg_conflict_origin(c), 0);
|
| + |
if (pkg_jobs_add_universe(j, npkg, recursive) != EPKG_OK)
|
| + |
return (EPKG_FATAL);
|
| + |
npkg = get_local_pkg(j, pkg_conflict_origin(c), 0);
|
| + |
if (npkg == NULL) {
|
| + |
continue;
|
| |
}
|
| |
|
| |
if (pkg_jobs_add_universe(j, npkg, recursive) != EPKG_OK)
|