diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2017-06-09 21:34:34 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-12 23:01:23 +0100 |
commit | e075d603c943426cf59a0e2ee82a7ff84801af54 (patch) | |
tree | fdf4ec9cd4d2a939b283eee2c4964491bcc09a7c /meta/recipes-devtools/rpm/files | |
parent | 8573de63aa0ad84cc0f6763343897ce9e20f0879 (diff) | |
download | poky-e075d603c943426cf59a0e2ee82a7ff84801af54.tar.gz |
rpm: Add a new option --alldeps to rpmdeps
This will send the output from rpmfcPrint() to stdout. This is an
alternative to using the --rpmfcdebug option, which will send the same
output to stderr. The two options have totally different use cases
though. While --alldeps is used when the output from rpmfcPrint() is
what is wanted, --rpmfcdebug can be used together with the other
output options, e.g., --requires, without affecting their output.
(From OE-Core rev: a58a0dc03398dcd9f81a9c8a6189ae13d90e0df7)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rpm/files')
-rw-r--r-- | meta/recipes-devtools/rpm/files/0013-Add-a-new-option-alldeps-to-rpmdeps.patch | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/files/0013-Add-a-new-option-alldeps-to-rpmdeps.patch b/meta/recipes-devtools/rpm/files/0013-Add-a-new-option-alldeps-to-rpmdeps.patch new file mode 100644 index 0000000000..faaf62960c --- /dev/null +++ b/meta/recipes-devtools/rpm/files/0013-Add-a-new-option-alldeps-to-rpmdeps.patch | |||
@@ -0,0 +1,152 @@ | |||
1 | From 3bf20a6116ae3e1a5a3a6907bee7e881b17efb2f Mon Sep 17 00:00:00 2001 | ||
2 | From: Peter Kjellerstedt <pkj@axis.com> | ||
3 | Date: Mon, 15 May 2017 11:23:26 +0200 | ||
4 | Subject: [PATCH 13/13] Add a new option --alldeps to rpmdeps | ||
5 | |||
6 | This will send the output from rpmfcPrint() to stdout. This is an | ||
7 | alternative to using the --rpmfcdebug option, which will send the same | ||
8 | output to stderr. The two options have totally different use cases | ||
9 | though. While --alldeps is used when the output from rpmfcPrint() is | ||
10 | what is wanted, --rpmfcdebug can be used together with the other | ||
11 | output options, e.g., --requires, without affecting their output. | ||
12 | |||
13 | Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/220] | ||
14 | Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> | ||
15 | --- | ||
16 | build/rpmfc.c | 27 ++++++++++++++------------- | ||
17 | build/rpmfc.h | 1 - | ||
18 | tools/rpmdeps.c | 44 +++++++++++++++++++++++++------------------- | ||
19 | 3 files changed, 39 insertions(+), 33 deletions(-) | ||
20 | |||
21 | diff --git a/build/rpmfc.c b/build/rpmfc.c | ||
22 | index c8e2f876a..44f1cdc9a 100644 | ||
23 | --- a/build/rpmfc.c | ||
24 | +++ b/build/rpmfc.c | ||
25 | @@ -732,7 +732,6 @@ static rpm_color_t rpmfcColor(const char * fmstr) | ||
26 | |||
27 | void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp) | ||
28 | { | ||
29 | - rpm_color_t fcolor; | ||
30 | int ndx; | ||
31 | int dx; | ||
32 | int fx; | ||
33 | @@ -744,21 +743,23 @@ void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp) | ||
34 | |||
35 | if (fc) | ||
36 | for (fx = 0; fx < fc->nfiles; fx++) { | ||
37 | - rpmsid cx = fc->fcdictx[fx] + 1; /* id's are one off */ | ||
38 | - fcolor = fc->fcolor[fx]; | ||
39 | - ARGV_t fattrs = fc->fattrs[fx]; | ||
40 | - | ||
41 | fprintf(fp, "%3d %s", fx, fc->fn[fx]); | ||
42 | - if (fcolor != RPMFC_BLACK) | ||
43 | + if (_rpmfc_debug) { | ||
44 | + rpmsid cx = fc->fcdictx[fx] + 1; /* id's are one off */ | ||
45 | + rpm_color_t fcolor = fc->fcolor[fx]; | ||
46 | + ARGV_t fattrs = fc->fattrs[fx]; | ||
47 | + | ||
48 | + if (fcolor != RPMFC_BLACK) | ||
49 | fprintf(fp, "\t0x%x", fc->fcolor[fx]); | ||
50 | - else | ||
51 | + else | ||
52 | fprintf(fp, "\t%s", rpmstrPoolStr(fc->cdict, cx)); | ||
53 | - if (fattrs) { | ||
54 | - char *attrs = argvJoin(fattrs, ","); | ||
55 | - fprintf(fp, " [%s]", attrs); | ||
56 | - free(attrs); | ||
57 | - } else { | ||
58 | - fprintf(fp, " [none]"); | ||
59 | + if (fattrs) { | ||
60 | + char *attrs = argvJoin(fattrs, ","); | ||
61 | + fprintf(fp, " [%s]", attrs); | ||
62 | + free(attrs); | ||
63 | + } else { | ||
64 | + fprintf(fp, " [none]"); | ||
65 | + } | ||
66 | } | ||
67 | fprintf(fp, "\n"); | ||
68 | |||
69 | diff --git a/build/rpmfc.h b/build/rpmfc.h | ||
70 | index dae8ea5b1..3d87b31cf 100644 | ||
71 | --- a/build/rpmfc.h | ||
72 | +++ b/build/rpmfc.h | ||
73 | @@ -45,7 +45,6 @@ typedef const struct rpmfcTokens_s * rpmfcToken; | ||
74 | |||
75 | /** \ingroup rpmfc | ||
76 | * Print results of file classification. | ||
77 | - * @todo Remove debugging routine. | ||
78 | * @param msg message prefix (NULL for none) | ||
79 | * @param fc file classifier | ||
80 | * @param fp output file handle (NULL for stderr) | ||
81 | diff --git a/tools/rpmdeps.c b/tools/rpmdeps.c | ||
82 | index a414b6343..f260a38c4 100644 | ||
83 | --- a/tools/rpmdeps.c | ||
84 | +++ b/tools/rpmdeps.c | ||
85 | @@ -23,6 +23,8 @@ static int print_conflicts; | ||
86 | |||
87 | static int print_obsoletes; | ||
88 | |||
89 | +static int print_alldeps; | ||
90 | + | ||
91 | static void rpmdsPrint(const char * msg, rpmds ds, FILE * fp) | ||
92 | { | ||
93 | if (fp == NULL) fp = stderr; | ||
94 | @@ -57,6 +59,8 @@ static struct poptOption optionsTable[] = { | ||
95 | NULL, NULL }, | ||
96 | { "obsoletes", '\0', POPT_ARG_VAL, &print_obsoletes, -1, | ||
97 | NULL, NULL }, | ||
98 | + { "alldeps", '\0', POPT_ARG_VAL, &print_alldeps, -1, | ||
99 | + NULL, NULL }, | ||
100 | |||
101 | POPT_AUTOALIAS | ||
102 | POPT_AUTOHELP | ||
103 | @@ -100,25 +104,27 @@ main(int argc, char *argv[]) | ||
104 | if (rpmfcClassify(fc, av, NULL) || rpmfcApply(fc)) | ||
105 | goto exit; | ||
106 | |||
107 | - if (_rpmfc_debug) | ||
108 | - rpmfcPrint(buf, fc, NULL); | ||
109 | - | ||
110 | - if (print_provides) | ||
111 | - rpmdsPrint(NULL, rpmfcProvides(fc), stdout); | ||
112 | - if (print_requires) | ||
113 | - rpmdsPrint(NULL, rpmfcRequires(fc), stdout); | ||
114 | - if (print_recommends) | ||
115 | - rpmdsPrint(NULL, rpmfcRecommends(fc), stdout); | ||
116 | - if (print_suggests) | ||
117 | - rpmdsPrint(NULL, rpmfcSuggests(fc), stdout); | ||
118 | - if (print_supplements) | ||
119 | - rpmdsPrint(NULL, rpmfcSupplements(fc), stdout); | ||
120 | - if (print_enhances) | ||
121 | - rpmdsPrint(NULL, rpmfcEnhances(fc), stdout); | ||
122 | - if (print_conflicts) | ||
123 | - rpmdsPrint(NULL, rpmfcConflicts(fc), stdout); | ||
124 | - if (print_obsoletes) | ||
125 | - rpmdsPrint(NULL, rpmfcObsoletes(fc), stdout); | ||
126 | + if (print_alldeps || _rpmfc_debug) | ||
127 | + rpmfcPrint(NULL, fc, print_alldeps ? stdout : NULL); | ||
128 | + | ||
129 | + if (!print_alldeps) { | ||
130 | + if (print_provides) | ||
131 | + rpmdsPrint(NULL, rpmfcProvides(fc), stdout); | ||
132 | + if (print_requires) | ||
133 | + rpmdsPrint(NULL, rpmfcRequires(fc), stdout); | ||
134 | + if (print_recommends) | ||
135 | + rpmdsPrint(NULL, rpmfcRecommends(fc), stdout); | ||
136 | + if (print_suggests) | ||
137 | + rpmdsPrint(NULL, rpmfcSuggests(fc), stdout); | ||
138 | + if (print_supplements) | ||
139 | + rpmdsPrint(NULL, rpmfcSupplements(fc), stdout); | ||
140 | + if (print_enhances) | ||
141 | + rpmdsPrint(NULL, rpmfcEnhances(fc), stdout); | ||
142 | + if (print_conflicts) | ||
143 | + rpmdsPrint(NULL, rpmfcConflicts(fc), stdout); | ||
144 | + if (print_obsoletes) | ||
145 | + rpmdsPrint(NULL, rpmfcObsoletes(fc), stdout); | ||
146 | + } | ||
147 | |||
148 | ec = 0; | ||
149 | |||
150 | -- | ||
151 | 2.12.0 | ||
152 | |||