poldek: poldek/pkgcmp.c, poldek/pkgcmp.h - rpm ignores package arc...

mis mis at pld-linux.org
Sun Jan 27 19:42:19 CET 2008


Author: mis                          Date: Sun Jan 27 18:42:19 2008 GMT
Module: poldek                        Tag: HEAD
---- Log message:
- rpm ignores package arch in multilib mode

---- Files affected:
poldek/poldek:
   pkgcmp.c (1.11 -> 1.12) , pkgcmp.h (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: poldek/poldek/pkgcmp.c
diff -u poldek/poldek/pkgcmp.c:1.11 poldek/poldek/pkgcmp.c:1.12
--- poldek/poldek/pkgcmp.c:1.11	Wed Jun 20 10:33:40 2007
+++ poldek/poldek/pkgcmp.c	Sun Jan 27 19:42:14 2008
@@ -38,6 +38,7 @@
 
 extern int poldek_conf_MULTILIB;
 
+/* same name && arch? */
 int pkg_is_kind_of(const struct pkg *candidate, const struct pkg *pkg)
 {
     register int rc = strcmp(pkg->name, candidate->name);
@@ -51,6 +52,7 @@
     return rc == 0;
 }
 
+#if 0 /* XXX: disabled, rpm relies on colors only */
 int pkg_is_colored_like(const struct pkg *candidate, const struct pkg *pkg)
 {
     int rc = -1;
@@ -63,10 +65,8 @@
 
     if (rc == -1 && pkg_cmp_arch(pkg, candidate) == 0) { /* no color? use arch */
         rc = 1;
-#if ENABLE_TRACE        
         DBGF("%s(c=%d), %s(c=%d) => YES\n", pkg_id(candidate),
              candidate->color, pkg_id(pkg), pkg->color);
-#endif
     }
 
     if (rc == -1)
@@ -74,7 +74,22 @@
     
     return rc;
 }
+#endif
+
+int pkg_is_colored_like(const struct pkg *candidate, const struct pkg *pkg)
+{
+    if (!poldek_conf_MULTILIB)
+        return 1;
+    
+    if (pkg->color && candidate->color)
+        return pkg->color & candidate->color;
 
+    /* same name and candidate without color -> promote candidate */
+    if (pkg->color && pkg_is_kind_of(candidate, pkg)) 
+        return 1;
+
+    return 0;
+}
 
 int pkg_eq_capreq(const struct pkg *pkg, const struct capreq *cr) 
 {

================================================================
Index: poldek/poldek/pkgcmp.h
diff -u poldek/poldek/pkgcmp.h:1.6 poldek/poldek/pkgcmp.h:1.7
--- poldek/poldek/pkgcmp.h:1.6	Sun Jun 17 22:24:47 2007
+++ poldek/poldek/pkgcmp.h	Sun Jan 27 19:42:14 2008
@@ -14,7 +14,7 @@
 /* candidate in pkg's rainbow */
 int pkg_is_colored_like(const struct pkg *candidate, const struct pkg *pkg);
 
-/* same name && pkg_is_colored_like(candidate, pkg) */
+/* same name && arch */
 int pkg_is_kind_of(const struct pkg *candidate, const struct pkg *pkg);
 
 /* strncmp(p1->name, p2->name, strlen(p2->name)) */
================================================================

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



More information about the pld-cvs-commit mailing list