diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2020-11-27 14:49:33 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2020-11-27 14:49:33 +0900 |
commit | b712cabb59f7155205489f15a37addb4ac8b0069 (patch) | |
tree | f23ecab07fbaa48e274c587d66708daad1cd347a /src/cleandeps.c | |
parent | 2792a56227313bb9f16bd70604e79f47e9650885 (diff) | |
download | libsolv-b712cabb59f7155205489f15a37addb4ac8b0069.tar.gz libsolv-b712cabb59f7155205489f15a37addb4ac8b0069.tar.bz2 libsolv-b712cabb59f7155205489f15a37addb4ac8b0069.zip |
Imported Upstream version 0.7.15upstream/0.7.15
Diffstat (limited to 'src/cleandeps.c')
-rw-r--r-- | src/cleandeps.c | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/src/cleandeps.c b/src/cleandeps.c index aa83c10..31b1ad9 100644 --- a/src/cleandeps.c +++ b/src/cleandeps.c @@ -669,6 +669,7 @@ solver_createcleandepsmap(Solver *solv, Map *cleandepsmap, int unneeded) queue_init(&iq); queue_init(&xsuppq); + /* setup userinstalled map and search for special namespace cleandeps erases */ for (i = 0; i < job->count; i += 2) { how = job->elements[i]; @@ -874,23 +875,38 @@ solver_createcleandepsmap(Solver *solv, Map *cleandepsmap, int unneeded) } queue_init_clone(&iqcopy, &iq); - if (!unneeded) - { - if (solv->cleandeps_updatepkgs) - for (i = 0; i < solv->cleandeps_updatepkgs->count; i++) - queue_push(&iq, solv->cleandeps_updatepkgs->elements[i]); - } - if (unneeded) queue_empty(&iq); /* just in case... */ - /* clear userinstalled bit for the packages we really want to delete/update */ + /* clear userinstalled bits for the packages we really want to delete */ for (i = 0; i < iq.count; i++) { p = iq.elements[i]; - if (pool->solvables[p].repo != installed) - continue; - MAPCLR(&userinstalled, p - installed->start); + if (pool->solvables[p].repo == installed) + MAPCLR(&userinstalled, p - installed->start); + } + /* set userinstalled bits for all packages not in the considered map */ + if (pool->considered) + { + for (p = installed->start; p < installed->end; p++) + if (!MAPTST(pool->considered, p)) + MAPSET(&userinstalled, p - installed->start); /* we may not remove those */ + } + if (!unneeded && solv->cleandeps_updatepkgs) + { + /* find update seeds */ + queue_init(&updatepkgs_filtered); + find_update_seeds(solv, &updatepkgs_filtered, &userinstalled); + /* clear userinstalled bit for the packages we want to update */ + /* also add them to the erase list */ + for (i = 0; i < solv->cleandeps_updatepkgs->count; i++) + { + p = solv->cleandeps_updatepkgs->elements[i]; + if (pool->considered && !MAPTST(pool->considered, p)) + continue; + queue_push(&iq, p); + MAPCLR(&userinstalled, p - installed->start); + } } for (p = installed->start; p < installed->end; p++) @@ -898,8 +914,6 @@ solver_createcleandepsmap(Solver *solv, Map *cleandepsmap, int unneeded) if (pool->solvables[p].repo != installed) continue; MAPSET(&installedm, p); - if (pool->considered && !MAPTST(pool->considered, p)) - MAPSET(&userinstalled, p - installed->start); /* we may not remove those */ if (unneeded && !MAPTST(&userinstalled, p - installed->start)) continue; MAPSET(&im, p); @@ -907,13 +921,6 @@ solver_createcleandepsmap(Solver *solv, Map *cleandepsmap, int unneeded) MAPSET(&installedm, SYSTEMSOLVABLE); MAPSET(&im, SYSTEMSOLVABLE); - if (!unneeded && solv->cleandeps_updatepkgs) - { - /* find update "seeds" */ - queue_init(&updatepkgs_filtered); - find_update_seeds(solv, &updatepkgs_filtered, &userinstalled); - } - #ifdef CLEANDEPSDEBUG printf("REMOVE PASS\n"); #endif |