]> git.pld-linux.org Git - packages/poldek.git/blob - poldek-skip-suggests-on-upgrade.patch
- zlib fixes but still some issues not solved
[packages/poldek.git] / poldek-skip-suggests-on-upgrade.patch
1 commit e7a7215898ec0c15ac5572d292a378f4a2cffdeb
2 Author: Marcin Banasiak <megabajt@pld-linux.org>
3 Date:   Mon Feb 23 22:42:43 2009 +0100
4
5     On upgrade don't suggest packages skipped during instalation.
6     
7     This change implements future described in this thread:
8     
9     http://lists.pld-linux.org/mailman/pipermail/pld-devel-pl/2008-June/145262.html
10     
11     Currently it is enabled by default and there is no way to disable this
12     behaviour. Should it be possible?
13
14 diff --git a/install3/requirements.c b/install3/requirements.c
15 index dbb3092..bfbe481 100644
16 --- a/install3/requirements.c
17 +++ b/install3/requirements.c
18 @@ -595,6 +595,7 @@ static int process_req(int indent, struct i3ctx *ictx,
19  static tn_array *with_suggests(int indent, struct i3ctx *ictx, struct pkg *pkg) 
20  {
21      tn_array *suggests = NULL, *choices = NULL;
22 +    struct pkg *oldpkg = NULL;
23      int i, autochoice = 0;
24  
25      if (pkg->sugs == NULL)
26 @@ -618,12 +619,15 @@ static tn_array *with_suggests(int indent, struct i3ctx *ictx, struct pkg *pkg)
27  
28      tracef(indent, "%s", pkg_id(pkg));
29  
30 +    /* gets old version of pkg (from marked for removal) */
31 +    oldpkg = iset_has_kind_of_pkg(ictx->unset, pkg);
32 +
33      suggests = capreq_arr_new(4);
34      n_array_ctl_set_freefn(suggests, NULL); /* 'weak' ref */
35      for (i=0; i < n_array_size(pkg->sugs); i++) {
36          struct capreq *req = n_array_nth(pkg->sugs, i);
37          struct pkg *tomark = NULL;
38 -        
39 +                
40          if (iset_provides(ictx->inset, req)) {
41              trace(indent, "- %s: already marked", capreq_stra(req));
42              continue;
43 @@ -633,6 +637,13 @@ static tn_array *with_suggests(int indent, struct i3ctx *ictx, struct pkg *pkg)
44              trace(indent, "- %s: satisfied by db", capreq_stra(req));
45              continue;
46          }
47 +
48 +       /* on upgrade don't suggest package skipped during installation */
49 +        if (oldpkg && oldpkg->sugs && capreq_arr_contains(oldpkg->sugs, capreq_name(req))) {
50 +           trace(indent, "- %s: skipped on install -> don't suggest on upgrade",
51 +                capreq_stra(req));
52 +           continue;
53 +        }
54          
55          if (!i3_find_req(indent, ictx, pkg, req, &tomark, NULL)) {
56              logn(LOGWARN, _("%s: suggested %s not found, skipped"), pkg_id(pkg),
This page took 0.04475 seconds and 3 git commands to generate.