poldek: poldek/.cvsignore, poldek/ask.c, poldek/dbdep.c, poldek/db...

mis mis at pld-linux.org
Sun Jun 17 22:24:52 CEST 2007


Author: mis                          Date: Sun Jun 17 20:24:52 2007 GMT
Module: poldek                        Tag: HEAD
---- Log message:
- multilib support seems to work, not tested well however (thanks to arekm).
- code cleanups 

---- Files affected:
poldek/poldek:
   .cvsignore (1.14 -> 1.15) , ask.c (1.7 -> 1.8) , dbdep.c (1.18 -> 1.19) , dbdep.h (1.3 -> 1.4) , dbpkgset.c (1.12 -> 1.13) , fileindex.c (1.29 -> 1.30) , log.h (1.24 -> 1.25) , pkg.c (1.112 -> 1.113) , pkg.h (1.76 -> 1.77) , pkgcmp.c (1.8 -> 1.9) , pkgcmp.h (1.5 -> 1.6) , pkgset-req.c (1.47 -> 1.48) , pkgset.c (1.92 -> 1.93) , poldek_ts.c (1.61 -> 1.62) 
poldek/poldek/install:
   conflicts.c (1.3 -> 1.4) , icaps.c (1.3 -> 1.4) , ictx.h (1.4 -> 1.5) , install.c (1.5 -> 1.6) , mark.c (1.2 -> 1.3) , misc.c (1.6 -> 1.7) , obsoletes.c (1.7 -> 1.8) , requirements.c (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: poldek/poldek/.cvsignore
diff -u poldek/poldek/.cvsignore:1.14 poldek/poldek/.cvsignore:1.15
--- poldek/poldek/.cvsignore:1.14	Tue Nov  1 20:22:43 2005
+++ poldek/poldek/.cvsignore	Sun Jun 17 22:24:47 2007
@@ -19,8 +19,6 @@
 stamp-h
 stamp-h.in
 .deps
-poldek-*
-poldek
 rpmvercmp
 ccmalloc-log
 depcomp
@@ -35,6 +33,8 @@
 *.lo
 .libs
 *.la
+*.o
+*~
 *.spec
 libtool
 config.guess
@@ -42,3 +42,10 @@
 py-compile
 conf_sections.c
 NEWS
+core
+cli/poldek
+cli/poclidek_demo
+cli/test_cli
+vfile/test_vopen
+vfile/vfget
+vfile/test_vopen3
\ No newline at end of file

================================================================
Index: poldek/poldek/ask.c
diff -u poldek/poldek/ask.c:1.7 poldek/poldek/ask.c:1.8
--- poldek/poldek/ask.c:1.7	Thu Nov  3 01:16:58 2005
+++ poldek/poldek/ask.c	Sun Jun 17 22:24:47 2007
@@ -88,7 +88,7 @@
 
     i = 0;
     while(pkgs[i] != NULL && i < 24) {
-        msgn(-1, "%c) %s", 'a' + i, pkg_snprintf_s(pkgs[i]));
+        msgn(-1, "%c) %s", 'a' + i, pkg_id(pkgs[i]));
         *p++ = 'a' + i;
         i++;
     }

================================================================
Index: poldek/poldek/dbdep.c
diff -u poldek/poldek/dbdep.c:1.18 poldek/poldek/dbdep.c:1.19
--- poldek/poldek/dbdep.c:1.18	Thu Oct 13 17:39:27 2005
+++ poldek/poldek/dbdep.c	Sun Jun 17 22:24:47 2007
@@ -1,16 +1,19 @@
-/* 
-  Copyright (C) 2000 - 2002 Pawel A. Gajda (mis at k2.net.pl)
- 
+/*
+  Copyright (C) 2000 - 2007 Pawel A. Gajda (mis at pld-linux.org)
+
   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
-  published by the Free Software Foundation (see file COPYING for
-  details).
+  it under the terms of the GNU General Public License, version 2 as
+  published by the Free Software Foundation (see file COPYING for details).
 
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
 /*
   $Id$
-  Module used in pkgset-install.c only
+  Module to track dependencies during resolving them; used
+  by install/ subsys only
 */
 
 #ifdef HAVE_CONFIG_H
@@ -43,6 +46,8 @@
 #include "dbdep.h"
 #include "pkgfl.h"
 
+extern int poldek_conf_MULTILIB;
+
 static void db_dep_free_pkgs(struct db_dep *db_dep) 
 {
     if (db_dep->pkgs) {
@@ -83,7 +88,7 @@
     //}
     
     DBGF("%s requiredby=%s satisfiedby=%s [type=%s]\n", capreq_snprintf_s(req),
-         pkg_snprintf_s(pkg), spkg ? pkg_snprintf_s0(spkg) : "NONE",
+         pkg_id(pkg), spkg ? pkg_id(spkg) : "NONE",
          (flags & DBDEP_FOREIGN) ? "foreign" :
          (flags & DBDEP_DBSATISFIED) ? "db" : "UNKNOWN");
 
@@ -122,7 +127,7 @@
         new_dep = n_malloc(sizeof(*new_dep));
         new_dep->req = req;
         new_dep->spkg = spkg;
-        new_dep->pkgs = n_array_new(4, NULL, (tn_fn_cmp)pkg_cmp_name_evr);
+        new_dep->pkgs = n_array_new(4, NULL, (tn_fn_cmp)pkg_cmp_id);
         n_array_push(new_dep->pkgs, pkg);
         new_dep->flags = flags;
 
@@ -133,8 +138,46 @@
         
         n_list_push(l, new_dep);
     }
+    
+#if ENABLE_TRACE    
+    db_deps_dump(db_deph);
+#endif    
 }
 
+void db_deps_dump(const tn_hash *db_deph)
+{
+    tn_array *keys;
+    int i;
+
+    msgn(0, "db_deps DUMP");
+    keys = n_hash_keys(db_deph);
+    n_array_sort(keys);
+    
+    for (i=0; i<n_array_size(keys); i++) {
+        const char *key = n_array_nth(keys, i);
+        tn_list *l;
+
+        msgn_i(0, 2, "cap %s", key);
+        if ((l = n_hash_get(db_deph, key))) {
+            struct db_dep     *dep;
+            tn_list_iterator  it;
+            
+            n_list_iterator_start(l, &it);
+            while ((dep = n_list_iterator_get(&it))) {
+                int j;
+                
+                msgn_i(0, 4, "* %s, satisfiedby=%s",
+                       dep->req ? capreq_snprintf_s(dep->req) : "NULL",
+                       dep->spkg ? pkg_id(dep->spkg) : "NONE");
+                if (dep->pkgs)
+                    for (j=0; j<n_array_size(dep->pkgs); j++)
+                        msgn_i(0, 5, "- %s", pkg_id(n_array_nth(dep->pkgs, j)));
+            }
+        }
+    }
+}
+
+
 static
 void db_deps_remove_cap(tn_hash *db_deph, struct pkg *pkg,
                         struct capreq *cap, int requiredonly)
@@ -150,36 +193,47 @@
     n_list_iterator_start(l, &it);
     while ((dep = n_list_iterator_get(&it))) {
         DBGF("- %s (req=%s, pkg=%s)\n", capreq_snprintf_s(cap),
-             dep->req ? capreq_snprintf_s0(dep->req) : "none", pkg_snprintf_s(pkg));
+             dep->req ? capreq_snprintf_s0(dep->req) : "none", pkg_id(pkg));
         
         if (dep->req && cap_match_req(cap, dep->req, 1)) {
             int i, i_del = -1;
 
             if (!requiredonly) {
                 DBGF("rmcap %s (%s) %s!\n", capreq_snprintf_s(cap),
-                     capreq_snprintf_s0(dep->req), pkg_snprintf_s(pkg));
+                     capreq_snprintf_s0(dep->req), pkg_id(pkg));
                 dep->req = NULL;
                 db_dep_free_pkgs(dep);
                 continue;
             }
             
             DBGF("rmcap %s (%s) %s?\n", capreq_snprintf_s(cap),
-                 capreq_snprintf_s0(dep->req), pkg_snprintf_s(pkg));
+                 capreq_snprintf_s0(dep->req), pkg_id(pkg));
+#if ENABLE_TRACE            
+            pkgs_array_dump(dep->pkgs, "packages");
+#endif            
             
             for (i=0; i < n_array_size(dep->pkgs); i++) {
-                DBGF("  %s cmp %s\n", pkg_snprintf_s(n_array_nth(dep->pkgs, i)),
-                     pkg_snprintf_s0(pkg));
-                if (pkg_cmp_name_evr(n_array_nth(dep->pkgs, i), pkg) == 0) {
+                DBGF("  %s cmp %s\n", pkg_id(n_array_nth(dep->pkgs, i)),
+                     pkg_id(pkg));
+
+
+                if (pkg_cmp_id(n_array_nth(dep->pkgs, i), pkg) == 0) {
+                    n_assert(i_del == -1);
                     i_del = i;
+                    if (poldek_conf_MULTILIB &&
+                        !pkg_is_colored_like(n_array_nth(dep->pkgs, i), pkg))
+                        i_del = -1;
                 }
             }
             if (i_del >= 0) {
-                DBGF("rmcap %s (%s) %s!\n", capreq_snprintf_s(cap),
-                     capreq_snprintf_s0(dep->req), pkg_snprintf_s(pkg));
+                DBGF("  --> YES, rmcap %s (%s) %s!\n", capreq_snprintf_s(cap),
+                     capreq_snprintf_s0(dep->req), pkg_id(pkg));
                 n_array_remove_nth(dep->pkgs, i_del);
                 if (n_array_size(dep->pkgs) == 0) {
+                    DBGF(" cap %s COMPLETELY REMOVED\n", capreq_snprintf_s0(dep->req));
                     dep->req = NULL;
                     db_dep_free_pkgs(dep);
+
                 }
             }
         }
@@ -260,7 +314,7 @@
 {
     int i;
 
-    DBGF("%s\n", pkg_snprintf_s(pkg));
+    DBGF("%s\n", pkg_id(pkg));
     
     if (pkg->reqs == NULL)
         return;
@@ -275,35 +329,15 @@
 {
     int i;
 
-    DBGF("%s\n", pkg_snprintf_s(pkg));
+    DBGF("%s\n", pkg_id(pkg));
     remove_files(db_deph, pkg, load_full_fl);
     
     if (pkg->caps == NULL)
         return;
     
     for (i=0; i < n_array_size(pkg->caps); i++) {
-        struct capreq     *cap;
-        tn_list           *l;
-        tn_list_iterator  it;
-        struct db_dep     *dep;
-
-        
-        cap = n_array_nth(pkg->caps, i);
+        struct capreq     *cap = n_array_nth(pkg->caps, i);
         db_deps_remove_cap(db_deph, pkg, cap, 0);
-        continue;
-        
-        if ((l = n_hash_get(db_deph, capreq_name(cap))) == NULL)
-            continue;
-
-        n_list_iterator_start(l, &it);
-        while ((dep = n_list_iterator_get(&it))) {
-            if (dep->req && cap_match_req(cap, dep->req, 1)) {
-                DBGF("rmcap %s (%s)\n", capreq_snprintf_s(cap),
-                     capreq_snprintf_s0(dep->req));
-                dep->req = NULL;
-                db_dep_free_pkgs(dep);
-            }
-        }
     }
 }
 

================================================================
Index: poldek/poldek/dbdep.h
diff -u poldek/poldek/dbdep.h:1.3 poldek/poldek/dbdep.h:1.4
--- poldek/poldek/dbdep.h:1.3	Sun Feb  8 15:08:36 2004
+++ poldek/poldek/dbdep.h	Sun Jun 17 22:24:47 2007
@@ -32,4 +32,6 @@
 struct db_dep *db_deps_contains(tn_hash *db_deph, struct capreq *cap,
                                 unsigned flags);
 
+void db_deps_dump(const tn_hash *db_deph);
+
 #endif

================================================================
Index: poldek/poldek/dbpkgset.c
diff -u poldek/poldek/dbpkgset.c:1.12 poldek/poldek/dbpkgset.c:1.13
--- poldek/poldek/dbpkgset.c:1.12	Sun Aug 20 23:13:19 2006
+++ poldek/poldek/dbpkgset.c	Sun Jun 17 22:24:47 2007
@@ -34,6 +34,8 @@
 
 #define DBPKGSET_CHANGED (1 << 0)
 
+extern int poldek_conf_MULTILIB;
+
 struct dbpkg_set *dbpkg_set_new(void) 
 {
     struct dbpkg_set *dbpkg_set; 
@@ -71,8 +73,12 @@
 
     for (i=0; i<n_array_size(dbpkg_set->dbpkgs); i++) {
         struct pkg *dbpkg = n_array_nth(dbpkg_set->dbpkgs, i);
-        if (pkg_cmp_name_evr(dbpkg, pkg) == 0)
-            return 1;
+        if (pkg_cmp_name_evr(dbpkg, pkg) == 0) {
+            if (poldek_conf_MULTILIB)
+                return pkg_is_colored_like(dbpkg, pkg);
+            else
+                return 1;
+        }
     }
     return 0;
 }

================================================================
Index: poldek/poldek/fileindex.c
diff -u poldek/poldek/fileindex.c:1.29 poldek/poldek/fileindex.c:1.30
--- poldek/poldek/fileindex.c:1.29	Sun Aug 20 20:14:58 2006
+++ poldek/poldek/fileindex.c	Sun Jun 17 22:24:47 2007
@@ -32,6 +32,8 @@
 #include "fileindex.h"
 #include "pkgset-req.h"
 
+extern int poldek_conf_MULTILIB;
+
 struct file_ent {
     struct flfile *flfile;
     struct pkg *pkg;
@@ -374,8 +376,15 @@
         
     } else {
         int rc, added1 = 0, added2 = 0;
+        DBGF("add conflict between %s and %s based on %s\n",
+             pkg_id(ent1->pkg), pkg_id(ent2->pkg), path);
+
+        /* do not add conflicts in multilib mode, file colors are used (seems to) */
+        if (poldek_conf_MULTILIB) 
+            rc = 1;
+        else
+            rc = register_file_conflict(ent1->pkg, ent2->pkg, &added1, &added2);
         
-        rc = register_file_conflict(ent1->pkg, ent2->pkg, &added1, &added2);
         if (rc && (added1 || added2)) {
             cnfl = file_conflict_new(path, FILE_CONFLICT_CNFL);
 

================================================================
Index: poldek/poldek/log.h
diff -u poldek/poldek/log.h:1.24 poldek/poldek/log.h:1.25
--- poldek/poldek/log.h:1.24	Thu Oct 20 23:31:28 2005
+++ poldek/poldek/log.h	Sun Jun 17 22:24:47 2007
@@ -148,8 +148,8 @@
 void poldek_meminf(int vlevel, const char *fmt, ...);
 
 #if ENABLE_TRACE
-# define DBGF(fmt, args...)  fprintf(stdout, "%-18s: " fmt, __FUNCTION__ , ## args)
-# define DBG(fmt, args...)   fprintf(stdout, fmt, ## args)
+# define DBGF(fmt, args...)  fprintf(stdout, "dbg:%-18s: " fmt, __FUNCTION__ , ## args)
+# define DBG(fmt, args...)   fprintf(stdout, "dbg:" fmt, ## args)
 # define MEMINF(fmt, args...) poldek_meminf(-5, "%-18s: " fmt, __FUNCTION__ , ## args)
 # define DBGFIF(cond, fmt, args...) do { if (cond) { fprintf(stdout, "%-18s: " fmt, __FUNCTION__ , ## args); } } while (0)
 #else 
@@ -159,16 +159,11 @@
 # define DBGFIF(cond, fmt, args...)  ((void) 0)
 #endif
 
-#define DBGMSG_F DBGF
-#define DBGMSG   DBG
-
 #define DBGF_NULL(fmt, args...) ((void) 0)
-#define DBGF_F(fmt, args...) fprintf(stdout, "%-18s: " fmt, __FUNCTION__ , ## args)
+#define DBGF_F(fmt, args...) fprintf(stdout, "dbg:%-18s: " fmt, __FUNCTION__ , ## args)
+#define DBG_F(fmt, args...)   fprintf(stdout, "dbg:" fmt, ## args)
 #define MEMINF_F(fmt, args...) poldek_meminf(-5, "%-18s: " fmt, __FUNCTION__ , ## args)
 #define DBGFIF_F(cond, fmt, args...) do { if (cond) { fprintf(stdout, "%-18s: " fmt, __FUNCTION__ , ## args); } } while (0)
-
-#define dbgf(fmt, args...)  fprintf(stdout, "%-18s: " fmt, __FUNCTION__ , ## args)
-#define dbgf_(fmt, args...) ((void) 0)
 
 #endif /* POLDEK_LOG_H_INTERNAL */
 

================================================================
Index: poldek/poldek/pkg.c
diff -u poldek/poldek/pkg.c:1.112 poldek/poldek/pkg.c:1.113
--- poldek/poldek/pkg.c:1.112	Mon Sep 11 23:47:45 2006
+++ poldek/poldek/pkg.c	Sun Jun 17 22:24:47 2007
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2000 - 2006 Pawel A. Gajda (mis at k2.net.pl)
+  Copyright (C) 2000 - 2007 Pawel A. Gajda (mis at pld-linux.org)
 
   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
@@ -868,8 +868,7 @@
 {
     int n;
         
-    DBGMSG("\npkg_obs_match_pkg %s %s\n", pkg_snprintf_s(pkg),
-           pkg_snprintf_s0(opkg));
+    DBG("\npkg_obs_match_pkg %s %s\n", pkg_id(pkg), pkg_id(opkg));
     
     if (pkg->cnfls == NULL || n_array_size(pkg->cnfls) == 0)
         return 0;     /* not match */
@@ -884,8 +883,7 @@
         cnfl = n_array_nth(pkg->cnfls, n);
         
         if (capreq_is_obsl(cnfl) && pkg_match_req(opkg, cnfl, 1)) {
-            DBGMSG("chk%d (%s-%s-%s) -> match\n", n,
-                   capreq_snprintf_s(cnfl));
+            DBG("chk%d (%s-%s-%s) -> match\n", n, capreq_snprintf_s(cnfl));
             return 1;
         }
         n++;
@@ -898,21 +896,19 @@
                 continue;
             
             if (strcmp(capreq_name(cnfl), pkg->name) != 0) {
-                DBGMSG("chk%d %s -> NOT match IRET\n", i,
-                       capreq_snprintf_s(cnfl));
+                DBG("chk%d %s -> NOT match IRET\n", i, capreq_snprintf_s(cnfl));
                 return 0;
             }
                 
                 
             if (pkg_match_req(opkg, cnfl, 1)) {
-                DBGMSG("chk %s -> match\n", capreq_snprintf_s(cnfl));
+                DBG("chk %s -> match\n", capreq_snprintf_s(cnfl));
                 return 1;
             } else {
-                DBGMSG("chk%d %s -> NOT match\n", i,
-                       capreq_snprintf_s(cnfl));
+                DBG("chk%d %s -> NOT match\n", i, capreq_snprintf_s(cnfl));
             }
         }
-        DBGMSG("NONE\n");
+        DBG("NONE\n");
     }
     
     return 0;
@@ -921,7 +917,8 @@
 int pkg_add_pkgcnfl(struct pkg *pkg, struct pkg *cpkg, int isbastard)
 {
     struct capreq *cnfl = NULL;
-    
+
+    DBGF_F("%s %s%s", pkg_id(pkg), pkg_id(cpkg), isbastard ? " (bastard)" : "");
     if (n_array_bsearch_ex(pkg->cnfls, cpkg->name,
                            (tn_fn_cmp)capreq_cmp2name) == NULL) {
         cnfl = capreq_new(pkg->na, cpkg->name, cpkg->epoch, cpkg->ver,
@@ -1310,13 +1307,27 @@
 {
     tn_array *arr;
 
-    if (cmpfn == NULL)
+    if (cmpfn == NULL) 
         cmpfn = pkg_cmp_name_evr_rev;
     
     arr = n_array_new(size, (tn_fn_free)pkg_free, (tn_fn_cmp)cmpfn);
     n_array_ctl(arr, TN_ARRAY_AUTOSORTED);
     return arr;
 }
+
+void pkgs_array_dump(tn_array *pkgs, const char *prefix) 
+{
+    int i;
+    
+    if (prefix == NULL)
+        prefix = "array";
+    
+    msg(0, "%s = [", prefix);
+    for (i=0; i<n_array_size(pkgs); i++)
+        msg(0, "%s, ", pkg_id(n_array_nth(pkgs, i)));
+    msgn(0, "]");
+}
+
 
 tn_array *pkgs_array_new(int size) 
 {

================================================================
Index: poldek/poldek/pkg.h
diff -u poldek/poldek/pkg.h:1.76 poldek/poldek/pkg.h:1.77
--- poldek/poldek/pkg.h:1.76	Sun Aug 20 20:14:58 2006
+++ poldek/poldek/pkg.h	Sun Jun 17 22:24:47 2007
@@ -255,6 +255,8 @@
 tn_array *pkgs_array_new_ex(int size,
                             int (*cmpfn)(const struct pkg *p1,
                                          const struct pkg *p2));
+void pkgs_array_dump(tn_array *pkgs, const char *prefix); /* for debugging */
+
 
 char *pkg_strsize(char *buf, int size, const struct pkg *pkg);
 char *pkg_strbtime(char *buf, int size, const struct pkg *pkg);

================================================================
Index: poldek/poldek/pkgcmp.c
diff -u poldek/poldek/pkgcmp.c:1.8 poldek/poldek/pkgcmp.c:1.9
--- poldek/poldek/pkgcmp.c:1.8	Sat Jun 16 19:03:22 2007
+++ poldek/poldek/pkgcmp.c	Sun Jun 17 22:24:47 2007
@@ -44,10 +44,8 @@
     
     if (rc == 0 && poldek_conf_MULTILIB) {
         rc = pkg_cmp_arch(pkg, candidate);
-#if ENABLE_TRACE        
-        if (rc == 0)
-            DBGF("%s, %s => YES\n", pkg_id(candidate), pkg_id(pkg));
-#endif        
+        //if (rc == 0)
+        //    DBGF_F("%s, %s => YES\n", pkg_id(candidate), pkg_id(pkg));
     }
     
     return rc == 0;
@@ -98,7 +96,7 @@
     if ((p2 = strchr(pkg2->name, '-')) == NULL)
         p2 = strchr(pkg2->name, '\0');
 
-    n = p1 - pkg1->name;
+n = p1 - pkg1->name;
     if (n - (p2 - pkg2->name) != 0)
         return 0;
 
@@ -115,6 +113,12 @@
     return strncmp(p1->name, p2->name, strlen(p2->name));
 }
 
+int pkg_cmp_id(const struct pkg *p1, const struct pkg *p2)
+{
+    return strcmp(pkg_id(p1), pkg_id(p2));
+}
+
+
 int pkg_cmp_ver(const struct pkg *p1, const struct pkg *p2) 
 {
     register int rc = 0;
@@ -160,7 +164,11 @@
     if ((rc = pkg_cmp_name(p1, p2)))
         return rc;
     
-    rc = -pkg_cmp_evr(p1, p2);
+    if ((rc = -pkg_cmp_evr(p1, p2)))
+        return rc;
+
+    if (poldek_conf_MULTILIB)
+        rc = -pkg_cmp_arch(p1, p2);
 
     //printf("cmp %s %s -> %d\n", pkg_snprintf_s(p1), pkg_snprintf_s0(p2), rc);
     return rc;
@@ -170,11 +178,12 @@
 {
     register int rc;
 
-    if ((rc = pkg_cmp_name_evr_rev(p1, p2)) == 0 && p1->pkgdir != p2->pkgdir)
-        rc = p1->pkgdir->pri - p2->pkgdir->pri;
-    
-    if (rc == 0)
+    if ((rc = pkg_cmp_name_evr_rev(p1, p2)) == 0)
         rc = -pkg_cmp_arch(p1, p2);
+    
+    if (rc == 0 && p1->pkgdir != p2->pkgdir)
+        rc = p1->pkgdir->pri - p2->pkgdir->pri;
+    //rc = -pkg_cmp_arch(p1, p2);
     return rc;
 }
 
@@ -243,6 +252,11 @@
 
 int pkg_cmp_arch(const struct pkg *p1, const struct pkg *p2) 
 {
+    /* just compare */
+    return p1->_arch - p2->_arch; /* same as strcmp(arch1, arch2),
+                                     _arch is an arch index */
+    
+    /* XXX: never reached, machine_score() disappeared since rpm4.4.7 */
     if (p1->_arch && p2->_arch) {
         int s1, s2;
         s1 = pkg_arch_score(p1);
@@ -252,17 +266,6 @@
     }
 
     return p1->_arch - p2->_arch; /*  */
-    
-#if 0    
-    if (p1->_arch && !p2->_arch)
-        return 10;
-    
-    if (!p1->_arch && p2->_arch)
-        return -10;
-#endif
-    
-    n_assert(0);
-    return 0;
 }
 
 

================================================================
Index: poldek/poldek/pkgcmp.h
diff -u poldek/poldek/pkgcmp.h:1.5 poldek/poldek/pkgcmp.h:1.6
--- poldek/poldek/pkgcmp.h:1.5	Thu Oct 20 17:48:27 2005
+++ poldek/poldek/pkgcmp.h	Sun Jun 17 22:24:47 2007
@@ -23,6 +23,10 @@
 /* strcmp(p1->name, p2->name) */
 extern__inline int pkg_cmp_name(const struct pkg *p1, const struct pkg *p2);
 
+/* strcmp(pkg_id(p1), pkg_id(p2) */
+extern__inline int pkg_cmp_id(const struct pkg *p1, const struct pkg *p2);
+
+
 /* versions only */
 int pkg_cmp_ver(const struct pkg *p1, const struct pkg *p2);
 /* EVR only */

================================================================
Index: poldek/poldek/pkgset-req.c
diff -u poldek/poldek/pkgset-req.c:1.47 poldek/poldek/pkgset-req.c:1.48
--- poldek/poldek/pkgset-req.c:1.47	Mon Jan  8 18:22:00 2007
+++ poldek/poldek/pkgset-req.c	Sun Jun 17 22:24:47 2007
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/poldek/poldek/.cvsignore?r1=1.14&r2=1.15&f=u
    http://cvs.pld-linux.org/poldek/poldek/ask.c?r1=1.7&r2=1.8&f=u
    http://cvs.pld-linux.org/poldek/poldek/dbdep.c?r1=1.18&r2=1.19&f=u
    http://cvs.pld-linux.org/poldek/poldek/dbdep.h?r1=1.3&r2=1.4&f=u
    http://cvs.pld-linux.org/poldek/poldek/dbpkgset.c?r1=1.12&r2=1.13&f=u
    http://cvs.pld-linux.org/poldek/poldek/fileindex.c?r1=1.29&r2=1.30&f=u
    http://cvs.pld-linux.org/poldek/poldek/log.h?r1=1.24&r2=1.25&f=u
    http://cvs.pld-linux.org/poldek/poldek/pkg.c?r1=1.112&r2=1.113&f=u
    http://cvs.pld-linux.org/poldek/poldek/pkg.h?r1=1.76&r2=1.77&f=u
    http://cvs.pld-linux.org/poldek/poldek/pkgcmp.c?r1=1.8&r2=1.9&f=u
    http://cvs.pld-linux.org/poldek/poldek/pkgcmp.h?r1=1.5&r2=1.6&f=u
    http://cvs.pld-linux.org/poldek/poldek/pkgset-req.c?r1=1.47&r2=1.48&f=u
    http://cvs.pld-linux.org/poldek/poldek/pkgset.c?r1=1.92&r2=1.93&f=u
    http://cvs.pld-linux.org/poldek/poldek/poldek_ts.c?r1=1.61&r2=1.62&f=u
    http://cvs.pld-linux.org/poldek/poldek/install/conflicts.c?r1=1.3&r2=1.4&f=u
    http://cvs.pld-linux.org/poldek/poldek/install/icaps.c?r1=1.3&r2=1.4&f=u
    http://cvs.pld-linux.org/poldek/poldek/install/ictx.h?r1=1.4&r2=1.5&f=u
    http://cvs.pld-linux.org/poldek/poldek/install/install.c?r1=1.5&r2=1.6&f=u
    http://cvs.pld-linux.org/poldek/poldek/install/mark.c?r1=1.2&r2=1.3&f=u
    http://cvs.pld-linux.org/poldek/poldek/install/misc.c?r1=1.6&r2=1.7&f=u
    http://cvs.pld-linux.org/poldek/poldek/install/obsoletes.c?r1=1.7&r2=1.8&f=u
    http://cvs.pld-linux.org/poldek/poldek/install/requirements.c?r1=1.5&r2=1.6&f=u



More information about the pld-cvs-commit mailing list