poldek: poldek/uninstall.c - fixed matching N-V-R (#5750)

mis mis at pld-linux.org
Sat Mar 18 18:03:54 CET 2006


Author: mis                          Date: Sat Mar 18 17:03:53 2006 GMT
Module: poldek                        Tag: HEAD
---- Log message:
- fixed matching N-V-R (#5750)

---- Files affected:
poldek/poldek:
   uninstall.c (1.38 -> 1.39) 

---- Diffs:

================================================================
Index: poldek/poldek/uninstall.c
diff -u poldek/poldek/uninstall.c:1.38 poldek/poldek/uninstall.c:1.39
--- poldek/poldek/uninstall.c:1.38	Sat Mar 18 16:18:04 2006
+++ poldek/poldek/uninstall.c	Sat Mar 18 18:03:48 2006
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2000 - 2005 Pawel A. Gajda <mis at k2.net.pl>
+  Copyright (C) 2000 - 2006 Pawel A. Gajda <mis at k2.net.pl>
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License, version 2 as
@@ -431,7 +431,8 @@
         } else {                /* with version */
             if (ts->getop(ts, POLDEK_OP_CAPLOOKUP)) {
                 if (pkg_xmatch_req(dbpkg, cr, POLDEK_MA_PROMOTE_REQEPOCH))
-                            matched = 1;
+                    matched = 1;
+                
             } else {
                 if (strcmp(dbpkg->name, capreq_name(cr)) == 0) {
                     DBGF("n (%s, %s) %d\n", dbpkg->name,
@@ -457,7 +458,8 @@
     return nmatches;
 }
 
-static int resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts, const char *mask)
+static int resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts,
+                           const char *mask)
 {
     char           *p;
     struct capreq  *cr, *cr_evr;
@@ -465,6 +467,7 @@
     
     cr = NULL; cr_evr = NULL;
 
+    DBGF("mask=%s\n", mask); 
     /* No EVR mask or empty EVR (last char '#') */
     if ((p = strchr(mask, '#')) == NULL || *(p + 1) == '\0') {
         if (p)
@@ -482,8 +485,10 @@
         *p = '\0';
         p++;
 
-        if (poldek_util_parse_evr(p, &epoch, &ver, &rel))
+        if (poldek_util_parse_evr(p, &epoch, &ver, &rel)) {
             cr = cr_evr = capreq_new(NULL, tmp, epoch, ver, rel, REL_EQ, 0);
+            DBGF("cap=%s\n", capreq_snprintf_s(cr)); 
+        }
     }
     
     if (do_resolve_package(uctx, ts, mask, cr))
@@ -532,7 +537,6 @@
                     int32_t e = 0;
 
                     n_strdupap(mask, &tmp);
-                    
                     if (poldek_util_parse_nevr(tmp, &n, &e, &v, &r)) {
                         if (e)
                             n_snprintf(nmask, sizeof(nmask), "%s#%d:%s-%s", n, e, v, r);
@@ -541,7 +545,7 @@
 
                         msgn(2, "    Trying %s\n", nmask);
                         DBGF("try %s => %s (%s, %s, %s)\n", mask, nmask, n, v, r);
-                        matched = resolve_package(uctx, ts, tmp);
+                        matched = resolve_package(uctx, ts, nmask);
                     }
                 }
             }
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/poldek/poldek/uninstall.c?r1=1.38&r2=1.39&f=u



More information about the pld-cvs-commit mailing list