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 15:24:21 +0100 |
commit | a58a0dc03398dcd9f81a9c8a6189ae13d90e0df7 (patch) | |
tree | 3841497303e3240ac1bbde74db9a2b5563602079 /meta | |
parent | 271cd99d00bde0b9f2aa27141acbe06812f34638 (diff) | |
download | openembedded-core-contrib-a58a0dc03398dcd9f81a9c8a6189ae13d90e0df7.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.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/rpm/files/0013-Add-a-new-option-alldeps-to-rpmdeps.patch | 152 | ||||
-rw-r--r-- | meta/recipes-devtools/rpm/rpm_git.bb | 1 |
2 files changed, 153 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 00000000000..faaf62960c1 --- /dev/null +++ b/meta/recipes-devtools/rpm/files/0013-Add-a-new-option-alldeps-to-rpmdeps.patch @@ -0,0 +1,152 @@ +From 3bf20a6116ae3e1a5a3a6907bee7e881b17efb2f Mon Sep 17 00:00:00 2001 +From: Peter Kjellerstedt <pkj@axis.com> +Date: Mon, 15 May 2017 11:23:26 +0200 +Subject: [PATCH 13/13] 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. + +Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/220] +Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> +--- + build/rpmfc.c | 27 ++++++++++++++------------- + build/rpmfc.h | 1 - + tools/rpmdeps.c | 44 +++++++++++++++++++++++++------------------- + 3 files changed, 39 insertions(+), 33 deletions(-) + +diff --git a/build/rpmfc.c b/build/rpmfc.c +index c8e2f876a..44f1cdc9a 100644 +--- a/build/rpmfc.c ++++ b/build/rpmfc.c +@@ -732,7 +732,6 @@ static rpm_color_t rpmfcColor(const char * fmstr) + + void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp) + { +- rpm_color_t fcolor; + int ndx; + int dx; + int fx; +@@ -744,21 +743,23 @@ void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp) + + if (fc) + for (fx = 0; fx < fc->nfiles; fx++) { +- rpmsid cx = fc->fcdictx[fx] + 1; /* id's are one off */ +- fcolor = fc->fcolor[fx]; +- ARGV_t fattrs = fc->fattrs[fx]; +- + fprintf(fp, "%3d %s", fx, fc->fn[fx]); +- if (fcolor != RPMFC_BLACK) ++ if (_rpmfc_debug) { ++ rpmsid cx = fc->fcdictx[fx] + 1; /* id's are one off */ ++ rpm_color_t fcolor = fc->fcolor[fx]; ++ ARGV_t fattrs = fc->fattrs[fx]; ++ ++ if (fcolor != RPMFC_BLACK) + fprintf(fp, "\t0x%x", fc->fcolor[fx]); +- else ++ else + fprintf(fp, "\t%s", rpmstrPoolStr(fc->cdict, cx)); +- if (fattrs) { +- char *attrs = argvJoin(fattrs, ","); +- fprintf(fp, " [%s]", attrs); +- free(attrs); +- } else { +- fprintf(fp, " [none]"); ++ if (fattrs) { ++ char *attrs = argvJoin(fattrs, ","); ++ fprintf(fp, " [%s]", attrs); ++ free(attrs); ++ } else { ++ fprintf(fp, " [none]"); ++ } + } + fprintf(fp, "\n"); + +diff --git a/build/rpmfc.h b/build/rpmfc.h +index dae8ea5b1..3d87b31cf 100644 +--- a/build/rpmfc.h ++++ b/build/rpmfc.h +@@ -45,7 +45,6 @@ typedef const struct rpmfcTokens_s * rpmfcToken; + + /** \ingroup rpmfc + * Print results of file classification. +- * @todo Remove debugging routine. + * @param msg message prefix (NULL for none) + * @param fc file classifier + * @param fp output file handle (NULL for stderr) +diff --git a/tools/rpmdeps.c b/tools/rpmdeps.c +index a414b6343..f260a38c4 100644 +--- a/tools/rpmdeps.c ++++ b/tools/rpmdeps.c +@@ -23,6 +23,8 @@ static int print_conflicts; + + static int print_obsoletes; + ++static int print_alldeps; ++ + static void rpmdsPrint(const char * msg, rpmds ds, FILE * fp) + { + if (fp == NULL) fp = stderr; +@@ -57,6 +59,8 @@ static struct poptOption optionsTable[] = { + NULL, NULL }, + { "obsoletes", '\0', POPT_ARG_VAL, &print_obsoletes, -1, + NULL, NULL }, ++ { "alldeps", '\0', POPT_ARG_VAL, &print_alldeps, -1, ++ NULL, NULL }, + + POPT_AUTOALIAS + POPT_AUTOHELP +@@ -100,25 +104,27 @@ main(int argc, char *argv[]) + if (rpmfcClassify(fc, av, NULL) || rpmfcApply(fc)) + goto exit; + +- if (_rpmfc_debug) +- rpmfcPrint(buf, fc, NULL); +- +- if (print_provides) +- rpmdsPrint(NULL, rpmfcProvides(fc), stdout); +- if (print_requires) +- rpmdsPrint(NULL, rpmfcRequires(fc), stdout); +- if (print_recommends) +- rpmdsPrint(NULL, rpmfcRecommends(fc), stdout); +- if (print_suggests) +- rpmdsPrint(NULL, rpmfcSuggests(fc), stdout); +- if (print_supplements) +- rpmdsPrint(NULL, rpmfcSupplements(fc), stdout); +- if (print_enhances) +- rpmdsPrint(NULL, rpmfcEnhances(fc), stdout); +- if (print_conflicts) +- rpmdsPrint(NULL, rpmfcConflicts(fc), stdout); +- if (print_obsoletes) +- rpmdsPrint(NULL, rpmfcObsoletes(fc), stdout); ++ if (print_alldeps || _rpmfc_debug) ++ rpmfcPrint(NULL, fc, print_alldeps ? stdout : NULL); ++ ++ if (!print_alldeps) { ++ if (print_provides) ++ rpmdsPrint(NULL, rpmfcProvides(fc), stdout); ++ if (print_requires) ++ rpmdsPrint(NULL, rpmfcRequires(fc), stdout); ++ if (print_recommends) ++ rpmdsPrint(NULL, rpmfcRecommends(fc), stdout); ++ if (print_suggests) ++ rpmdsPrint(NULL, rpmfcSuggests(fc), stdout); ++ if (print_supplements) ++ rpmdsPrint(NULL, rpmfcSupplements(fc), stdout); ++ if (print_enhances) ++ rpmdsPrint(NULL, rpmfcEnhances(fc), stdout); ++ if (print_conflicts) ++ rpmdsPrint(NULL, rpmfcConflicts(fc), stdout); ++ if (print_obsoletes) ++ rpmdsPrint(NULL, rpmfcObsoletes(fc), stdout); ++ } + + ec = 0; + +-- +2.12.0 + diff --git a/meta/recipes-devtools/rpm/rpm_git.bb b/meta/recipes-devtools/rpm/rpm_git.bb index 7c5f649a8b3..5fe52b83ec1 100644 --- a/meta/recipes-devtools/rpm/rpm_git.bb +++ b/meta/recipes-devtools/rpm/rpm_git.bb @@ -37,6 +37,7 @@ SRC_URI = "git://github.com/rpm-software-management/rpm \ file://0001-Add-PYTHON_ABI-when-searching-for-python-libraries.patch \ file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \ file://0012-Use-conditional-to-access-_docdir-in-macros.in.patch \ + file://0013-Add-a-new-option-alldeps-to-rpmdeps.patch \ " PV = "4.13.90+git${SRCPV}" |