Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Abide by ASSUME_ALWAYS_YES in pkg.conf
Matthew Seaman committed 13 years ago
commit 69f28c0871dddf73eab1dd05e2423b681d8fb53c
parent 0acd604
2 files changed +26 -23
modified pkg/lock.c
@@ -48,10 +48,10 @@ static bool yes = false; /* Assume yes answer to questions */
void
usage_lock(void)
{
-
	fprintf(stderr, "usage: pkg lock [-gxXyq] <pkg-name>\n");
-
	fprintf(stderr, "       pkg lock [-yq] -a\n");
-
	fprintf(stderr, "       pkg unlock [-gxXyq] <pkg-name>\n");
-
	fprintf(stderr, "       pkg unlock [-yq] -a\n");
+
	fprintf(stderr, "usage: pkg lock [-gqXxy] <pkg-name>\n");
+
	fprintf(stderr, "       pkg lock [-qy] -a\n");
+
	fprintf(stderr, "       pkg unlock [-gqXxy] <pkg-name>\n");
+
	fprintf(stderr, "       pkg unlock [-qy] -a\n");
	fprintf(stderr, "For more information see 'pkg help lock'.\n");
}

@@ -131,7 +131,9 @@ exec_lock_unlock(int argc, char **argv, enum action action)
	int exitcode = EX_OK;
	int ch;

-
	while ((ch = getopt(argc, argv, "agxXyq")) != -1) {
+
	pkg_config_bool(PKG_CONFIG_ASSUME_ALWAYS_YES, &yes);
+

+
	while ((ch = getopt(argc, argv, "agqXxy")) != -1) {
		switch (ch) {
		case 'a':
			match = MATCH_ALL;
@@ -139,18 +141,18 @@ exec_lock_unlock(int argc, char **argv, enum action action)
		case 'g':
			match = MATCH_GLOB;
			break;
-
		case 'x':
-
			match = MATCH_REGEX;
+
		case 'q':
+
			quiet = true;
			break;
		case 'X':
			match = MATCH_EREGEX;
			break;
+
		case 'x':
+
			match = MATCH_REGEX;
+
			break;
		case 'y':
			yes = true;
			break;
-
		case 'q':
-
			quiet = true;
-
			break;
		default:
			usage_lock();
			return (EX_USAGE);
modified pkg/pkg-lock.8
@@ -24,16 +24,16 @@
.Nd lock or unlock packages
.Sh SYNOPSIS
.Nm
-
.Op Fl yq
+
.Op Fl qy
.Fl a
.Nm
-
.Op Fl gxXyq
+
.Op Fl gqXxy
.Ar <pkg-name>
.Nm "pkg unlock"
-
.Op Fl yq
+
.Op Fl qy
.Fl a
.Nm "pkg unlock"
-
.Op Fl gxXyq
+
.Op Fl gqXxy
.Ar <pkg-name>
.Sh DESCRIPTION
.Nm
@@ -72,22 +72,22 @@ The following options are supported by
.Bl -tag -width F1
.It Fl a
Lock or unlock all installed packages.
-
.It Fl q
-
Operate quietly: do not output anything other than confirmatory questions.
-
.It Fl y
-
Assume "yes" as the answer to all questions.
.It Fl g
Treat
.Ar <pkg-name>
as a shell glob pattern.
-
.It Fl x
-
Treat
-
.Ar <pkg-name>
-
as a regular expression.
+
.It Fl q
+
Operate quietly: do not output anything other than confirmatory questions.
.It Fl X
Treat
.Ar <pkg-name>
as an extended regular expression.
+
.It Fl x
+
Treat
+
.Ar <pkg-name>
+
as a regular expression.
+
.It Fl y
+
Assume "yes" as the answer to all questions.
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of
@@ -96,7 +96,8 @@ See
.Xr pkg.conf 5
for further description.
.Bl -tag -width ".Ev NO_DESCRIPTIONS"
-
.It PKG_DBDIR
+
.It Ev PKG_DBDIR
+
.It Ev ASSUME_ALWAYS_YES
.El
.Sh FILES
See