commit 5ce04bfd5ba3afd614fc99a543f87abba3397f25 Author: Arkadiusz Miśkiewicz <ar...@maven.pl> Date: Wed Mar 12 19:47:00 2014 +0100
- rel 2; raise exceptions in python bindings libapparmor-python-exception.patch | 27 +++++++++++++++++++++++++++ libapparmor.spec | 4 +++- 2 files changed, 30 insertions(+), 1 deletion(-) --- diff --git a/libapparmor.spec b/libapparmor.spec index dabafdc..efe9127 100644 --- a/libapparmor.spec +++ b/libapparmor.spec @@ -3,12 +3,13 @@ Summary: Library to provide key AppArmor symbols Summary(pl.UTF-8): Biblioteka udostępniająca kluczowe symbole AppArmor Name: libapparmor Version: 2.8.3 -Release: 1 +Release: 2 Epoch: 1 License: LGPL v2.1 Group: Libraries Source0: http://launchpad.net/apparmor/2.8/%{version}/+download/apparmor-%{version}.tar.gz # Source0-md5: 43586e5096606e857fef45c49553e468 +Patch0: %{name}-python-exception.patch URL: http://apparmor.wiki.kernel.org/ BuildRequires: autoconf BuildRequires: automake >= 1.4 @@ -114,6 +115,7 @@ Dowiązania do AppArmor dla języka Ruby. %prep %setup -q -n apparmor-%{version} +%patch0 -p0 %build cd libraries/libapparmor diff --git a/libapparmor-python-exception.patch b/libapparmor-python-exception.patch new file mode 100644 index 0000000..ce23c4a --- /dev/null +++ b/libapparmor-python-exception.patch @@ -0,0 +1,27 @@ +=== modified file 'libraries/libapparmor/swig/SWIG/libapparmor.i' +--- libraries/libapparmor/swig/SWIG/libapparmor.i 2014-01-06 22:08:55 +0000 ++++ libraries/libapparmor/swig/SWIG/libapparmor.i 2014-03-07 19:54:12 +0000 +@@ -9,6 +9,16 @@ + %include "typemaps.i" + %include <aalogparse.h> + ++#ifdef SWIGPYTHON ++%exception { ++ $action ++ if (result < 0) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ return NULL; ++ } ++} ++#endif ++ + /* swig doesn't like the macro magic we do in apparmor.h so the fn prototypes + * are manually inserted here + */ +@@ -37,3 +37,5 @@ + extern int aa_getcon(char **con, char **mode); + extern int aa_getpeercon_raw(int fd, char *buffer, int *size); + extern int aa_getpeercon(int fd, char **con); ++ ++%exception; + ================================================================ ---- gitweb: http://git.pld-linux.org/gitweb.cgi/packages/libapparmor.git/commitdiff/5ce04bfd5ba3afd614fc99a543f87abba3397f25 _______________________________________________ pld-cvs-commit mailing list pld-cvs-commit@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit