1 |
commit: 7c3b484d601e6c06cfc692bbf011fca338697725 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Nov 26 09:43:52 2015 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Nov 26 09:43:52 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7c3b484d |
7 |
|
8 |
quse: move file warnings behind verbose |
9 |
|
10 |
Usually missing desc files are not errors but normal behavior: |
11 |
people have trimmed the files or are using repos w/out them. |
12 |
Move the warnings related to them behind --verbose so we don't |
13 |
clutter up normal output. |
14 |
|
15 |
quse.c | 11 +++++++---- |
16 |
1 file changed, 7 insertions(+), 4 deletions(-) |
17 |
|
18 |
diff --git a/quse.c b/quse.c |
19 |
index 049b6e9..c7c1863 100644 |
20 |
--- a/quse.c |
21 |
+++ b/quse.c |
22 |
@@ -97,8 +97,9 @@ quse_describe_flag(unsigned int ind, unsigned int argc, char **argv) |
23 |
|
24 |
for (i = 0; i < NUM_SEARCH_FILES; ++i) { |
25 |
snprintf(buf, buflen, "%s/profiles/%s", portdir, search_files[i]); |
26 |
- if ((fp[i] = fopen(buf, "r")) == NULL) |
27 |
- warnp("skipping %s", search_files[i]); |
28 |
+ fp[i] = fopen(buf, "r"); |
29 |
+ if (verbose && fp[i] == NULL) |
30 |
+ warnp("skipping %s", buf); |
31 |
} |
32 |
|
33 |
for (i = ind; i < argc; i++) { |
34 |
@@ -157,7 +158,8 @@ quse_describe_flag(unsigned int ind, unsigned int argc, char **argv) |
35 |
/* now scan the desc dir */ |
36 |
snprintf(buf, buflen, "%s/profiles/desc/", portdir); |
37 |
if ((d = opendir(buf)) == NULL) { |
38 |
- warnp("skipping profiles/desc/"); |
39 |
+ if (verbose) |
40 |
+ warnp("skipping %s", buf); |
41 |
goto done; |
42 |
} |
43 |
|
44 |
@@ -171,7 +173,8 @@ quse_describe_flag(unsigned int ind, unsigned int argc, char **argv) |
45 |
|
46 |
snprintf(buf, buflen, "%s/profiles/desc/%s", portdir, de->d_name); |
47 |
if ((fp[0] = fopen(buf, "r")) == NULL) { |
48 |
- warn("Could not open '%s' for reading; skipping", de->d_name); |
49 |
+ if (verbose) |
50 |
+ warnp("skipping %s", buf); |
51 |
continue; |
52 |
} |