Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Generally add a -i option meaning 'case insensitive' which affects MATCH_EXACT and MATCH_REGEX match types.
Matthew Seaman committed 13 years ago
commit 252cfbbee8c6b06ca59e4b538c08e53e653ff4df
parent b958fab
22 files changed +160 -56
modified pkg/check.c
@@ -233,7 +233,7 @@ check_summary(struct pkgdb *db, struct deps_head *dh)
void
usage_check(void)
{
-
	fprintf(stderr, "usage: pkg check [-Bdsr] [-vy] [-a | -gx <pattern>]\n\n");
+
	fprintf(stderr, "usage: pkg check [-Bdsr] [-vy] [-a | -gix <pattern>]\n\n");
	fprintf(stderr, "For more information see 'pkg help check'.\n");
}

@@ -261,24 +261,11 @@ exec_check(int argc, char **argv)

	struct deps_head dh = STAILQ_HEAD_INITIALIZER(dh);

-
	while ((ch = getopt(argc, argv, "yagdBxsrv")) != -1) {
+
	while ((ch = getopt(argc, argv, "yagidBxsrv")) != -1) {
		switch (ch) {
		case 'a':
			match = MATCH_ALL;
			break;
-
		case 'x':
-
			match = MATCH_REGEX;
-
			break;
-
		case 'g':
-
			match = MATCH_GLOB;
-
			break;
-
		case 'y':
-
			yes = true;
-
			break;
-
		case 'd':
-
			dcheck = true;
-
			flags |= PKG_LOAD_DEPS;
-
			break;
		case 'B':
			pkg_config_bool(PKG_CONFIG_SHLIBS, &shlibs);
			if (!shlibs)
@@ -287,17 +274,33 @@ exec_check(int argc, char **argv)
			reanalyse_shlibs = true;
			flags |= PKG_LOAD_FILES;
			break;
-
		case 's':
-
			checksums = true;
-
			flags |= PKG_LOAD_FILES;
+
		case 'd':
+
			dcheck = true;
+
			flags |= PKG_LOAD_DEPS;
+
			break;
+
		case 'g':
+
			match = MATCH_GLOB;
+
			break;
+
		case 'i':
+
			pkgdb_set_case_sensitivity(false);
			break;
		case 'r':
			recompute = true;
			flags |= PKG_LOAD_FILES;
			break;
+
		case 's':
+
			checksums = true;
+
			flags |= PKG_LOAD_FILES;
+
			break;
		case 'v':
			verbose = 1;
			break;
+
		case 'x':
+
			match = MATCH_REGEX;
+
			break;
+
		case 'y':
+
			yes = true;
+
			break;
		default:
			usage_check();
			return (EX_USAGE);
modified pkg/delete.c
@@ -40,7 +40,7 @@
void
usage_delete(void)
{
-
	fprintf(stderr, "usage: pkg delete [-fgnqRxy] <pkg-name> ...\n");
+
	fprintf(stderr, "usage: pkg delete [-fginqRxy] <pkg-name> ...\n");
	fprintf(stderr, "       pkg delete [-nqy] -a\n\n");
	fprintf(stderr, "For more information see 'pkg help delete'.\n");
}
@@ -62,7 +62,7 @@ exec_delete(int argc, char **argv)

	pkg_config_bool(PKG_CONFIG_ASSUME_ALWAYS_YES, &yes);

-
	while ((ch = getopt(argc, argv, "afgnqRxy")) != -1) {
+
	while ((ch = getopt(argc, argv, "afginqRxy")) != -1) {
		switch (ch) {
		case 'a':
			match = MATCH_ALL;
@@ -74,6 +74,9 @@ exec_delete(int argc, char **argv)
		case 'g':
			match = MATCH_GLOB;
			break;
+
		case 'i':
+
			pkgdb_set_case_sensitivity(false);
+
			break;
		case 'n':
			f |= PKG_FLAG_DRY_RUN;
			dry_run = true;
modified pkg/fetch.c
@@ -42,7 +42,7 @@
void
usage_fetch(void)
{
-
	fprintf(stderr, "usage: pkg fetch [-r reponame] [-yqgxadL] <pkg-name> <...>\n\n");
+
	fprintf(stderr, "usage: pkg fetch [-r reponame] [-yqgixadL] <pkg-name> <...>\n\n");
	fprintf(stderr, "For more information see 'pkg help fetch'.\n");
}

@@ -64,7 +64,7 @@ exec_fetch(int argc, char **argv)
	pkg_config_bool(PKG_CONFIG_REPO_AUTOUPDATE, &auto_update);
	pkg_config_bool(PKG_CONFIG_ASSUME_ALWAYS_YES, &yes);

-
	while ((ch = getopt(argc, argv, "ygxr:qaLd")) != -1) {
+
	while ((ch = getopt(argc, argv, "ygixr:qaLd")) != -1) {
		switch (ch) {
		case 'y':
			yes = true;
@@ -75,6 +75,9 @@ exec_fetch(int argc, char **argv)
		case 'g':
			match = MATCH_GLOB;
			break;
+
		case 'i':
+
			pkgdb_set_case_sensitivity(false);
+
			break;
		case 'x':
			match = MATCH_REGEX;
			break;
modified pkg/info.c
@@ -50,7 +50,7 @@ usage_info(void)
{
	fprintf(stderr, "usage: pkg info <pkg-name>\n");
	fprintf(stderr, "       pkg info -a\n");
-
	fprintf(stderr, "       pkg info [-BDdefgIklOqRrsx] <pkg-name>\n");
+
	fprintf(stderr, "       pkg info [-BDdefgiIklOqRrsx] <pkg-name>\n");
	fprintf(stderr, "       pkg info [-BDdfIlqRrs] -F <pkg-file>\n\n");
	fprintf(stderr, "For more information see 'pkg help info'.\n");
}
@@ -83,7 +83,7 @@ exec_info(int argc, char **argv)
	bool origin_search = false;

	/* TODO: exclusive opts ? */
-
	while ((ch = getopt(argc, argv, "aDegxEIdrklBsqopOfF:R")) != -1) {
+
	while ((ch = getopt(argc, argv, "aDegixEIdrklBsqopOfF:R")) != -1) {
		switch (ch) {
		case 'a':
			match = MATCH_ALL;
@@ -98,6 +98,9 @@ exec_info(int argc, char **argv)
		case 'g':
			match = MATCH_GLOB;
			break;
+
		case 'i':
+
			pkgdb_set_case_sensitivity(false);
+
			break;
		case 'x':
			match = MATCH_REGEX;
			break;
modified pkg/install.c
@@ -45,7 +45,7 @@ void
usage_install(void)
{
	fprintf(stderr,
-
	    "usage: pkg install [-AfgLnqRxy] [-r reponame] <pkg-name> ...\n\n");
+
	    "usage: pkg install [-AfgiLnqRxy] [-r reponame] <pkg-name> ...\n\n");
	fprintf(stderr, "For more information see 'pkg help install'.\n");
}

@@ -68,7 +68,7 @@ exec_install(int argc, char **argv)
	pkg_config_bool(PKG_CONFIG_ASSUME_ALWAYS_YES, &yes);
	pkg_config_bool(PKG_CONFIG_REPO_AUTOUPDATE, &auto_update);

-
	while ((ch = getopt(argc, argv, "AfgLnqRr:xy")) != -1) {
+
	while ((ch = getopt(argc, argv, "AfgiLnqRr:xy")) != -1) {
		switch (ch) {
		case 'A':
			f |= PKG_FLAG_AUTOMATIC;
@@ -79,6 +79,9 @@ exec_install(int argc, char **argv)
		case 'g':
			match = MATCH_GLOB;
			break;
+
		case 'i':
+
			pkgdb_set_case_sensitivity(false);
+
			break;
		case 'L':
			auto_update = false;
			break;
modified pkg/lock.c
@@ -48,9 +48,9 @@ static bool yes = false; /* Assume yes answer to questions */
void
usage_lock(void)
{
-
	fprintf(stderr, "usage: pkg lock [-gqxy] <pkg-name>\n");
+
	fprintf(stderr, "usage: pkg lock [-giqxy] <pkg-name>\n");
	fprintf(stderr, "       pkg lock [-qy] -a\n");
-
	fprintf(stderr, "       pkg unlock [-gqxy] <pkg-name>\n");
+
	fprintf(stderr, "       pkg unlock [-giqxy] <pkg-name>\n");
	fprintf(stderr, "       pkg unlock [-qy] -a\n");
	fprintf(stderr, "For more information see 'pkg help lock'.\n");
}
@@ -137,7 +137,7 @@ exec_lock_unlock(int argc, char **argv, enum action action)

	pkg_config_bool(PKG_CONFIG_ASSUME_ALWAYS_YES, &yes);

-
	while ((ch = getopt(argc, argv, "agqxy")) != -1) {
+
	while ((ch = getopt(argc, argv, "agiqxy")) != -1) {
		switch (ch) {
		case 'a':
			match = MATCH_ALL;
@@ -145,6 +145,9 @@ exec_lock_unlock(int argc, char **argv, enum action action)
		case 'g':
			match = MATCH_GLOB;
			break;
+
		case 'i':
+
			pkgdb_set_case_sensitivity(false);
+
			break;
		case 'q':
			quiet = true;
			break;
modified pkg/pkg-check.8
@@ -25,7 +25,7 @@
.Nm
.Op Fl Bdsr
.Op Fl vy
-
.Op Fl a | gx Ar <pattern>
+
.Op Fl a | gix Ar <pattern>
.Sh DESCRIPTION
.Nm
.Fl B
@@ -55,6 +55,12 @@ Assume yes when asked for confirmation before installing missing dependencies.
Be verbose.
.It Fl a
Process all packages.
+
.It Fl i
+
Make the standard or regular expression 
+
.Fl ( x )
+
matching against
+
.Ar pattern
+
case insensitive.
.It Fl g
Treat
.Ar <pattern>
modified pkg/pkg-delete.8
@@ -23,7 +23,7 @@
.Nd deletes packages from the database and the system
.Sh SYNOPSIS
.Nm
-
.Op Fl fgnqRxy
+
.Op Fl fginqRxy
.Ar <pkg-name> ...
.Nm
.Op Fl nqy
@@ -59,6 +59,12 @@ Deletes all installed packages from the system and empties the database.
Forces packages to be removed despite leaving unresolved dependencies.
.It Fl g
Treat the package names as shell glob patterns.
+
.It Fl i
+
Make the standard or regular expression
+
.Fl ( x )
+
matching against
+
.Ar pkg-name
+
case insensitive.
.It Fl n
Dry run mode.
The list of packages to delete is always printed, but no packages are
modified pkg/pkg-fetch.8
@@ -24,7 +24,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl r Ar reponame
-
.Op Fl yqgxadL
+
.Op Fl yqgixadL
.Ar <pkg-name>
.Op ...
.Sh DESCRIPTION
@@ -59,6 +59,12 @@ See
Treat
.Ar <pkg-name>
as a shell glob pattern.
+
.It Fl i
+
Make the standard or regular expression
+
.Fl ( x )
+
matching against
+
.Ar pkg-name
+
case insensitive.
.It Fl x
Treat
.Ar <pkg-name>
modified pkg/pkg-info.8
@@ -27,7 +27,7 @@
.Nm
.Fl a
.Nm
-
.Op Fl BDdefgIklOqRrsx
+
.Op Fl BDdefgiIklOqRrsx
.Ar <pkg-name>
.Nm
.Op Fl BDdfIlqRrs
@@ -58,6 +58,11 @@ Show the pkg-message for matching packages.
Treat
.Ar <pkg-name>
as a shell glob pattern.
+
.It Fl i
+
Make the default or the regular expression
+
.Fl ( x )
+
.Ar pkg-name
+
matching case insensitive.
.It Fl x
Treat
.Ar <pkg-name>
modified pkg/pkg-install.8
@@ -23,7 +23,7 @@
.Nd installs packages from remote package repositories
.Sh SYNOPSIS
.Nm
-
.Op Fl AfgLnqRxy
+
.Op Fl AfgiLnqRxy
.Op Fl r Ar reponame
.Ar <pkg-origin> ...
.Sh DESCRIPTION
@@ -115,6 +115,12 @@ For more information please refer to
Force the reinstallation of the package if already installed.
.It Fl g
Treat the package names as shell glob patterns.
+
.It Fl i
+
Make the standard or the regular expression
+
.Fl ( x )
+
matching against
+
.Ar pkg-name
+
case insensitive.
.It Fl L
Skip updating the repository catalogues with
.Xr pkg-update 8 .
modified pkg/pkg-lock.8
@@ -27,13 +27,13 @@
.Op Fl qy
.Fl a
.Nm
-
.Op Fl gqxy
+
.Op Fl giqxy
.Ar <pkg-name>
.Nm "pkg unlock"
.Op Fl qy
.Fl a
.Nm "pkg unlock"
-
.Op Fl gqxy
+
.Op Fl giqxy
.Ar <pkg-name>
.Sh DESCRIPTION
.Nm
@@ -76,6 +76,11 @@ Lock or unlock all installed packages.
Treat
.Ar <pkg-name>
as a shell glob pattern.
+
.It Fl i
+
Make the default or the regular expression
+
.Fl ( x )
+
.Ar pkg-name
+
matching case insensitive.
.It Fl q
Operate quietly: do not output anything other than confirmatory questions.
.It Fl x
modified pkg/pkg-query.8
@@ -32,7 +32,7 @@
.Nm
.Fl e Ao evaluation-condition Ac Ao query-format Ac
.Nm
-
.Op Fl gx
+
.Op Fl gix
.Ao query-format Ac Ao pattern Ac Ao ... Ac
.Sh DESCRIPTION
.Nm
@@ -50,6 +50,12 @@ See EVALUATION FORMAT for details.
.It Fl F Ar pkg-name
Display information only for the package file
.Ar pkg-name
+
.It Fl i
+
Make the standard or regular expression
+
.Fl ( x )
+
matching against
+
.Ar pkg-name
+
case insensitive.
.It Fl g
Treat
.Ao pattern Ac
modified pkg/pkg-rquery.8
@@ -33,7 +33,7 @@
.Op Fl r Ar reponame
.Ao query-format Ac
.Nm
-
.Op Fl gx
+
.Op Fl gix
.Op Fl r Ar reponame
.Ao query-format Ac Ao pattern Ac Ao ... Ac
.Sh DESCRIPTION
@@ -59,6 +59,12 @@ See
Treat
.Ao pattern Ac
as a glob pattern.
+
.It Fl i
+
Make the standard or regular expression
+
.Fl ( x )
+
matching against
+
.Ar pkg-name
+
case insensitive.
.It Fl x
Treat
.Ao pattern Ac
modified pkg/pkg-search.8
@@ -23,14 +23,14 @@
.Nd search package repository catalogues
.Sh SYNOPSIS
.Nm
-
.Op Fl egx
+
.Op Fl egix
.Op Fl r Ar repo
.Op Fl S Ar search
.Op Fl L Ar label
.Op Fl Q Ar query-modifier
.Ar pattern
.Nm
-
.Op Fl cDdefgopqx
+
.Op Fl cDdefgiopqx
.Op Fl r Ar repo
.Ar pattern
.Sh DESCRIPTION
@@ -83,6 +83,14 @@ Treat
.Ar pattern
as a shell globbing expression.
The glob pattern must match the entire field being seached.
+
.It Fl i
+
Make the exact
+
.Fl ( e )
+
or regular expression
+
.Fl ( x )
+
matching against
+
.Ar pattern
+
case insensitive.
.It Fl L Ar label
Select which identifying label is printed for each matched package,
unless
modified pkg/pkg-set.8
@@ -27,7 +27,7 @@
.Op Fl A Op Ar 01
.Op Fl o Ar <oldorigin>:<neworigin>
.Op Fl y
-
.Op Fl gx
+
.Op Fl gix
.Ar <pkg-name>
.Sh DESCRIPTION
.Nm
@@ -45,7 +45,15 @@ This affects the operation of
.It Fl a
Match all installed packages.
.It Fl g
-
Match pkg-name as a globbing expression
+
Match
+
.Ar pkg-name
+
as a globbing expression.
+
.It Fl i
+
Make the standard or regular expression
+
.Fl ( x )
+
matching against
+
.Ar pkg-name
+
case insensitive.
.It Fl o Op <oldorigin>:<neworigin>
Change the port origin of a given dependency from
.Ar oldorigin
@@ -61,8 +69,9 @@ Also see
and
.Sx EXAMPLES .
.It Fl x
-
Match pkg-name as a regular expression according to the "modern" or
-
"extended" syntax of
+
Match
+
.Ar pkg-name
+
as a regular expression according to the "modern" or "extended" syntax of
.Xr re_format 7 .
.It Fl y
Assume yes rather than asking for confirmation before package autoremoval.
modified pkg/pkg-version.8
@@ -27,7 +27,7 @@
.Op Fl hoqvU
.Op Fl l Ar limchar
.Op Fl L Ar limchar
-
.Op Fl xge Ar pattern
+
.Op Fl egix Ar pattern
.Op Fl r Ar reponame
.Op Fl O Ar origin
.Op Ar index
@@ -118,6 +118,14 @@ flag.
Displays the packages which status flag does not match the one
specified by
.Ar limchar
+
.It Fl i
+
Make the exact
+
.Fl ( e )
+
or regular expression
+
.Fl ( x )
+
matching against
+
.Ar pattern
+
case insensitive.
.It Fl x Ar pattern
Only display the packages that match the regular expression.
Uses the "modern" or "extended" syntax of
modified pkg/query.c
@@ -805,7 +805,7 @@ usage_query(void)
	fprintf(stderr, "       pkg query [-a] <query-format>\n");
	fprintf(stderr, "       pkg query -F <pkg-name> <query-format>\n");
	fprintf(stderr, "       pkg query -e <evaluation> <query-format>\n");
-
	fprintf(stderr, "       pkg query [-gx] <query-format> <pattern> <...>\n\n");
+
	fprintf(stderr, "       pkg query [-gix] <query-format> <pattern> <...>\n\n");
	fprintf(stderr, "For more information see 'pkg help query.'\n");
}

@@ -827,7 +827,7 @@ exec_query(int argc, char **argv)
	struct sbuf *sqlcond = NULL;
	const unsigned int q_flags_len = (sizeof(accepted_query_flags)/sizeof(accepted_query_flags[0]));

-
	while ((ch = getopt(argc, argv, "agxF:e:")) != -1) {
+
	while ((ch = getopt(argc, argv, "agixF:e:")) != -1) {
		switch (ch) {
		case 'a':
			match = MATCH_ALL;
@@ -835,6 +835,9 @@ exec_query(int argc, char **argv)
		case 'g':
			match = MATCH_GLOB;
			break;
+
		case 'i':
+
			pkgdb_set_case_sensitivity(false);
+
			break;
		case 'x':
			match = MATCH_REGEX;
			break;
modified pkg/rquery.c
@@ -70,7 +70,7 @@ usage_rquery(void)
	fprintf(stderr, "usage: pkg rquery [-r reponame] <query-format> <pkg-name>\n");
	fprintf(stderr, "       pkg rquery [-a] [-r reponame] <query-format>\n");
	fprintf(stderr, "       pkg rquery -e <evaluation> [-r reponame] <query-format>\n");
-
	fprintf(stderr, "       pkg rquery [-gx] [-r reponame] <query-format> <pattern> <...>\n\n");
+
	fprintf(stderr, "       pkg rquery [-gix] [-r reponame] <query-format> <pattern> <...>\n\n");
	fprintf(stderr, "For more information see 'pkg help rquery.'\n");
}

@@ -94,7 +94,7 @@ exec_rquery(int argc, char **argv)
	const char *reponame = NULL;
	bool onematched = false;

-
	while ((ch = getopt(argc, argv, "agxe:r:")) != -1) {
+
	while ((ch = getopt(argc, argv, "agixe:r:")) != -1) {
		switch (ch) {
		case 'a':
			match = MATCH_ALL;
@@ -102,6 +102,9 @@ exec_rquery(int argc, char **argv)
		case 'g':
			match = MATCH_GLOB;
			break;
+
		case 'i':
+
			pkgdb_set_case_sensitivity(false);
+
			break;
		case 'x':
			match = MATCH_REGEX;
			break;
modified pkg/search.c
@@ -206,9 +206,9 @@ usage_search(void)
{
	int i, n;

-
	fprintf(stderr, "usage: pkg search [-egx] [-r repo] [-S search] "
+
	fprintf(stderr, "usage: pkg search [-egix] [-r repo] [-S search] "
	    "[-L label] [-M mod]... <pkg-name>\n");
-
	fprintf(stderr, "       pkg search [-cDdefgopqx] [-r repo] "
+
	fprintf(stderr, "       pkg search [-cDdefgiopqx] [-r repo] "
	    "<pattern>\n\n");
	n = fprintf(stderr, "       Search and Label options:");
	for (i = 0; search_label[i].option != NULL; i++) {
@@ -243,7 +243,7 @@ exec_search(int argc, char **argv)
	struct pkg *pkg = NULL;
	bool atleastone = false;

-
	while ((ch = getopt(argc, argv, "cDdefgL:opqQ:r:S:sx")) != -1) {
+
	while ((ch = getopt(argc, argv, "cDdefgiL:opqQ:r:S:sx")) != -1) {
		switch (ch) {
		case 'c':	/* Same as -S comment */
			search = search_label_opt("comment");
@@ -263,6 +263,9 @@ exec_search(int argc, char **argv)
		case 'g':
			match = MATCH_GLOB;
			break;
+
		case 'i':
+
			pkgdb_set_case_sensitivity(false);
+
			break;
		case 'L':
			label = search_label_opt(optarg);
			break;
modified pkg/set.c
@@ -41,7 +41,7 @@
void
usage_set(void)
{
-
	fprintf(stderr, "usage: pkg set [-a] [-A [01]] [-o <oldorigin>:<neworigin>] [-y] [-gx] <pkg-name>\n\n");
+
	fprintf(stderr, "usage: pkg set [-a] [-A [01]] [-o <oldorigin>:<neworigin>] [-y] [-gix] <pkg-name>\n\n");
	fprintf(stderr, "For more information see 'pkg help set'. \n");
}

@@ -68,7 +68,7 @@ exec_set(int argc, char **argv)

	pkg_config_bool(PKG_CONFIG_ASSUME_ALWAYS_YES, &yes);

-
	while ((ch = getopt(argc, argv, "A:ago:xy")) != -1) {
+
	while ((ch = getopt(argc, argv, "A:agio:xy")) != -1) {
		switch (ch) {
		case 'A':
			sets |= AUTOMATIC;
@@ -84,6 +84,9 @@ exec_set(int argc, char **argv)
		case 'g':
			match = MATCH_GLOB;
			break;
+
		case 'i':
+
			pkgdb_set_case_sensitivity(false);
+
			break;
		case 'o':
			sets |= ORIGIN;
			loads |= PKG_LOAD_DEPS;
modified pkg/version.c
@@ -57,7 +57,7 @@ struct index_entry {
void
usage_version(void)
{
-
	fprintf(stderr, "usage: pkg version [-IPR] [-hoqvU] [-l limchar] [-L limchar] [[-X] -s string]\n");
+
	fprintf(stderr, "usage: pkg version [-IPR] [-hoqvU] [-l limchar] [-L limchar] [-egix pattern]\n");
	fprintf(stderr, "                   [-r reponame] [-O origin] [index]\n");
	fprintf(stderr, "       pkg version -t <version1> <version2>\n");
	fprintf(stderr, "       pkg version -T <pkgname> <pattern>\n\n");
@@ -174,7 +174,7 @@ exec_version(int argc, char **argv)

	pkg_config_bool(PKG_CONFIG_REPO_AUTOUPDATE, &auto_update);

-
	while ((ch = getopt(argc, argv, "hIPRUoqvl:L:x:g:e:O:r:tT")) != -1) {
+
	while ((ch = getopt(argc, argv, "hIPRUoqvl:L:ix:g:e:O:r:tT")) != -1) {
		switch (ch) {
		case 'h':
			usage_version();
@@ -208,6 +208,9 @@ exec_version(int argc, char **argv)
			opt |= VERSION_NOSTATUS;
			limchar = *optarg;
			break;
+
		case 'i':
+
			pkgdb_set_case_sensitivity(false);
+
			break;
		case 'x':
			match = MATCH_REGEX;
			pattern = optarg;