Skip to content

Commit

Permalink
add more logic while processing EPKG_ENODB
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejzverev committed May 12, 2014
1 parent 2209fc9 commit 856c4da
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,21 @@ exec_search(int argc, char **argv)
}

ret = pkgdb_access(PKGDB_MODE_READ, PKGDB_DB_REPO);
if (ret == EPKG_ENOACCESS) {
switch(ret) {
case EPKG_ENOACCESS:
warnx("Insufficient privileges to query the package database");
return (EX_NOPERM);
} else if (ret != EPKG_OK)
case EPKG_ENODB:
if (!auto_update) {
warnx("Unable to open remote repository catalogues. Try running '%s update' first.", getprogname());
return (EX_IOERR);
}
break;
case EPKG_OK:
break;
default:
return (EX_IOERR);
}

/* first update the remote repositories if needed */
old_quiet = quiet;
Expand Down

0 comments on commit 856c4da

Please sign in to comment.