Skip to content

Commit

Permalink
Fix automatic propagation
Browse files Browse the repository at this point in the history
Issue: freebsd#1374
Reported by: @andrejzverev
  • Loading branch information
vstakhov committed Feb 29, 2016
1 parent 7d6423d commit 6462305
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions libpkg/pkg_jobs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1278,8 +1278,9 @@ pkg_jobs_propagate_automatic(struct pkg_jobs *j)
unit->pkg->automatic = automatic;
}
else {
if (j->type == PKG_JOBS_INSTALL)
if (j->type == PKG_JOBS_INSTALL) {
unit->pkg->automatic = false;
}
}
}
else {
Expand All @@ -1296,10 +1297,33 @@ pkg_jobs_propagate_automatic(struct pkg_jobs *j)
break;
}
}
if (local != NULL)
LL_FOREACH(unit, cur)
if (cur->pkg->type != PKG_INSTALLED)
if (local != NULL) {
LL_FOREACH(unit, cur) {
/*
* Propagate automatic from local package
*/
if (cur->pkg->type != PKG_INSTALLED) {
cur->pkg->automatic = automatic;
}
}
}
else {
/*
* For packages that are not unique, we might still have
* a situation when we need to set automatic for all
* non-local packages
*
* See #1374
*/
HASH_FIND_STR(j->request_add, unit->pkg->uid, req);
if ((req == NULL || req->automatic)) {
automatic = true;
pkg_debug(2, "set automatic flag for %s", unit->pkg->uid);
LL_FOREACH(unit, cur) {
cur->pkg->automatic = automatic;
}
}
}
}
}
}
Expand Down

0 comments on commit 6462305

Please sign in to comment.