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