SOURCES: poldek-uninstall-greedy-fix.patch (NEW) - backported fixe...
megabajt
megabajt at pld-linux.org
Wed Apr 2 20:10:06 CEST 2008
Author: megabajt Date: Wed Apr 2 18:10:06 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- backported fixes from poldek CVS:
- display marked as orphaned packages in summary
- remove self-required packages too
---- Files affected:
SOURCES:
poldek-uninstall-greedy-fix.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/poldek-uninstall-greedy-fix.patch
diff -u /dev/null SOURCES/poldek-uninstall-greedy-fix.patch:1.1
--- /dev/null Wed Apr 2 20:10:06 2008
+++ SOURCES/poldek-uninstall-greedy-fix.patch Wed Apr 2 20:10:01 2008
@@ -0,0 +1,76 @@
+Index: uninstall.c
+===================================================================
+RCS file: /cvsroot/poldek/poldek/uninstall.c,v
+retrieving revision 1.47
+retrieving revision 1.48
+diff -u -r1.47 -r1.48
+--- uninstall.c 2 Feb 2008 21:49:04 -0000 1.47
++++ uninstall.c 2 Mar 2008 20:05:56 -0000 1.48
+@@ -11,7 +11,7 @@
+ */
+
+ /*
+- $Id$
++ $Id$
+ */
+
+ #include <errno.h>
+@@ -122,17 +122,22 @@
+ static int pkg_leave_orphans(struct uninstall_ctx *uctx, struct pkg *pkg)
+ {
+ struct capreq *selfcap;
++ tn_array *exclude;
+ int i;
+
++ exclude = n_array_dup(uctx->unpkgs, (tn_fn_dup)pkg_link);
++ /* yep, there are packages which requires themselves */
++ n_array_push(exclude, pkg_link(pkg));
++
+ capreq_new_name_a(pkg->name, selfcap);
+- if (pkgdb_q_is_required(uctx->db, selfcap, uctx->unpkgs))
+- return 1;
++ if (pkgdb_q_is_required(uctx->db, selfcap, exclude))
++ goto l_yes;
+
+ if (pkg->caps)
+ for (i=0; i < n_array_size(pkg->caps); i++) {
+ struct capreq *cap = n_array_nth(pkg->caps, i);
+- if (pkgdb_q_is_required(uctx->db, cap, uctx->unpkgs))
+- return 1;
++ if (pkgdb_q_is_required(uctx->db, cap, exclude))
++ goto l_yes;
+ }
+
+ if (pkg->fl) {
+@@ -143,13 +148,20 @@
+ while ((path = pkgfl_it_get(&it, NULL))) {
+ struct capreq *cap;
+ capreq_new_name_a(path, cap);
+- if (pkgdb_q_is_required(uctx->db, cap, uctx->unpkgs))
+- return 1;
++ if (pkgdb_q_is_required(uctx->db, cap, exclude))
++ goto l_yes;
+ }
+ }
++
+
++ n_array_free(exclude);
+ return 0;
++
++l_yes:
++ n_array_free(exclude);
++ return 1;
+ }
++
+
+
+ /*
+@@ -194,6 +206,8 @@
+ pkg_set_mf(uctx->pms, dbpkg, DBPKG_REV_ORPHANED);
+ pkg_dep_mark(uctx->ts->pms, dbpkg);
+ n_array_push(uctx->unpkgs, pkg_link(dbpkg));
++ uctx->ndep++;
++
+ if (uctx->rev_orphans_deep > deep)
+ process_pkg_rev_orphans(indent + 2, uctx, dbpkg, deep + 1);
+ }
================================================================
More information about the pld-cvs-commit
mailing list