Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Improve output if no packages are going to be installed.
Vsevolod Stakhov committed 11 years ago
commit 9957ad859b58199f812bd668bdbaddf36cef21f3
parent e585bcf
2 files changed +8 -3
modified src/install.c
@@ -61,8 +61,9 @@ exec_install(int argc, char **argv)
	int		 updcode = EPKG_OK;
	int		 ch;
	int		 mode, repo_type;
+
	int		 done = 0;
	int		 lock_type = PKGDB_LOCK_ADVISORY;
-
	bool		 rc = false;
+
	bool		 rc = true;
	bool		 local_only = false;
	match_t		 match = MATCH_EXACT;
	pkg_flags	 f = PKG_FLAG_NONE | PKG_FLAG_PKG_VERSION_TEST;
@@ -221,8 +222,8 @@ exec_install(int argc, char **argv)
	if (pkg_jobs_solve(jobs) != EPKG_OK)
		goto cleanup;

-
	rc = yes;
	while ((nbactions = pkg_jobs_count(jobs)) > 0) {
+
		rc = yes;
		/* print a summary before applying the jobs */
		if (!quiet || dry_run) {
			print_jobs_summary(jobs,
@@ -240,6 +241,7 @@ exec_install(int argc, char **argv)

		if (rc) {
			retcode = pkg_jobs_apply(jobs);
+
			done = 1;
			if (retcode == EPKG_CONFLICT) {
				printf("Conflicts with the existing packages "
				    "have been found.\nOne more solver "
@@ -257,6 +259,9 @@ exec_install(int argc, char **argv)
		break;
	}

+
	if (done == 0 && rc)
+
		printf("The most recent version of packages are already installed\n");
+

	retcode = EX_OK;

cleanup:
modified src/upgrade.c
@@ -55,7 +55,7 @@ exec_upgrade(int argc, char **argv)
	int		 lock_type = PKGDB_LOCK_ADVISORY;
	match_t		 match = MATCH_EXACT;
	int		 done = 0;
-
	bool	rc = false;
+
	bool	rc = true;
	pkg_flags	 f = PKG_FLAG_NONE | PKG_FLAG_PKG_VERSION_TEST;

	struct option longopts[] = {