Add a new public function for retrieving build dependencies from spec
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 2 Sep 2010 11:25:30 +0000 (14:25 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 2 Sep 2010 11:28:17 +0000 (14:28 +0300)
- Not needed by rpmbuild itself currently, but permits retrieving the
  build dependency information in a format that's better suited for
  further processing than an rpm problem set.

build/rpmbuild.h
build/spec.c

index f63283b..78981a9 100644 (file)
@@ -79,6 +79,14 @@ rpmSpec rpmSpecParse(const char *specFile, rpmSpecFlags flags,
 rpmps rpmSpecCheckDeps(rpmts ts, rpmSpec spec);
 
 /** \ingroup rpmbuild
+ * Retrieve build dependency set from spec.
+ * @param spec         parsed spec control structure
+ * @param tag          dependency tag
+ * @return             dependency set of tag (or NULL)
+ */
+rpmds rpmSpecDS(rpmSpec spec, rpmTag tag);
+
+/** \ingroup rpmbuild
  * Build stages state machine driver.
  * @param buildArgs    build arguments
  * @param spec         spec file control structure
index abe5a5d..1fc1554 100644 (file)
@@ -310,6 +310,11 @@ rpmSpec rpmSpecFree(rpmSpec spec)
     return spec;
 }
 
+rpmds rpmSpecDS(rpmSpec spec, rpmTag tag)
+{
+    return (spec != NULL) ? rpmdsNew(spec->buildRestrictions, tag, 0) : NULL;
+}
+
 rpmps rpmSpecCheckDeps(rpmts ts, rpmSpec spec)
 {
     rpmps probs = NULL;