- Pretty dumb and all, but to avoid breaking some python users
(some folks apparently have found /some/ use for these...)
int rpmSpecSrcNum(rpmSpecSrc src);
const char * rpmSpecSrcFilename(rpmSpecSrc src, int full);
+/* Retrieve parsed spec script section (RPMBUILD_PREP, RPMBUILD_BUILD etc) */
+const char * rpmSpecGetSection(rpmSpec spec, int section);
+
/** \ingroup rpmbuild
* Function to query spec file(s).
* @param ts transaction set
return source;
}
+const char * rpmSpecGetSection(rpmSpec spec, int section)
+{
+ if (spec) {
+ switch (section) {
+ case RPMBUILD_PREP: return getStringBuf(spec->prep);
+ case RPMBUILD_BUILD: return getStringBuf(spec->build);
+ case RPMBUILD_INSTALL: return getStringBuf(spec->install);
+ case RPMBUILD_CHECK: return getStringBuf(spec->check);
+ case RPMBUILD_CLEAN: return getStringBuf(spec->clean);
+ }
+ }
+ return NULL;
+}
+
int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg)
{
rpmSpec spec = NULL;