Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Modify the logic so that dry_run disables auto_update as well. Means 'pkg update -n' as a mortal user will show available updates
Matthew Seaman committed 13 years ago
commit a318774b82d68508c287c8bed2efa850e847ddd9
parent 104fb1e
1 file changed +3 -2
modified pkg/upgrade.c
@@ -85,7 +85,7 @@ exec_upgrade(int argc, char **argv)
	argc -= optind;
	argv += optind;

-
	if ((!dry_run || auto_update) && geteuid() != 0) {
+
	if (!dry_run && geteuid() != 0) {
		warnx("Upgrading can only be done as root");
		return (EX_NOPERM);
	}
@@ -96,7 +96,8 @@ exec_upgrade(int argc, char **argv)
	}

	/* first update the remote repositories if needed */
-
	if (auto_update && (retcode = pkgcli_update(false)) != EPKG_OK)
+
	if (!dry_run && auto_update && 
+
	    (retcode = pkgcli_update(false)) != EPKG_OK)
		return (retcode);

	if (pkgdb_open(&db, PKGDB_REMOTE) != EPKG_OK) {