SOURCES: poldek-skip-suggests-on-upgrade.patch (NEW) - on upgrade, don't su...
megabajt
megabajt at pld-linux.org
Mon Feb 23 23:04:52 CET 2009
Author: megabajt Date: Mon Feb 23 22:04:52 2009 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- on upgrade, don't suggest packages which were skipped during installation.
Details in this thread:
http://lists.pld-linux.org/mailman/pipermail/pld-devel-pl/2008-June/145262.html
---- Files affected:
SOURCES:
poldek-skip-suggests-on-upgrade.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/poldek-skip-suggests-on-upgrade.patch
diff -u /dev/null SOURCES/poldek-skip-suggests-on-upgrade.patch:1.1
--- /dev/null Mon Feb 23 23:04:53 2009
+++ SOURCES/poldek-skip-suggests-on-upgrade.patch Mon Feb 23 23:04:47 2009
@@ -0,0 +1,56 @@
+commit e7a7215898ec0c15ac5572d292a378f4a2cffdeb
+Author: Marcin Banasiak <megabajt at pld-linux.org>
+Date: Mon Feb 23 22:42:43 2009 +0100
+
+ On upgrade don't suggest packages skipped during instalation.
+
+ This change implements future described in this thread:
+
+ http://lists.pld-linux.org/mailman/pipermail/pld-devel-pl/2008-June/145262.html
+
+ Currently it is enabled by default and there is no way to disable this
+ behaviour. Should it be possible?
+
+diff --git a/install3/requirements.c b/install3/requirements.c
+index dbb3092..bfbe481 100644
+--- a/install3/requirements.c
++++ b/install3/requirements.c
+@@ -595,6 +595,7 @@ static int process_req(int indent, struct i3ctx *ictx,
+ static tn_array *with_suggests(int indent, struct i3ctx *ictx, struct pkg *pkg)
+ {
+ tn_array *suggests = NULL, *choices = NULL;
++ struct pkg *oldpkg = NULL;
+ int i, autochoice = 0;
+
+ if (pkg->sugs == NULL)
+@@ -618,12 +619,15 @@ static tn_array *with_suggests(int indent, struct i3ctx *ictx, struct pkg *pkg)
+
+ tracef(indent, "%s", pkg_id(pkg));
+
++ /* gets old version of pkg (from marked for removal) */
++ oldpkg = iset_has_kind_of_pkg(ictx->unset, pkg);
++
+ suggests = capreq_arr_new(4);
+ n_array_ctl_set_freefn(suggests, NULL); /* 'weak' ref */
+ for (i=0; i < n_array_size(pkg->sugs); i++) {
+ struct capreq *req = n_array_nth(pkg->sugs, i);
+ struct pkg *tomark = NULL;
+-
++
+ if (iset_provides(ictx->inset, req)) {
+ trace(indent, "- %s: already marked", capreq_stra(req));
+ continue;
+@@ -633,6 +637,13 @@ static tn_array *with_suggests(int indent, struct i3ctx *ictx, struct pkg *pkg)
+ trace(indent, "- %s: satisfied by db", capreq_stra(req));
+ continue;
+ }
++
++ /* on upgrade don't suggest package skipped during installation */
++ if (oldpkg && oldpkg->sugs && capreq_arr_contains(oldpkg->sugs, capreq_name(req))) {
++ trace(indent, "- %s: skipped on install -> don't suggest on upgrade",
++ capreq_stra(req));
++ continue;
++ }
+
+ if (!i3_find_req(indent, ictx, pkg, req, &tomark, NULL)) {
+ logn(LOGWARN, _("%s: suggested %s not found, skipped"), pkg_id(pkg),
================================================================
More information about the pld-cvs-commit
mailing list