2 ===================================================================
3 RCS file: /cvsroot/poldek/poldek/uninstall.c,v
4 retrieving revision 1.47
5 retrieving revision 1.48
7 --- uninstall.c 2 Feb 2008 21:49:04 -0000 1.47
8 +++ uninstall.c 2 Mar 2008 20:05:56 -0000 1.48
19 static int pkg_leave_orphans(struct uninstall_ctx *uctx, struct pkg *pkg)
21 struct capreq *selfcap;
25 + exclude = n_array_dup(uctx->unpkgs, (tn_fn_dup)pkg_link);
26 + /* yep, there are packages which requires themselves */
27 + n_array_push(exclude, pkg_link(pkg));
29 capreq_new_name_a(pkg->name, selfcap);
30 - if (pkgdb_q_is_required(uctx->db, selfcap, uctx->unpkgs))
32 + if (pkgdb_q_is_required(uctx->db, selfcap, exclude))
36 for (i=0; i < n_array_size(pkg->caps); i++) {
37 struct capreq *cap = n_array_nth(pkg->caps, i);
38 - if (pkgdb_q_is_required(uctx->db, cap, uctx->unpkgs))
40 + if (pkgdb_q_is_required(uctx->db, cap, exclude))
46 while ((path = pkgfl_it_get(&it, NULL))) {
48 capreq_new_name_a(path, cap);
49 - if (pkgdb_q_is_required(uctx->db, cap, uctx->unpkgs))
51 + if (pkgdb_q_is_required(uctx->db, cap, exclude))
57 + n_array_free(exclude);
61 + n_array_free(exclude);
69 pkg_set_mf(uctx->pms, dbpkg, DBPKG_REV_ORPHANED);
70 pkg_dep_mark(uctx->ts->pms, dbpkg);
71 n_array_push(uctx->unpkgs, pkg_link(dbpkg));
74 if (uctx->rev_orphans_deep > deep)
75 process_pkg_rev_orphans(indent + 2, uctx, dbpkg, deep + 1);