poldek: poldek/pkgdir/pkgdir_dirindex.c - dirindex without directo...

mis mis at pld-linux.org
Thu Jun 21 18:41:45 CEST 2007


Author: mis                          Date: Thu Jun 21 16:41:45 2007 GMT
Module: poldek                        Tag: HEAD
---- Log message:
- dirindex without directories may happen

---- Files affected:
poldek/poldek/pkgdir:
   pkgdir_dirindex.c (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: poldek/poldek/pkgdir/pkgdir_dirindex.c
diff -u poldek/poldek/pkgdir/pkgdir_dirindex.c:1.9 poldek/poldek/pkgdir/pkgdir_dirindex.c:1.10
--- poldek/poldek/pkgdir/pkgdir_dirindex.c:1.9	Wed Jun 20 19:11:43 2007
+++ poldek/poldek/pkgdir/pkgdir_dirindex.c	Thu Jun 21 18:41:40 2007
@@ -247,7 +247,7 @@
     struct tndb   *db;
     tn_buf        *nbuf;
     tn_hash       *path_index;
-    tn_array      *paths;
+    tn_array      *directories;
     tn_alloc      *na;
     struct vflock *lock;
     int           i;
@@ -297,22 +297,22 @@
     }
 
     /* store { path => packages_no[] } pairs */
-    paths = n_hash_keys(path_index);
-    msgn_i(3, 3, "Saving %d paths\n", n_array_size(paths));
+    directories = n_hash_keys(path_index);
+    msgn_i(3, 3, "Saving %d directories\n", n_array_size(directories));
      
-    for (i=0; i < n_array_size(paths); i++) {
-        const char *path = n_array_nth(paths, i);
+    for (i=0; i < n_array_size(directories); i++) {
+        const char *path = n_array_nth(directories, i);
         tn_array *ids = n_hash_get(path_index, path);
 
         n_buf_clean(nbuf);
         nbuf = dirarray_join(nbuf, ids, ":");
         
-        DBGF("%s %s\n", path,  n_buf_ptr(nbuf));
+        DBGF("%s %s\n", path, n_buf_ptr(nbuf));
         
         tndb_put(db, path, strlen(path), n_buf_ptr(nbuf), n_buf_size(nbuf));
     }
 
-    n_array_free(paths);
+    n_array_free(directories);
     n_buf_free(nbuf);
     n_hash_free(path_index);
     n_alloc_free(na);
@@ -378,6 +378,7 @@
     if (!tndb_it_rget(&it, key, &klen, (void**)&val, &vlen)) {
         logn(LOGERR, _("%s: invalid directory index"), tndb_path(db));
         nerr++;
+        //msgn_i(2, 4, "%s: empty directory index", tndb_path(db));
         goto l_end;
     }
 
@@ -401,8 +402,7 @@
             vlen_max = vlen;
         
         if (!tndb_it_rget(&it, key, &klen, (void**)&val, &vlen)) {
-            logn(LOGERR, _("%s: invalid directory index"), tndb_path(db));
-            nerr++;
+            /* EOF is possible - packages without files */
             goto l_end;
         }
     }
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/poldek/poldek/pkgdir/pkgdir_dirindex.c?r1=1.9&r2=1.10&f=u



More information about the pld-cvs-commit mailing list