Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Ok, start fetching packages with 'pkg fetch' :)
Marin Atanasov Nikolov committed 14 years ago
commit e783ed1afa101670b86577ad2ff87a2ba7a7e3ab
parent 8fb798d
6 files changed +15 -4
modified libpkg/pkg_jobs.c
@@ -294,6 +294,8 @@ pkg_jobs_apply(struct pkg_jobs *j, int force)
		return (pkg_jobs_install(j));
	if (j->type == PKG_JOBS_DEINSTALL)
		return (pkg_jobs_deinstall(j, force));
+
	if (j->type == PKG_JOBS_FETCH)
+
		return (pkg_jobs_fetch(j));

	pkg_emit_error("bad jobs argument");
	return (EPKG_FATAL);
modified pkg/delete.c
@@ -136,7 +136,7 @@ exec_delete(int argc, char **argv)

	pkg = NULL;
	if (!quiet) {
-
		print_jobs_summary(jobs, PKG_JOBS_DEINSTALL, "The following packages will be deinstalled:\n");
+
		print_jobs_summary(jobs, PKG_JOBS_DEINSTALL, "The following packages will be deinstalled:\n\n");

		if (!yes)
			pkg_config_bool(PKG_CONFIG_ASSUME_ALWAYS_YES, &yes);
modified pkg/fetch.c
@@ -118,6 +118,15 @@ exec_fetch(int argc, char **argv)
	if (pkg_jobs_is_empty(jobs))
		goto cleanup;

+
	if (!quiet) {
+
		print_jobs_summary(jobs, PKG_JOBS_FETCH, "The following packages will be fetched:\n\n");
+
		
+
		if (!yes)
+
			pkg_config_bool(PKG_CONFIG_ASSUME_ALWAYS_YES, &yes);
+
		if (!yes)
+
			yes = query_yesno("\nProceed with fetching packages [y/N]: ");
+
	}
+
	
	if (yes)
		if (pkg_jobs_apply(jobs, 0) != EPKG_OK)
			goto cleanup;
modified pkg/install.c
@@ -127,7 +127,7 @@ exec_install(int argc, char **argv)
	/* print a summary before applying the jobs */
	pkg = NULL;
	if (!quiet) {
-
		print_jobs_summary(jobs, PKG_JOBS_INSTALL, "The following packages will be installed:\n");
+
		print_jobs_summary(jobs, PKG_JOBS_INSTALL, "The following packages will be installed:\n\n");

		if (!yes)
			pkg_config_bool(PKG_CONFIG_ASSUME_ALWAYS_YES, &yes);
modified pkg/upgrade.c
@@ -114,7 +114,7 @@ exec_upgrade(int argc, char **argv)

	pkg = NULL;
	if (!quiet) {
-
		print_jobs_summary(jobs, PKG_JOBS_INSTALL, "The following packages will be upgraded:\n");
+
		print_jobs_summary(jobs, PKG_JOBS_INSTALL, "The following packages will be upgraded:\n\n");

		if (!yes)
			pkg_config_bool(PKG_CONFIG_ASSUME_ALWAYS_YES, &yes);
modified pkg/utils.c
@@ -383,6 +383,6 @@ print_jobs_summary(struct pkg_jobs *jobs, pkg_jobs_t type, const char *msg, ...)

	if ((type == PKG_JOBS_INSTALL) || (type == PKG_JOBS_FETCH)) {
		humanize_number(size, sizeof(size), dlsize, "B", HN_AUTOSCALE, 0);
-
		printf("%s to be downloaded\n", size);
+
		printf("\n%s to be downloaded\n", size);
	}
}