Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 113695 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-03_add_a_--skip_option.patch
qgrep-03_add_a_--skip_option.patch (text/plain), 2.41 KB, created by
TGL
on 2007-03-18 19:55:47 UTC
(
hide
)
Description:
qgrep-03_add_a_--skip_option.patch
Filename:
MIME Type:
Creator:
TGL
Created:
2007-03-18 19:55:47 UTC
Size:
2.41 KB
patch
obsolete
>--- qgrep.c.02 2007-03-18 15:41:57.000000000 +0100 >+++ qgrep.c 2007-03-18 15:40:20.000000000 +0100 >@@ -10,7 +10,7 @@ > > #ifdef APPLET_qgrep > >-#define QGREP_FLAGS "IiHclLeEs" COMMON_FLAGS >+#define QGREP_FLAGS "IiHclLeEsS:" COMMON_FLAGS > static struct option const qgrep_long_opts[] = { > {"invert-match", no_argument, NULL, 'I'}, > {"ignore-case", no_argument, NULL, 'i'}, >@@ -21,6 +21,7 @@ > {"regexp", no_argument, NULL, 'e'}, > {"eclass", no_argument, NULL, 'E'}, > {"skip-comments", no_argument, NULL, 's'}, >+ {"skip", a_argument, NULL, 'S'}, > COMMON_LONG_OPTS > }; > static const char *qgrep_opts_help[] = { >@@ -33,6 +34,7 @@ > "Use PATTERN as a regular expression", > "Search in eclasses instead of ebuilds", > "Skip comments lines", >+ "Skip lines matching <arg>", > COMMON_OPTS_HELP > }; > static const char qgrep_rcsid[] = "$Id: qgrep.c,v 1.17 2007/03/17 20:53:23 solar Exp $"; >@@ -52,7 +54,8 @@ > char buf0[BUFSIZ]; > int reflags = REG_NOSUB; > char invert_match = 0; >- regex_t preg; >+ regex_t preg, skip_preg; >+ char *skip_pattern = NULL; > > typedef char *(*FUNC) (char *, char *); > FUNC strfunc = (FUNC) strstr; >@@ -77,6 +80,7 @@ > case 'E': do_eclass = 1; break; > case 'H': show_filename = 1; break; > case 's': skip_comments = 1; break; >+ case 'S': skip_pattern = optarg; break; > COMMON_GETOPTS_CASES(qgrep) > } > } >@@ -88,13 +92,19 @@ > > if (do_regex) { > int ret; >+ char err[256]; > if ((ret = regcomp(&preg, argv[optind], reflags))) { >- char err[256]; > if (regerror(ret, &preg, err, sizeof(err))) > errf("regcomp failed: %s", err); > else > err("regcomp failed"); > } >+ if (skip_pattern && (ret = regcomp(&skip_preg, skip_pattern, reflags))) { >+ if (regerror(ret, &skip_preg, err, sizeof(err))) >+ errf("regcomp failed for --skip pattern: %s", err); >+ else >+ err("regcomp failed for --skip pattern"); >+ } > } > > if (!do_eclass) { >@@ -136,6 +146,14 @@ > if (*p == '#') continue; > } > >+ if (skip_pattern) { >+ if (!do_regex) { >+ if (( (FUNC *) (strfunc) (buf0, skip_pattern)) != NULL) continue; >+ } else { >+ if (regexec(&skip_preg, buf0, 0, NULL, 0) == 0) continue; >+ } >+ } >+ > if (!invert_match) { > if (do_regex == 0) { > if (( (FUNC *) (strfunc) (buf0, argv[optind])) == NULL) continue; >@@ -174,6 +192,8 @@ > fclose(fp); > if (do_regex) > regfree(&preg); >+ if (do_regex && skip_pattern) >+ regfree(&skip_preg); > return EXIT_SUCCESS; > } >
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