[setools/f13/master] - Return None when no records match python setools.sesearch

Daniel J Walsh dwalsh at fedoraproject.org
Thu Oct 14 18:25:59 UTC 2010


commit 26a5d87ff2d2a51c4a4e3c5ca3352044338f4631
Author: Dan Walsh <dwalsh at redhat.com>
Date:   Thu Oct 14 14:25:53 2010 -0400

    - Return None when no records match python setools.sesearch

 setools-python.patch |   55 ++++++++++++++++++++++++++++++++++++++++++++++---
 setools.spec         |    8 ++++++-
 2 files changed, 58 insertions(+), 5 deletions(-)
---
diff --git a/setools-python.patch b/setools-python.patch
index 804981e..01cb56a 100644
--- a/setools-python.patch
+++ b/setools-python.patch
@@ -1,6 +1,51 @@
 diff -up setools-3.3.7/configure.ac.python setools-3.3.7/configure.ac
 --- setools-3.3.7/configure.ac.python	2010-04-30 10:25:48.000000000 -0400
 +++ setools-3.3.7/configure.ac	2010-07-30 15:02:10.000000000 -0400
+@@ -194,7 +194,7 @@ AC_ARG_ENABLE(swig-java,
+               enable_jswig="$enableval")
+ if test "x${enable_jswig}" = xyes; then
+    if test ${do_swigify} = no; then
+-      AC_PROG_SWIG(1.3.28)
++      AC_PROG_SWIG(2.0.0)
+    fi
+    AC_JAVA_OPTIONS
+    if test "x$JAVAPREFIX" = x; then
+@@ -216,21 +216,23 @@ if test "x${enable_jswig}" = xyes; then
+    do_swigify_java=yes
+    do_swigify=yes
+ fi
++
++AM_PATH_PYTHON(2.7)
++
+ AC_ARG_ENABLE(swig-python,
+               AC_HELP_STRING([--enable-swig-python],
+                              [build SWIG interfaces for Python]),
+               enable_pyswig="$enableval")
+ if test "x${enable_pyswig}" = xyes; then
+    if test ${do_swigify} = no; then
+-      AC_PROG_SWIG(1.3.28)
++      AC_PROG_SWIG(2.0.0)
+    fi
+-   AM_PATH_PYTHON(2.3)
+    SWIG_PYTHON
+    do_swigify_python=yes
+    do_swigify=yes
+ fi
+ if test ${do_swigify} = "yes"; then
+-   AC_PROG_SWIG(1.3.28)
++   AC_PROG_SWIG(2.0.0)
+ fi
+ build_apol=yes
+ AC_ARG_ENABLE(swig-tcl,
+@@ -239,7 +241,7 @@ AC_ARG_ENABLE(swig-tcl,
+               enable_tclswig="$enableval", enable_tclswig="yes")
+ if test "x${enable_tclswig}" = xyes; then
+    if test ${do_swigify} = no; then
+-      AC_PROG_SWIG(1.3.28)
++      AC_PROG_SWIG(2.0.0)
+    fi
+    TEA_INIT(3.5)
+    TEA_PATH_TCLCONFIG
 @@ -888,6 +890,8 @@ AC_CONFIG_FILES([Makefile VERSION \
                   sediff/Makefile \
                   man/Makefile \
@@ -2191,8 +2236,8 @@ diff -up setools-3.3.7/python/setools/seinfo.c.python setools-3.3.7/python/setoo
 +}
 diff -up setools-3.3.7/python/setools/sesearch.c.python setools-3.3.7/python/setools/sesearch.c
 --- setools-3.3.7/python/setools/sesearch.c.python	2010-07-30 15:02:10.000000000 -0400
-+++ setools-3.3.7/python/setools/sesearch.c	2010-07-30 15:02:10.000000000 -0400
-@@ -0,0 +1,477 @@
++++ setools-3.3.7/python/setools/sesearch.c	2010-10-14 11:04:53.000000000 -0400
+@@ -0,0 +1,479 @@
 +// Author: Thomas Liu <tliu at redhat.com>
 +
 +/**
@@ -2611,6 +2656,7 @@ diff -up setools-3.3.7/python/setools/sesearch.c.python setools-3.3.7/python/set
 +		goto cleanup;
 +	}
 +	if (v) {
++		printf("Dan 1\n");
 +		output =  get_av_results(policy, &cmd_opts, v);
 +	}
 +	apol_vector_destroy(&v);
@@ -2626,8 +2672,9 @@ diff -up setools-3.3.7/python/setools/sesearch.c.python setools-3.3.7/python/set
 +	free(cmd_opts.tgt_role_name);
 +	apol_vector_destroy(&cmd_opts.perm_vector);
 +	apol_vector_destroy(&cmd_opts.class_vector);
-+	
-+	return output;
++
++	if (output) return output;
++	return Py_None;
 +}
 +static int Dict_ContainsInt(PyObject *dict, const char *key){
 +    PyObject *item = PyDict_GetItemString(dict, key);
diff --git a/setools.spec b/setools.spec
index 9dae959..6d8e2b6 100644
--- a/setools.spec
+++ b/setools.spec
@@ -5,7 +5,7 @@
 
 Name: setools
 Version: %{setools_maj_ver}.%{setools_min_ver}
-Release: 7%{?dist}
+Release: 8%{?dist}
 License: GPLv2
 URL: http://oss.tresys.com/projects/setools
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -188,6 +188,9 @@ This package includes the following graphical tools:
 %setup -q
 %patch1 -p 1 -b .python
 
+# Fixup expected version of SWIG:
+sed -i -e "s|AC_PROG_SWIG(1.3.28)|AC_PROG_SWIG(2.0.0)|g" configure.ac
+# and rebuild the configure script:
 autoconf
 
 
@@ -350,6 +353,9 @@ rm -rf ${RPM_BUILD_ROOT}
 %postun libs-tcl -p /sbin/ldconfig
 
 %changelog
+* Thu Oct 14 2010 Dan Walsh <dwalsh at redhat.com> 3.3.6-8
+- Return None when no records match python setools.sesearch
+
 * Thu Aug 19 2010 Dan Walsh <dwalsh at redhat.com> 3.3.6-7
 - Add range to ports in seinfo python
 


More information about the scm-commits mailing list