Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 113693 Details for
Bug 171374
app-portage/portage-utils - Misc enhancements for qgrep
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
qgrep-02_add_-l_and_-L_options.patch
qgrep-02_add_-l_and_-L_options.patch (text/plain), 2.57 KB, created by
TGL
on 2007-03-18 19:55:00 UTC
(
hide
)
Description:
qgrep-02_add_-l_and_-L_options.patch
Filename:
MIME Type:
Creator:
TGL
Created:
2007-03-18 19:55:00 UTC
Size:
2.57 KB
patch
obsolete
>--- qgrep.c.01 2007-03-18 13:21:10.000000000 +0100 >+++ qgrep.c 2007-03-18 14:51:10.000000000 +0100 >@@ -10,12 +10,14 @@ > > #ifdef APPLET_qgrep > >-#define QGREP_FLAGS "IiHceEs" COMMON_FLAGS >+#define QGREP_FLAGS "IiHclLeEs" COMMON_FLAGS > static struct option const qgrep_long_opts[] = { > {"invert-match", no_argument, NULL, 'I'}, > {"ignore-case", no_argument, NULL, 'i'}, > {"with-filename", no_argument, NULL, 'H'}, > {"count", no_argument, NULL, 'c'}, >+ {"list", no_argument, NULL, 'l'}, >+ {"invert-list", no_argument, NULL, 'L'}, > {"regexp", no_argument, NULL, 'e'}, > {"eclass", no_argument, NULL, 'E'}, > {"skip-comments", no_argument, NULL, 's'}, >@@ -26,6 +28,8 @@ > "Ignore case distinctions", > "Print the filename for each match", > "Only print a count of matching lines per FILE", >+ "Only print FILE names containing matches", >+ "Only print FILE names containing no match", > "Use PATTERN as a regular expression", > "Search in eclasses instead of ebuilds", > "Skip comments lines", >@@ -39,8 +43,8 @@ > int i; > int count = 0; > char *p; >- char do_count, do_regex, do_eclass; >- char show_filename, skip_comments; >+ char do_count, do_regex, do_eclass, do_list; >+ char show_filename, skip_comments, invert_list; > FILE *fp = NULL; > DIR *eclass_dir = NULL; > struct dirent *dentry; >@@ -56,7 +60,8 @@ > DBG("argc=%d argv[0]=%s argv[1]=%s", > argc, argv[0], argc > 1 ? argv[1] : "NULL?"); > >- do_count = do_regex = do_eclass = show_filename = skip_comments = 0; >+ do_count = do_regex = do_eclass = do_list = 0; >+ show_filename = skip_comments = invert_list = 0; > > while ((i = GETOPT_LONG(QGREP, qgrep, "")) != -1) { > switch (i) { >@@ -66,6 +71,8 @@ > reflags |= REG_ICASE; > break; > case 'c': do_count = 1; break; >+ case 'l': do_list = 1; break; >+ case 'L': do_list = invert_list = 1; break; > case 'e': do_regex = 1; break; > case 'E': do_eclass = 1; break; > case 'H': show_filename = 1; break; >@@ -76,6 +83,9 @@ > if (argc == optind) > qgrep_usage(EXIT_FAILURE); > >+ if (do_list) >+ do_count = 0; >+ > if (do_regex) { > int ret; > if ((ret = regcomp(&preg, argv[optind], reflags))) { >@@ -141,7 +151,7 @@ > } > > count++; >- if (do_count) continue; >+ if (do_count || do_list) continue; > if (verbose || show_filename) { > printf("%s:", ebuild); > if (verbose > 1) printf("%d:", lineno); >@@ -154,7 +164,8 @@ > if (verbose || show_filename) printf("%s:", ebuild); > printf("%d", count); > puts(""); >- } >+ } else if (do_list && ((count && !invert_list) || (!count && invert_list))) >+ printf("%s\n", ebuild); > } > } > if (do_eclass)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 171374
:
113690
| 113693 |
113695
|
113697
|
113698
|
113699
|
113701
|
114221
|
114222
|
114281
|
114282
|
114944