minimal opens need to provide name index
authorewt <devnull@localhost>
Thu, 4 Feb 1999 22:04:10 +0000 (22:04 +0000)
committerewt <devnull@localhost>
Thu, 4 Feb 1999 22:04:10 +0000 (22:04 +0000)
CVS patchset: 2774
CVS date: 1999/02/04 22:04:10

lib/rpmdb.c

index b974882..0d3997c 100644 (file)
@@ -192,18 +192,18 @@ int openDatabase(const char * prefix, const char * dbpath, rpmdb *rpmdbp, int mo
        }
     }
 
-    if (minimal) {
-       *rpmdbp = malloc(sizeof(struct rpmdb_s));
-       **rpmdbp = db;
-       return 0;
-    }
-    
     rc = openDbFile(prefix, dbpath, "nameindex.rpm", justcheck, mode,
                    &db.nameIndex, DB_HASH);
     if (!rc)
        rc = openDbFile(prefix, dbpath, "fileindex.rpm", justcheck, mode,
                        &db.fileIndex, DB_HASH);
 
+    if (minimal) {
+       *rpmdbp = malloc(sizeof(struct rpmdb_s));
+       **rpmdbp = db;
+       return 0;
+    }
+
     /* We used to store the fileindexes as complete paths, rather then
        plain basenames. Let's see which version we are... */
     if (!justcheck && !dbiGetFirstKey(db.fileIndex, &akey)) {