Skip to content

Commit

Permalink
Fix pkg check -da crash when no repo.sqlite found
Browse files Browse the repository at this point in the history
  • Loading branch information
bdrewery committed Jun 14, 2012
1 parent 405593d commit 00975f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/check.c
Expand Up @@ -143,7 +143,7 @@ fix_deps(struct pkgdb *db, struct deps_head *dh, int nbpkgs, bool yes)
pkgs[i++] = e->origin;

if (pkgdb_open(&db, PKGDB_REMOTE) != EPKG_OK)
return (EPKG_FATAL);
return (EPKG_ENODB);

if (pkg_jobs_new(&jobs, PKG_JOBS_INSTALL, db) != EPKG_OK)
free(pkgs);
Expand Down Expand Up @@ -345,6 +345,10 @@ exec_check(int argc, char **argv)
ret = fix_deps(db, &dh, nbpkgs, yes);
if (ret == EPKG_OK)
check_summary(db, &dh);
else if (ret == EPKG_ENODB) {
db = NULL;
return (EX_IOERR);
}
}
pkgdb_it_free(it);
i++;
Expand Down

0 comments on commit 00975f3

Please sign in to comment.