perror("db_create");
exit(1);
}
- if (db->open(db, 0, dbpath, 0, DB_HASH, DB_RDONLY, 0664))
+ if (db->open(db, 0, "Name", 0, DB_UNKNOWN, DB_RDONLY, 0664))
{
perror("db->open var/lib/rpm/Name");
exit(1);
if ((flags & RPMDB_REPORT_PROGRESS) != 0)
count = count_headers(rootdir, dbenv);
- if (db->open(db, 0, dbpath, 0, DB_HASH, DB_RDONLY, 0664))
+ if (db->open(db, 0, "Packages", 0, DB_UNKNOWN, DB_RDONLY, 0664))
{
perror("db->open var/lib/rpm/Packages");
exit(1);
Id dircache[512];
memset(dircache, 0, sizeof(dircache));
- snprintf(dbpath, PATH_MAX, "%s/var/lib/rpm/Name", rootdir);
- if (db->open(db, 0, dbpath, 0, DB_HASH, DB_RDONLY, 0664))
+ if (db->open(db, 0, "Name", 0, DB_UNKNOWN, DB_RDONLY, 0664))
{
perror("db->open var/lib/rpm/Name");
exit(1);
perror("db_create");
exit(1);
}
- snprintf(dbpath, PATH_MAX, "%s/var/lib/rpm/Packages", rootdir);
- if (db->open(db, 0, dbpath, 0, DB_HASH, DB_RDONLY, 0664))
+ if (db->open(db, 0, "Packages", 0, DB_UNKNOWN, DB_RDONLY, 0664))
{
perror("db->open var/lib/rpm/Packages");
exit(1);
if (db->get(db, NULL, &dbkey, &dbdata, 0))
{
perror("db->get");
- fprintf(stderr, "corrupt rpm database\n");
+ fprintf(stderr, "corrupt rpm database, key %d not found\n", dbid);
+ fprintf(stderr, "please run 'rpm --rebuilddb' to recreate the database index files\n");
exit(1);
}
if (dbdata.size < 8)