xbps-install(8): -n,--dry-run option does not need pkgdb write perms anymore.

This commit is contained in:
Juan RP
2014-04-18 09:06:53 +02:00
parent 1fb3c501ed
commit 1d74c1c144
2 changed files with 8 additions and 2 deletions

View File

@ -215,7 +215,7 @@ main(int argc, char **argv)
if (sync && !update && (argc == optind))
exit(EXIT_SUCCESS);
if ((rv = xbps_pkgdb_lock(&xh)) != 0) {
if (!drun && (rv = xbps_pkgdb_lock(&xh)) != 0) {
fprintf(stderr, "Failed to lock the pkgdb: %s\n", strerror(rv));
exit(rv);
}
@ -245,6 +245,8 @@ main(int argc, char **argv)
rv = exec_transaction(&xh, maxcols, yes, drun);
}
xbps_pkgdb_unlock(&xh);
if (!drun)
xbps_pkgdb_unlock(&xh);
exit(rv);
}