|
Lubos Kardos |
c235b1 |
From 7a84b45c62cd25c4c68ad295ac5f360b1daebf6a Mon Sep 17 00:00:00 2001
|
|
Lubos Kardos |
c235b1 |
From: Lubos Kardos <lkardos@redhat.com>
|
|
Lubos Kardos |
c235b1 |
Date: Mon, 21 Sep 2015 14:13:22 +0200
|
|
Lubos Kardos |
c235b1 |
Subject: [PATCH] Add support for various types of dependencies to rpmdeps tool
|
|
Lubos Kardos |
c235b1 |
|
|
Lubos Kardos |
c235b1 |
Options added to rpmdeps tool:
|
|
Lubos Kardos |
c235b1 |
--recommends
|
|
Lubos Kardos |
c235b1 |
--suggests
|
|
Lubos Kardos |
c235b1 |
--supplements
|
|
Lubos Kardos |
c235b1 |
--enhances
|
|
Lubos Kardos |
c235b1 |
--conflicts
|
|
Lubos Kardos |
c235b1 |
--obsoletes
|
|
Lubos Kardos |
c235b1 |
---
|
|
Lubos Kardos |
c235b1 |
build/rpmfc.c | 30 ++++++++++++++++++++++++++++++
|
|
Lubos Kardos |
c235b1 |
build/rpmfc.h | 42 ++++++++++++++++++++++++++++++++++++++++++
|
|
Lubos Kardos |
c235b1 |
tools/rpmdeps.c | 36 ++++++++++++++++++++++++++++++++++++
|
|
Lubos Kardos |
c235b1 |
3 files changed, 108 insertions(+)
|
|
Lubos Kardos |
c235b1 |
|
|
Lubos Kardos |
c235b1 |
diff --git a/build/rpmfc.c b/build/rpmfc.c
|
|
Lubos Kardos |
c235b1 |
index 7565b18..3637f5c 100644
|
|
Lubos Kardos |
c235b1 |
--- a/build/rpmfc.c
|
|
Lubos Kardos |
c235b1 |
+++ b/build/rpmfc.c
|
|
Lubos Kardos |
c235b1 |
@@ -789,6 +789,36 @@ rpmds rpmfcRequires(rpmfc fc)
|
|
Lubos Kardos |
c235b1 |
return rpmfcDependencies(fc, RPMTAG_REQUIRENAME);
|
|
Lubos Kardos |
c235b1 |
}
|
|
Lubos Kardos |
c235b1 |
|
|
Lubos Kardos |
c235b1 |
+rpmds rpmfcRecommends(rpmfc fc)
|
|
Lubos Kardos |
c235b1 |
+{
|
|
Lubos Kardos |
c235b1 |
+ return rpmfcDependencies(fc, RPMTAG_RECOMMENDNAME);
|
|
Lubos Kardos |
c235b1 |
+}
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+rpmds rpmfcSuggests(rpmfc fc)
|
|
Lubos Kardos |
c235b1 |
+{
|
|
Lubos Kardos |
c235b1 |
+ return rpmfcDependencies(fc, RPMTAG_SUGGESTNAME);
|
|
Lubos Kardos |
c235b1 |
+}
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+rpmds rpmfcSupplements(rpmfc fc)
|
|
Lubos Kardos |
c235b1 |
+{
|
|
Lubos Kardos |
c235b1 |
+ return rpmfcDependencies(fc, RPMTAG_SUPPLEMENTNAME);
|
|
Lubos Kardos |
c235b1 |
+}
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+rpmds rpmfcEnhances(rpmfc fc)
|
|
Lubos Kardos |
c235b1 |
+{
|
|
Lubos Kardos |
c235b1 |
+ return rpmfcDependencies(fc, RPMTAG_ENHANCENAME);
|
|
Lubos Kardos |
c235b1 |
+}
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+rpmds rpmfcConflicts(rpmfc fc)
|
|
Lubos Kardos |
c235b1 |
+{
|
|
Lubos Kardos |
c235b1 |
+ return rpmfcDependencies(fc, RPMTAG_CONFLICTNAME);
|
|
Lubos Kardos |
c235b1 |
+}
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+rpmds rpmfcObsoletes(rpmfc fc)
|
|
Lubos Kardos |
c235b1 |
+{
|
|
Lubos Kardos |
c235b1 |
+ return rpmfcDependencies(fc, RPMTAG_OBSOLETENAME);
|
|
Lubos Kardos |
c235b1 |
+}
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
static rpmRC rpmfcApplyInternal(rpmfc fc)
|
|
Lubos Kardos |
c235b1 |
{
|
|
Lubos Kardos |
c235b1 |
const char * s;
|
|
Lubos Kardos |
c235b1 |
diff --git a/build/rpmfc.h b/build/rpmfc.h
|
|
Lubos Kardos |
c235b1 |
index bd1c660..dae8ea5 100644
|
|
Lubos Kardos |
c235b1 |
--- a/build/rpmfc.h
|
|
Lubos Kardos |
c235b1 |
+++ b/build/rpmfc.h
|
|
Lubos Kardos |
c235b1 |
@@ -107,6 +107,48 @@ rpmds rpmfcProvides(rpmfc fc);
|
|
Lubos Kardos |
c235b1 |
rpmds rpmfcRequires(rpmfc fc);
|
|
Lubos Kardos |
c235b1 |
|
|
Lubos Kardos |
c235b1 |
/** \ingroup rpmfc
|
|
Lubos Kardos |
c235b1 |
+ * Retrieve file classification recommends
|
|
Lubos Kardos |
c235b1 |
+ * @param fc file classifier
|
|
Lubos Kardos |
c235b1 |
+ * @return rpmds dependency set of fc recommends
|
|
Lubos Kardos |
c235b1 |
+ */
|
|
Lubos Kardos |
c235b1 |
+rpmds rpmfcRecommends(rpmfc fc);
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+/** \ingroup rpmfc
|
|
Lubos Kardos |
c235b1 |
+ * Retrieve file classification suggests
|
|
Lubos Kardos |
c235b1 |
+ * @param fc file classifier
|
|
Lubos Kardos |
c235b1 |
+ * @return rpmds dependency set of fc suggests
|
|
Lubos Kardos |
c235b1 |
+ */
|
|
Lubos Kardos |
c235b1 |
+rpmds rpmfcSuggests(rpmfc fc);
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+/** \ingroup rpmfc
|
|
Lubos Kardos |
c235b1 |
+ * Retrieve file classification supplements
|
|
Lubos Kardos |
c235b1 |
+ * @param fc file classifier
|
|
Lubos Kardos |
c235b1 |
+ * @return rpmds dependency set of fc supplements
|
|
Lubos Kardos |
c235b1 |
+ */
|
|
Lubos Kardos |
c235b1 |
+rpmds rpmfcSupplements(rpmfc fc);
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+/** \ingroup rpmfc
|
|
Lubos Kardos |
c235b1 |
+ * Retrieve file classification enhances
|
|
Lubos Kardos |
c235b1 |
+ * @param fc file classifier
|
|
Lubos Kardos |
c235b1 |
+ * @return rpmds dependency set of fc enhances
|
|
Lubos Kardos |
c235b1 |
+ */
|
|
Lubos Kardos |
c235b1 |
+rpmds rpmfcEnhances(rpmfc fc);
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+/** \ingroup rpmfc
|
|
Lubos Kardos |
c235b1 |
+ * Retrieve file classification conflicts
|
|
Lubos Kardos |
c235b1 |
+ * @param fc file classifier
|
|
Lubos Kardos |
c235b1 |
+ * @return rpmds dependency set of fc conflicts
|
|
Lubos Kardos |
c235b1 |
+ */
|
|
Lubos Kardos |
c235b1 |
+rpmds rpmfcConflicts(rpmfc fc);
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+/** \ingroup rpmfc
|
|
Lubos Kardos |
c235b1 |
+ * Retrieve file classification obsoletes
|
|
Lubos Kardos |
c235b1 |
+ * @param fc file classifier
|
|
Lubos Kardos |
c235b1 |
+ * @return rpmds dependency set of fc obsoletes
|
|
Lubos Kardos |
c235b1 |
+ */
|
|
Lubos Kardos |
c235b1 |
+rpmds rpmfcObsoletes(rpmfc fc);
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+/** \ingroup rpmfc
|
|
Lubos Kardos |
c235b1 |
* Retrieve file classification dependencies
|
|
Lubos Kardos |
c235b1 |
* @param fc file classifier
|
|
Lubos Kardos |
c235b1 |
* @param tagN name tag of the wanted dependency
|
|
Lubos Kardos |
c235b1 |
diff --git a/tools/rpmdeps.c b/tools/rpmdeps.c
|
|
Lubos Kardos |
c235b1 |
index c3112eb..ff785f0 100644
|
|
Lubos Kardos |
c235b1 |
--- a/tools/rpmdeps.c
|
|
Lubos Kardos |
c235b1 |
+++ b/tools/rpmdeps.c
|
|
Lubos Kardos |
c235b1 |
@@ -14,6 +14,18 @@ static int print_provides;
|
|
Lubos Kardos |
c235b1 |
|
|
Lubos Kardos |
c235b1 |
static int print_requires;
|
|
Lubos Kardos |
c235b1 |
|
|
Lubos Kardos |
c235b1 |
+static int print_recommends;
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+static int print_suggests;
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+static int print_supplements;
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+static int print_enhances;
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+static int print_conflicts;
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
+static int print_obsoletes;
|
|
Lubos Kardos |
c235b1 |
+
|
|
Lubos Kardos |
c235b1 |
static void rpmdsPrint(const char * msg, rpmds ds, FILE * fp)
|
|
Lubos Kardos |
c235b1 |
{
|
|
Lubos Kardos |
c235b1 |
if (fp == NULL) fp = stderr;
|
|
Lubos Kardos |
c235b1 |
@@ -36,6 +48,18 @@ static struct poptOption optionsTable[] = {
|
|
Lubos Kardos |
c235b1 |
NULL, NULL },
|
|
Lubos Kardos |
c235b1 |
{ "requires", 'R', POPT_ARG_VAL, &print_requires, -1,
|
|
Lubos Kardos |
c235b1 |
NULL, NULL },
|
|
Lubos Kardos |
c235b1 |
+ { "recommends", '\0', POPT_ARG_VAL, &print_recommends, -1,
|
|
Lubos Kardos |
c235b1 |
+ NULL, NULL },
|
|
Lubos Kardos |
c235b1 |
+ { "suggests", '\0', POPT_ARG_VAL, &print_suggests, -1,
|
|
Lubos Kardos |
c235b1 |
+ NULL, NULL },
|
|
Lubos Kardos |
c235b1 |
+ { "supplements", '\0', POPT_ARG_VAL, &print_supplements, -1,
|
|
Lubos Kardos |
c235b1 |
+ NULL, NULL },
|
|
Lubos Kardos |
c235b1 |
+ { "enhances", '\0', POPT_ARG_VAL, &print_enhances, -1,
|
|
Lubos Kardos |
c235b1 |
+ NULL, NULL },
|
|
Lubos Kardos |
c235b1 |
+ { "conflicts", '\0', POPT_ARG_VAL, &print_conflicts, -1,
|
|
Lubos Kardos |
c235b1 |
+ NULL, NULL },
|
|
Lubos Kardos |
c235b1 |
+ { "obsoletes", '\0', POPT_ARG_VAL, &print_obsoletes, -1,
|
|
Lubos Kardos |
c235b1 |
+ NULL, NULL },
|
|
Lubos Kardos |
c235b1 |
|
|
Lubos Kardos |
c235b1 |
POPT_AUTOALIAS
|
|
Lubos Kardos |
c235b1 |
POPT_AUTOHELP
|
|
Lubos Kardos |
c235b1 |
@@ -89,6 +113,18 @@ main(int argc, char *argv[])
|
|
Lubos Kardos |
c235b1 |
rpmdsPrint(NULL, rpmfcProvides(fc), stdout);
|
|
Lubos Kardos |
c235b1 |
if (print_requires)
|
|
Lubos Kardos |
c235b1 |
rpmdsPrint(NULL, rpmfcRequires(fc), stdout);
|
|
Lubos Kardos |
c235b1 |
+ if (print_recommends)
|
|
Lubos Kardos |
c235b1 |
+ rpmdsPrint(NULL, rpmfcRecommends(fc), stdout);
|
|
Lubos Kardos |
c235b1 |
+ if (print_suggests)
|
|
Lubos Kardos |
c235b1 |
+ rpmdsPrint(NULL, rpmfcSuggests(fc), stdout);
|
|
Lubos Kardos |
c235b1 |
+ if (print_supplements)
|
|
Lubos Kardos |
c235b1 |
+ rpmdsPrint(NULL, rpmfcSupplements(fc), stdout);
|
|
Lubos Kardos |
c235b1 |
+ if (print_enhances)
|
|
Lubos Kardos |
c235b1 |
+ rpmdsPrint(NULL, rpmfcEnhances(fc), stdout);
|
|
Lubos Kardos |
c235b1 |
+ if (print_conflicts)
|
|
Lubos Kardos |
c235b1 |
+ rpmdsPrint(NULL, rpmfcConflicts(fc), stdout);
|
|
Lubos Kardos |
c235b1 |
+ if (print_obsoletes)
|
|
Lubos Kardos |
c235b1 |
+ rpmdsPrint(NULL, rpmfcObsoletes(fc), stdout);
|
|
Lubos Kardos |
c235b1 |
|
|
Lubos Kardos |
c235b1 |
ec = 0;
|
|
Lubos Kardos |
c235b1 |
|
|
Lubos Kardos |
c235b1 |
--
|
|
Lubos Kardos |
c235b1 |
1.9.3
|
|
Lubos Kardos |
c235b1 |
|