Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 113221 Details for
Bug 170797
app-portage/portage-utils - add a -s/--skip-comments option to qgrep
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
qgrep--add_skip-comments_option.patch
qgrep--add_skip-comments_option.patch (text/plain), 1.85 KB, created by
TGL
on 2007-03-13 22:38:44 UTC
(
hide
)
Description:
qgrep--add_skip-comments_option.patch
Filename:
MIME Type:
Creator:
TGL
Created:
2007-03-13 22:38:44 UTC
Size:
1.85 KB
patch
obsolete
>--- qgrep.c.eclass 2007-03-13 23:05:34.000000000 +0100 >+++ qgrep.c 2007-03-13 23:05:01.000000000 +0100 >@@ -10,7 +10,7 @@ > > #ifdef APPLET_qgrep > >-#define QGREP_FLAGS "IiHceE" COMMON_FLAGS >+#define QGREP_FLAGS "IiHceEs" COMMON_FLAGS > static struct option const qgrep_long_opts[] = { > {"invert-match", no_argument, NULL, 'I'}, > {"ignore-case", no_argument, NULL, 'i'}, >@@ -18,6 +18,7 @@ > {"count", no_argument, NULL, 'c'}, > {"regexp", no_argument, NULL, 'e'}, > {"eclass", no_argument, NULL, 'E'}, >+ {"skip-comments", no_argument, NULL, 's'}, > COMMON_LONG_OPTS > }; > static const char *qgrep_opts_help[] = { >@@ -27,5 +28,6 @@ > "Only print a count of matching lines per FILE", > "Use PATTERN as a regular expression", > "Search in eclasses instead of ebuilds", >+ "Skip comments lines", > COMMON_OPTS_HELP > }; >@@ -38,7 +40,7 @@ > int count = 0; > char *p; > char do_count, do_regex, do_eclass; >- char show_filename; >+ char show_filename, skip_comments; > FILE *fp = NULL; > DIR *eclass_dir = NULL; > struct dirent *dentry; >@@ -54,7 +56,7 @@ > 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 = 0; >+ do_count = do_regex = do_eclass = show_filename = skip_comments = 0; > > while ((i = GETOPT_LONG(QGREP, qgrep, "")) != -1) { > switch (i) { >@@ -67,6 +69,7 @@ > case 'e': do_regex = 1; break; > case 'E': do_eclass = 1; break; > case 'H': show_filename = 1; break; >+ case 's': skip_comments = 1; break; > COMMON_GETOPTS_CASES(qgrep) > } > } >@@ -107,6 +110,12 @@ > if ((p = strrchr(buf0, '\r')) != NULL) > *p = 0; > >+ if (skip_comments) { >+ p = buf0; >+ while (*p == ' ' || *p == '\t') p++; >+ if (*p == '#') continue; >+ } >+ > if (!invert_match) { > if (do_regex == 0) { > if (( (FUNC *) (strfunc) (buf0, argv[optind])) == NULL) continue;
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 170797
: 113221 |
113549