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