Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
pkg-check: Add -v to show what's being done
Bryan Drewery committed 14 years ago
commit ddd89f7afb4e8e439636cbb7e640a7ae1309bfad
parent 379eb39
2 files changed +25 -6
modified pkg/check.c
@@ -250,7 +250,7 @@ check_summary(struct pkgdb *db, struct deps_head *dh)
void
usage_check(void)
{
-
	fprintf(stderr, "usage: pkg check [-dsr] [-y] [-a | -gxX <pattern>]\n");
+
	fprintf(stderr, "usage: pkg check [-dsr] [-vy] [-a | -gxX <pattern>]\n");
	fprintf(stderr, "\nFor more information see 'pkg help check'.\n");
}

@@ -273,10 +273,11 @@ exec_check(int argc, char **argv)
	int64_t flatsize;
	int64_t newflatsize;
	int i;
+
	int verbose = 0;

	struct deps_head dh = STAILQ_HEAD_INITIALIZER(dh);

-
	while ((ch = getopt(argc, argv, "yagdxXsr")) != -1) {
+
	while ((ch = getopt(argc, argv, "yagdxXsrv")) != -1) {
		switch (ch) {
			case 'a':
				match = MATCH_ALL;
@@ -307,6 +308,9 @@ exec_check(int argc, char **argv)
				if (geteuid() != 0)
					errx(EX_USAGE, "Needs to be root to recompute the flatsize");
				break;
+
			case 'v':
+
				verbose = 1;
+
				break;
			default:
				usage_check();
				return (EX_USAGE);
@@ -341,13 +345,26 @@ exec_check(int argc, char **argv)
			return (EX_IOERR);
		}

-
		/* check for missing dependencies */
		while (pkgdb_it_next(it, &pkg, flags) == EPKG_OK) {
-
			if (dcheck)
+
			const char *pkgname = NULL;
+
			pkg_get(pkg, PKG_NAME, &pkgname);
+
			/* check for missing dependencies */
+
			if (dcheck) {
+
				if (verbose) {
+
					printf("Checking dependencies: %s\n", pkgname);
+
				}
				nbpkgs += check_deps(db, pkg, &dh);
-
			if (checksums)
+
			}
+
			if (checksums) {
+
				if (verbose) {
+
					printf("Checking checksums: %s\n", pkgname);
+
				}
				pkg_test_filesum(pkg);
+
			}
			if (recomputeflatsize) {
+
				if (verbose) {
+
					printf("Recomputing size: %s\n", pkgname);
+
				}
				newflatsize = pkg_recompute_flatsize(pkg);
				pkg_get(pkg, PKG_FLATSIZE, &flatsize);
				if (newflatsize != flatsize)
modified pkg/pkg-check.8
@@ -24,7 +24,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl dsr
-
.Op Fl y
+
.Op Fl vy
.Op Fl a | gxX Ar <pattern>
.Sh DESCRIPTION
.Nm
@@ -44,6 +44,8 @@ The following options are supported by
.Bl -tag -width F1
.It Fl y
Assume yes when asked for confirmation before installing missing dependencies.
+
.It Fl v
+
Be verbose.
.It Fl a
Process all packages.
.It Fl g