poldek: poldek/install3/misc.c - check ability to install before hold (#153)

mis mis at pld-linux.org
Sun May 25 12:59:00 CEST 2008


Author: mis                          Date: Sun May 25 10:59:00 2008 GMT
Module: poldek                        Tag: HEAD
---- Log message:
- check ability to install before hold (#153)

---- Files affected:
poldek/poldek/install3:
   misc.c (1.10 -> 1.11) 

---- Diffs:

================================================================
Index: poldek/poldek/install3/misc.c
diff -u poldek/poldek/install3/misc.c:1.10 poldek/poldek/install3/misc.c:1.11
--- poldek/poldek/install3/misc.c:1.10	Sun May 25 11:13:38 2008
+++ poldek/poldek/install3/misc.c	Sun May 25 12:58:54 2008
@@ -80,15 +80,9 @@
         installable = -1;
         
     } else {
-            /* upgrade flag is set for downgrade and reinstall too */
-        if (poldek_ts_issetf(ts, POLDEK_TS_UPGRADE) && 
-            pkg_is_scored(pkg, PKG_HELD) && ts->getop(ts, POLDEK_OP_HOLD)) {
-            logn(LOGERR, _("%s: refusing to upgrade held package"),
-                 pkg_id(pkg));
-            installable = 0;
-            
-        } else if (cmprc <= 0 && force == 0 &&
-                   (poldek_ts_issetf(ts, POLDEK_TS_UPGRADE) || cmprc == 0)) {
+        /* upgrade flag is set for downgrade and reinstall too */
+        if (cmprc <= 0 && force == 0 &&
+            (poldek_ts_issetf(ts, POLDEK_TS_UPGRADE) || cmprc == 0)) {
             char *msg = "%s: %s version installed, %s";
             char *eqs = cmprc == 0 ? "equal" : "newer";
             char *skiped =  "skipped";
@@ -110,6 +104,13 @@
                 msgn(0, msg, pkg_id(pkg), eqs, skiped);
             }
         }
+        
+        if (installable > 0 && poldek_ts_issetf(ts, POLDEK_TS_UPGRADE) && 
+            ts->getop(ts, POLDEK_OP_HOLD) && pkg_is_scored(pkg, PKG_HELD)) {
+            logn(LOGERR, _("%s: refusing to upgrade held package"),
+                 pkg_id(pkg));
+            installable = 0;
+        }
     }
 
     return installable;
================================================================

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



More information about the pld-cvs-commit mailing list