[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rpmorg-maint
Subject:    [Rpm-maint] [PATCH 1/2] Add a getter for the source header.
From:       ebiederm () xmission ! com (Eric W !  Biederman)
Date:       2010-10-10 14:35:31
Message-ID: m18w26yv2k.fsf () fess ! ebiederm ! org
[Download RAW message or body]


It appears the access to the source header has started to get buried
into usability so add an getter so the implementation can change a
little without breaking callers.

---
 build/rpmbuild.h |    8 ++++++++
 build/spec.c     |    7 ++++++-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/build/rpmbuild.h b/build/rpmbuild.h
index adda6e9..d3e82ff 100644
--- a/build/rpmbuild.h
+++ b/build/rpmbuild.h
@@ -75,6 +75,14 @@ rpmSpec rpmSpecParse(const char *specFile, rpmSpecFlags flags,
 		     const char *buildRoot);
 
 /** \ingroup rpmbuild
+ * Return the headers of the SRPM that would be built from the spec file
+ *
+ * @param specFile	path to spec file
+ * @return		Header
+ */
+Header rpmSpecSourceHeader(rpmSpec spec);
+
+/** \ingroup rpmbuild
  * Verify build depencies of a spec against.
  * @param ts		(empty) transaction set
  * @param spec		parsed spec control structure
diff --git a/build/spec.c b/build/spec.c
index 16b2761..31163e9 100644
--- a/build/spec.c
+++ b/build/spec.c
@@ -312,6 +312,11 @@ rpmSpec rpmSpecFree(rpmSpec spec)
     return spec;
 }
 
+Header rpmSpecSourceHeader(rpmSpec spec)
+{
+	return spec->sourceHeader;
+}
+
 rpmds rpmSpecDS(rpmSpec spec, rpmTag tag)
 {
     return (spec != NULL) ? rpmdsNew(spec->buildRestrictions, tag, 0) : NULL;
@@ -323,7 +328,7 @@ rpmps rpmSpecCheckDeps(rpmts ts, rpmSpec spec)
 
     rpmtsEmpty(ts);
 
-    rpmtsAddInstallElement(ts, spec->sourceHeader, NULL, 0, NULL);
+    rpmtsAddInstallElement(ts, rpmSpecSourceHeader(spec), NULL, 0, NULL);
     rpmtsCheck(ts);
     probs = rpmtsProblems(ts);
 
-- 
1.7.3.1


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic