[Rpm-maint] PATCH: Add missing %check section to python bindings.

Alec Leamas leamas.alec at gmail.com
Tue Aug 27 17:18:51 UTC 2013


Heading and comments says it all: For some reason the check attribute 
corresponding to the %check section is missing from the python 
interface. Patch below have been tested and works OK.

--alec

 From 03ce8e6de44257dcaccb1e99cdff2e11fe217ee7 Mon Sep 17 00:00:00 2001
From: Alec Leamas <alec at nowhere.net>
Date: Tue, 27 Aug 2013 19:04:53 +0200
Subject: [PATCH] python: export also the %checks section.

The C code exports all valid sections: prep, build, install, check, clean
etc.  However, the check section is missing from the python interface.
Patch fixes this in simplest possible way (?).
---
  python/spec-py.c | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/python/spec-py.c b/python/spec-py.c
index 1850a50..e0157a0 100644
--- a/python/spec-py.c
+++ b/python/spec-py.c
@@ -144,6 +144,11 @@ static PyObject * spec_get_install(specObject * s, 
void *closure)
      return getSection(s->spec, RPMBUILD_INSTALL);
  }

+static PyObject * spec_get_check(specObject * s, void *closure)
+{
+    return getSection(s->spec, RPMBUILD_CHECK);
+}
+
  static PyObject * spec_get_clean(specObject * s, void *closure)
  {
      return getSection(s->spec, RPMBUILD_CLEAN);
@@ -217,6 +222,7 @@ static PyGetSetDef spec_getseters[] = {
      {"prep",   (getter) spec_get_prep, NULL, NULL },
      {"build",   (getter) spec_get_build, NULL, NULL },
      {"install",   (getter) spec_get_install, NULL, NULL },
+    {"check",   (getter) spec_get_check, NULL, NULL },
      {"clean",   (getter) spec_get_clean, NULL, NULL },
      {"packages", (getter) spec_get_packages, NULL, NULL },
      {"sourceHeader", (getter) spec_get_source_header, NULL, NULL },
-- 
1.8.1.4



More information about the Rpm-maint mailing list