]> git.pld-linux.org Git - packages/poldek.git/commitdiff
- backported fixes from poldek CVS:
authorMarcin Banasiak <marcin.banasiak@gmail.com>
Wed, 2 Apr 2008 18:10:01 +0000 (18:10 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
 - display marked as orphaned packages in summary
 - remove self-required packages too

Changed files:
    poldek-uninstall-greedy-fix.patch -> 1.1

poldek-uninstall-greedy-fix.patch [new file with mode: 0644]

diff --git a/poldek-uninstall-greedy-fix.patch b/poldek-uninstall-greedy-fix.patch
new file mode 100644 (file)
index 0000000..a7ceae1
--- /dev/null
@@ -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);
+         }
This page took 1.156625 seconds and 4 git commands to generate.