Hello community, here is the log from the commit of package pyalsa for openSUSE:Factory checked in at 2015-03-01 14:47:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pyalsa (Old) and /work/SRC/openSUSE:Factory/.pyalsa.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pyalsa" Changes: -------- --- /work/SRC/openSUSE:Factory/pyalsa/pyalsa.changes 2013-03-04 17:33:47.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.pyalsa.new/pyalsa.changes 2015-03-01 14:47:07.000000000 +0100 @@ -1,0 +2,7 @@ +Thu Feb 26 17:36:52 CET 2015 - ti...@suse.de + +- Update to pyalsa 1.0.29: fixes included: + alsaseq: fix memory leaks + alsaseq: remove dead code in Sequencer_set_clientname() + +------------------------------------------------------------------- Old: ---- pyalsa-1.0.26.tar.bz2 New: ---- pyalsa-1.0.29.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pyalsa.spec ++++++ --- /var/tmp/diff_new_pack.B5fPoA/_old 2015-03-01 14:47:07.000000000 +0100 +++ /var/tmp/diff_new_pack.B5fPoA/_new 2015-03-01 14:47:07.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package pyalsa # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ Name: pyalsa BuildRequires: alsa-devel BuildRequires: python-devel -Version: 1.0.26 +Version: 1.0.29 Release: 0 Summary: Python ALSA binding License: LGPL-2.1+ and GPL-2.0 ++++++ pyalsa-1.0.26.tar.bz2 -> pyalsa-1.0.29.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.0.26/PKG-INFO new/pyalsa-1.0.29/PKG-INFO --- old/pyalsa-1.0.26/PKG-INFO 2012-09-06 10:47:38.000000000 +0200 +++ new/pyalsa-1.0.29/PKG-INFO 2015-02-26 13:47:45.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: pyalsa -Version: 1.0.26 +Version: 1.0.29 Summary: UNKNOWN Home-page: UNKNOWN Author: The ALSA Team diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.0.26/pyalsa/alsaseq.c new/pyalsa-1.0.29/pyalsa/alsaseq.c --- old/pyalsa-1.0.26/pyalsa/alsaseq.c 2012-09-06 09:52:57.000000000 +0200 +++ new/pyalsa-1.0.29/pyalsa/alsaseq.c 2015-02-26 13:36:18.000000000 +0100 @@ -124,7 +124,9 @@ if (PyModule_AddObject(module, name, tmp) < 0) { \ return; \ } \ - PyDict_SetItem(TDICT(subtype), PyInt_FromLong(value), tmp); \ + PyObject *key = PyInt_FromLong(value); \ + PyDict_SetItem(TDICT(subtype), key, tmp); \ + Py_DECREF(key); \ } #define TCONSTRETURN(subtype, value) { \ @@ -199,8 +201,11 @@ PyDict_SetItemString(dict, name, object) /* sets a integer into the dict */ -#define SETDICTINT(name, value) \ - PyDict_SetItemString(dict, name, PyInt_FromLong(value)) +#define SETDICTINT(name, value) { \ + PyObject *val = PyInt_FromLong(value); \ + PyDict_SetItemString(dict, name, val); \ + Py_DECREF(val); \ + } /* sets note info dict (used by SeqEvent_get_data) */ #define SETDICT_NOTE3 { \ @@ -288,6 +293,7 @@ PyList_SetItem(list, i, PyInt_FromLong(t[i])); \ } \ SETDICTOBJ("ext", list); \ + Py_DECREF(list); \ } /* gets integer from python param */ @@ -1767,7 +1773,7 @@ return PyString_FromFormat("<alsaseq.SeqEvent type=%s(%d) flags=%d tag=%d " "queue=%d time=%s(%u.%u) from=%d:%d to=%d:%d " - "at 0x%p>", + "at %p>", typestr, self->event->type, self->event->flags, self->event->tag, self->event->queue, @@ -2163,12 +2169,8 @@ static int Sequencer_set_clientname(SequencerObject *self, PyObject *val) { - char *buff; - SETCHECKPYSTR("clientname", val); - buff = PyString_AsString(val); - snd_seq_set_client_name(self->handle, PyString_AsString(val)); return 0; @@ -2371,34 +2373,23 @@ PyObject *list = PyList_New(0); int index = 0; - long tmplong; snd_seq_query_subscribe_set_type(query, type); snd_seq_query_subscribe_set_index(query, index); while (snd_seq_query_port_subscribers(handle, query) >= 0) { const snd_seq_addr_t *addr = snd_seq_query_subscribe_get_addr(query); - PyObject *dict = PyDict_New(); - - tmplong = snd_seq_query_subscribe_get_queue(query); - PyDict_SetItemString(dict, "queue", PyInt_FromLong(tmplong)); - - tmplong = snd_seq_query_subscribe_get_exclusive(query); - PyDict_SetItemString(dict, "exclusive", PyInt_FromLong(tmplong)); - - tmplong = snd_seq_query_subscribe_get_time_update(query); - PyDict_SetItemString(dict, "time_update", PyInt_FromLong(tmplong)); - - tmplong = snd_seq_query_subscribe_get_time_real(query); - PyDict_SetItemString(dict, "time_real", PyInt_FromLong(tmplong)); - - - PyObject *tuple = PyTuple_New(3); - PyTuple_SetItem(tuple, 0, PyInt_FromLong(addr->client)); - PyTuple_SetItem(tuple, 1, PyInt_FromLong(addr->port)); - PyTuple_SetItem(tuple, 2, dict); + PyObject *tuple = Py_BuildValue( + "(ii{sisisisi})", + (int)addr->client, + (int)addr->port, + "queue", (int)snd_seq_query_subscribe_get_queue(query), + "exclusive", (int)snd_seq_query_subscribe_get_exclusive(query), + "time_update", (int)snd_seq_query_subscribe_get_time_update(query), + "time_real", (int)snd_seq_query_subscribe_get_time_real(query)); PyList_Append(list, tuple); + Py_DECREF(tuple); snd_seq_query_subscribe_set_index(query, ++index); } return list; @@ -2470,11 +2461,13 @@ PyTuple_SetItem(porttuple, 2, conntuple); PyList_Append(portlist, porttuple); + Py_DECREF(porttuple); } PyTuple_SetItem(tuple, 2, portlist); /* append list of port tuples */ PyList_Append(list, tuple); + Py_DECREF(tuple); } return list; @@ -2510,9 +2503,6 @@ snd_seq_client_info_t *cinfo; int client_id = -1; int ret; - PyObject *tmpobj; - long tmplong; - const char * tmpchar; char *kwlist[] = { "client_id", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "|i", kwlist, @@ -2536,37 +2526,21 @@ } } - PyObject *dict = PyDict_New(); - if (dict == NULL) { - return NULL; - } - - TCONSTASSIGN(ADDR_CLIENT, client_id, tmpobj); - PyDict_SetItemString(dict, "id", tmpobj); - - tmplong = snd_seq_client_info_get_type(cinfo); - TCONSTASSIGN(CLIENT_TYPE, tmplong, tmpobj); - PyDict_SetItemString(dict, "type", tmpobj); - - tmpchar = snd_seq_client_info_get_name(cinfo); - tmpchar = (tmpchar == NULL ? "" : tmpchar); - PyDict_SetItemString(dict, "name", PyString_FromString(tmpchar)); - - tmplong = snd_seq_client_info_get_broadcast_filter(cinfo); - PyDict_SetItemString(dict, "broadcast_filter", PyInt_FromLong(tmplong)); - - tmplong = snd_seq_client_info_get_error_bounce(cinfo); - PyDict_SetItemString(dict, "error_bounce", PyInt_FromLong(tmplong)); - - tmpchar = (const char *)snd_seq_client_info_get_event_filter(cinfo); - tmpchar = (tmpchar == NULL ? "" : tmpchar); - PyDict_SetItemString(dict, "event_filter", PyString_FromString(tmpchar)); - - tmplong = snd_seq_client_info_get_num_ports(cinfo); - PyDict_SetItemString(dict, "num_ports", PyInt_FromLong(tmplong)); - - tmplong = snd_seq_client_info_get_event_lost(cinfo); - PyDict_SetItemString(dict, "event_lost", PyInt_FromLong(tmplong)); + PyObject *d_id, *d_type; + TCONSTASSIGN(ADDR_CLIENT, client_id, d_id); + TCONSTASSIGN(CLIENT_TYPE, snd_seq_client_info_get_type(cinfo), d_type); + const char *d_name = snd_seq_client_info_get_name(cinfo); + + PyObject *dict = Py_BuildValue( + "{sNsNsssisiss#sisi}", + "id", d_id, + "type", d_type, + "name", d_name == NULL ? "" : d_name, + "broadcast_filter", (int)snd_seq_client_info_get_broadcast_filter(cinfo), + "error_bounce", (int)snd_seq_client_info_get_error_bounce(cinfo), + "event_filter", snd_seq_client_info_get_event_filter(cinfo), 32, + "num_ports", (int)snd_seq_client_info_get_num_ports(cinfo), + "event_lost", (int)snd_seq_client_info_get_event_lost(cinfo)); return dict; } @@ -2598,8 +2572,6 @@ snd_seq_client_info_t *cinfo; int port_id; int client_id; - const char *tmpchar; - long tmplong; int ret; char *kwlist[] = { "port_id", "client_id", NULL }; @@ -2616,11 +2588,6 @@ return NULL; } - PyObject *dict = PyDict_New(); - if (dict == NULL) { - return NULL; - } - snd_seq_port_info_alloca(&pinfo); ret = snd_seq_get_any_port_info(self->handle, client_id, port_id, pinfo); @@ -2629,17 +2596,11 @@ return NULL; } - tmpchar = snd_seq_port_info_get_name(pinfo); - tmpchar = (tmpchar == NULL ? "" : tmpchar); - PyDict_SetItemString(dict, "name", PyString_FromString(tmpchar)); - - tmplong = snd_seq_port_info_get_capability(pinfo); - PyDict_SetItemString(dict, "capability", PyInt_FromLong(tmplong)); - - tmplong = snd_seq_port_info_get_type(pinfo); - PyDict_SetItemString(dict, "type", PyInt_FromLong(tmplong)); - - return dict; + return Py_BuildValue( + "{sssIsI}", + "name", snd_seq_port_info_get_name(pinfo), + "capability", (unsigned int)snd_seq_port_info_get_capability(pinfo), + "type", (unsigned int)snd_seq_port_info_get_type(pinfo)); } /** alsaseq.Sequencer connect_ports() method: __doc__ */ @@ -2772,7 +2733,6 @@ snd_seq_addr_t sender, dest; snd_seq_port_subscribe_t *sinfo; int ret; - long tmplong; if (!PyArg_ParseTuple(args, "(BB)(BB)", &(sender.client), &(sender.port), &(dest.client), &(dest.port))) { @@ -2790,21 +2750,12 @@ return NULL; } - PyObject *dict = PyDict_New(); - - tmplong = snd_seq_port_subscribe_get_queue(sinfo); - PyDict_SetItemString(dict, "queue", PyInt_FromLong(tmplong)); - - tmplong = snd_seq_port_subscribe_get_exclusive(sinfo); - PyDict_SetItemString(dict, "exclusive", PyInt_FromLong(tmplong)); - - tmplong = snd_seq_port_subscribe_get_time_update(sinfo); - PyDict_SetItemString(dict, "time_update", PyInt_FromLong(tmplong)); - - tmplong = snd_seq_port_subscribe_get_time_real(sinfo); - PyDict_SetItemString(dict, "time_real", PyInt_FromLong(tmplong)); - - return dict; + return Py_BuildValue( + "{sisisisi}", + "queue", (int)snd_seq_port_subscribe_get_queue(sinfo), + "exclusive", (int)snd_seq_port_subscribe_get_exclusive(sinfo), + "time_update", (int)snd_seq_port_subscribe_get_time_update(sinfo), + "time_real", (int)snd_seq_port_subscribe_get_time_real(sinfo)); } /** alsaseq.Sequencer receive_events() method: __doc__ */ @@ -2882,6 +2833,7 @@ } PyList_Append(list, SeqEventObject); + Py_DECREF(SeqEventObject); maxevents --; @@ -3267,19 +3219,23 @@ if (count <= 0) Py_RETURN_NONE; - reg = PyObject_GetAttr(pollObj, PyString_InternFromString("register")); + reg = PyObject_GetAttrString(pollObj, "register"); + if (!reg) + return NULL; for (i = 0; i < count; i++) { t = PyTuple_New(2); - if (t) { - PyTuple_SET_ITEM(t, 0, PyInt_FromLong(pfd[i].fd)); - PyTuple_SET_ITEM(t, 1, PyInt_FromLong(pfd[i].events)); - Py_XDECREF(PyObject_CallObject(reg, t)); - Py_DECREF(t); + if (!t) { + Py_DECREF(reg); + return NULL; } + PyTuple_SET_ITEM(t, 0, PyInt_FromLong(pfd[i].fd)); + PyTuple_SET_ITEM(t, 1, PyInt_FromLong(pfd[i].events)); + Py_XDECREF(PyObject_CallObject(reg, t)); + Py_DECREF(t); } - Py_XDECREF(reg); + Py_DECREF(reg); Py_RETURN_NONE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.0.26/setup.py new/pyalsa-1.0.29/setup.py --- old/pyalsa-1.0.26/setup.py 2012-09-06 09:52:57.000000000 +0200 +++ new/pyalsa-1.0.29/setup.py 2015-02-26 13:36:18.000000000 +0100 @@ -3,66 +3,75 @@ import os import sys +import stat try: - from setuptools import setup, Extension + from setuptools import setup, Extension except ImportError: - from distutils.core import setup, Extension + from distutils.core import setup, Extension -VERSION='1.0.26' +VERSION='1.0.29' if os.path.exists("version"): - fp = open("version", "r") - ver = fp.readline() - fp.close() - ver = ver[:-1] + fp = open("version", "r") + ver = fp.readline()[:-1] + fp.close() else: - ver = None + ver = None if ver != VERSION: - fp = open("version", "w+") - fp.write(VERSION + '\n') - fp.close() + fp = open("version", "w+") + fp.write(VERSION + '\n') + fp.close() del fp + setup( - name='pyalsa', - version=VERSION, - author="The ALSA Team", - author_email='alsa-de...@alsa-project.org', - ext_modules=[ - Extension('pyalsa.alsacard', - ['pyalsa/alsacard.c'], - include_dirs=[], - library_dirs=[], - libraries=['asound']), - Extension('pyalsa.alsacontrol', - ['pyalsa/alsacontrol.c'], - include_dirs=[], - library_dirs=[], - libraries=['asound']), - Extension('pyalsa.alsahcontrol', - ['pyalsa/alsahcontrol.c'], - include_dirs=[], - library_dirs=[], - libraries=['asound']), - Extension('pyalsa.alsamixer', - ['pyalsa/alsamixer.c'], - include_dirs=[], - library_dirs=[], - libraries=['asound']), - Extension('pyalsa.alsaseq', - ['pyalsa/alsaseq.c'], - include_dirs=[], - library_dirs=[], - libraries=['asound']), - ], - packages=['pyalsa'], - scripts=[] + name='pyalsa', + version=VERSION, + author="The ALSA Team", + author_email='alsa-de...@alsa-project.org', + ext_modules=[ + Extension('pyalsa.alsacard', + ['pyalsa/alsacard.c'], + include_dirs=[], + library_dirs=[], + libraries=['asound']), + Extension('pyalsa.alsacontrol', + ['pyalsa/alsacontrol.c'], + include_dirs=[], + library_dirs=[], + libraries=['asound']), + Extension('pyalsa.alsahcontrol', + ['pyalsa/alsahcontrol.c'], + include_dirs=[], + library_dirs=[], + libraries=['asound']), + Extension('pyalsa.alsamixer', + ['pyalsa/alsamixer.c'], + include_dirs=[], + library_dirs=[], + libraries=['asound']), + Extension('pyalsa.alsaseq', + ['pyalsa/alsaseq.c'], + include_dirs=[], + library_dirs=[], + libraries=['asound']), + ], + packages=['pyalsa'], + scripts=[] ) uname = os.uname() a = 'build/lib.%s-%s-%s' % (uname[0].lower(), uname[4], sys.version[:3]) -for f in ['alsacard.so', 'alsacontrol.so', 'alsahcontrol.so', 'alsamixer.so', 'alsaseq.so']: - if not os.path.exists('pyalsa/%s' % f): - a = '../build/lib.%s-%s-%s/pyalsa/%s' % (uname[0].lower(), - uname[4], sys.version[:3], f) - print a, f - os.symlink(a, 'pyalsa/%s' % f) +for f in ['alsacard.so', 'alsacontrol.so', 'alsahcontrol.so', + 'alsamixer.so', 'alsaseq.so']: + if not os.path.exists('pyalsa/%s' % f): + a = '../build/lib.%s-%s-%s/pyalsa/%s' % \ + (uname[0].lower(), uname[4], sys.version[:3], f) + print a, f + p = 'pyalsa/' + f + try: + st = os.lstat(p) + if stat.S_ISLNK(st.st_mode): + os.remove(p) + except: + pass + os.symlink(a, 'pyalsa/%s' % f) -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org