test: don't crash if the expected files are not there
parent
9cd57a8fc7
commit
034c02f0de
12
src/test.c
12
src/test.c
|
@ -104,16 +104,20 @@ static int test_main(void *pctx, struct apk_database *db, int argc, char **argv)
|
|||
/* load installed db */
|
||||
if (ctx->installed_db != NULL) {
|
||||
bs = apk_bstream_from_file(AT_FDCWD, ctx->installed_db);
|
||||
apk_db_index_read(db, bs, -1);
|
||||
bs->close(bs, NULL);
|
||||
if (bs != NULL) {
|
||||
apk_db_index_read(db, bs, -1);
|
||||
bs->close(bs, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* load additional indexes */
|
||||
if (ctx->repos) {
|
||||
for (i = 0; i < ctx->repos->num; i++) {
|
||||
bs = apk_bstream_from_file(AT_FDCWD, ctx->repos->item[i]);
|
||||
apk_db_index_read(db, bs, i);
|
||||
bs->close(bs, NULL);
|
||||
if (bs != NULL) {
|
||||
apk_db_index_read(db, bs, i);
|
||||
bs->close(bs, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue