Author: megabajt                     Date: Thu Sep 18 18:03:29 2008 GMT
Module: poldek                        Tag: HEAD
---- Log message:
- bugfix: don't install all suggested packages in "select some of" mode 
  when user chose 'n' for all of them

---- Files affected:
poldek/poldek/install3:
   requirements.c (1.11 -> 1.12) 

---- Diffs:

================================================================
Index: poldek/poldek/install3/requirements.c
diff -u poldek/poldek/install3/requirements.c:1.11 
poldek/poldek/install3/requirements.c:1.12
--- poldek/poldek/install3/requirements.c:1.11  Wed Aug 20 22:15:52 2008
+++ poldek/poldek/install3/requirements.c       Thu Sep 18 20:03:24 2008
@@ -662,18 +662,30 @@
     choices = n_array_clone(suggests);
     n_array_ctl_set_freefn(choices, NULL); /* 'weak' ref */
     
-    if (!poldek__choose_suggests(ictx->ts, pkg, suggests, choices, 0)) {
-        n_array_free(choices);
-        n_array_cfree(&suggests);
-        
-    } else {
-        if (!n_array_size(choices))
-            n_array_free(choices);
-        
-        else {
-            n_array_free(suggests);
-            suggests = choices;
-        }
+    switch (poldek__choose_suggests(ictx->ts, pkg, suggests, choices, 0)) {
+       /* do not install any of suggested packages */
+       case 0:
+           n_array_free(choices);
+           n_array_cfree(&suggests);
+           break;
+       /* TOFIX: why 'Q' means install all? */
+       case -1:
+       /* install all suggested packages */
+       case 1:
+           n_array_free(choices);
+           break;
+       /* select some of */
+       case 2:
+           if (n_array_size(choices) == 0) {
+               n_array_free(choices);
+               n_array_cfree(&suggests);
+           } else {
+               n_array_free(suggests);
+               suggests = choices;
+           }
+           break;
+       default:
+           n_assert(0);
     }
     
     return suggests;
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/poldek/poldek/install3/requirements.c?r1=1.11&r2=1.12&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to