Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage-utils:master commit in: man/, /
Date: Thu, 28 Feb 2019 19:28:16
Message-Id: 1551382032.951a8711a59b1a7d49125f5f5214ff1ae9e50074.grobian@gentoo
commit:     951a8711a59b1a7d49125f5f5214ff1ae9e50074
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 28 19:27:12 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Feb 28 19:27:12 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=951a8711

qfile: drop non-functional --exact option

Bug: https://bugs.gentoo.org/678632
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 man/qfile.1 |  3 ---
 qfile.c     | 11 ++---------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/man/qfile.1 b/man/qfile.1
index c7f7054..6bf07c0 100644
--- a/man/qfile.1
+++ b/man/qfile.1
@@ -27,9 +27,6 @@ List orphan files.
 \fB\-x\fR \fI<arg>\fR, \fB\-\-exclude\fR \fI<arg>\fR
 Don't look in package <arg> (used with --orphans).
 .TP
-\fB\-e\fR, \fB\-\-exact\fR
-Exact match (used with --exclude).
-.TP
 \fB\-\-root\fR \fI<arg>\fR
 Set the ROOT env var.
 .TP

diff --git a/qfile.c b/qfile.c
index 285277b..6e1cb0a 100644
--- a/qfile.c
+++ b/qfile.c
@@ -8,14 +8,13 @@
 
 #ifdef APPLET_qfile
 
-#define QFILE_FLAGS "beoRx:S" COMMON_FLAGS
+#define QFILE_FLAGS "boRx:S" COMMON_FLAGS
 static struct option const qfile_long_opts[] = {
 	{"slots",       no_argument, NULL, 'S'},
 	{"root-prefix", no_argument, NULL, 'R'},
 	{"basename",    no_argument, NULL, 'b'},
 	{"orphans",     no_argument, NULL, 'o'},
 	{"exclude",      a_argument, NULL, 'x'},
-	{"exact",       no_argument, NULL, 'e'},
 	COMMON_LONG_OPTS
 };
 static const char * const qfile_opts_help[] = {
@@ -24,7 +23,6 @@ static const char * const qfile_opts_help[] = {
 	"Match any component of the path",
 	"List orphan files",
 	"Don't look in package <arg> (used with --orphans)",
-	"Exact match (used with --exclude)",
 	COMMON_OPTS_HELP
 };
 #define qfile_usage(ret) usage(ret, QFILE_FLAGS, qfile_long_opts, qfile_opts_help, NULL, lookup_applet_idx("qfile"))
@@ -56,7 +54,6 @@ struct qfile_opt_state {
 	depend_atom *exclude_atom;
 	bool slotted;
 	bool basename;
-	bool exact;
 	bool orphans;
 	bool assume_root_prefix;
 };
@@ -224,7 +221,7 @@ static int qfile_cb(q_vdb_pkg_ctx *pkg_ctx, void *priv)
 				} else
 					slot[0] = '\0';
 				printf("%s%s/%s%s%s%s", BOLD, atom->CATEGORY, BLUE,
-					(state->exact ? pkg_ctx->name : atom->PN),
+					(verbose ? pkg_ctx->name : atom->PN),
 					slot, NORM);
 				if (quiet)
 					puts("");
@@ -402,7 +399,6 @@ int qfile_main(int argc, char **argv)
 		.buflen = _Q_PATH_MAX,
 		.slotted = false,
 		.basename = false,
-		.exact = false,
 		.orphans = false,
 		.assume_root_prefix = false,
 	};
@@ -414,7 +410,6 @@ int qfile_main(int argc, char **argv)
 			COMMON_GETOPTS_CASES(qfile)
 			case 'S': state.slotted = true; break;
 			case 'b': state.basename = true; break;
-			case 'e': state.exact = true; break;
 			case 'o': state.orphans = true; break;
 			case 'R': state.assume_root_prefix = true; break;
 			case 'x':
@@ -429,8 +424,6 @@ int qfile_main(int argc, char **argv)
 				break;
 		}
 	}
-	if (!state.exact && verbose)
-		state.exact = true;
 	if (argc == optind)
 		qfile_usage(EXIT_FAILURE);