[zypp-devel] libzypp-bindings: callbacks support Python

Hi Klaus and all, Does callbacks works for python in libzypp-bindings? I have just used the test code(swig/python/tests/commit_callbacks.py), but it seems don't work and CommitReceiver have never been called. Do you know what's the root cause? Thanks In advance. Qiang

Hi Qiang, * Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 08. 2011 03:16]:
Hi Klaus and all,
Does callbacks works for python in libzypp-bindings?
sure, at least they worked when I tested them back in January.
I have just used the test code(swig/python/tests/commit_callbacks.py), but it seems don't work and CommitReceiver have never been called. Do you know what's the root cause?
Are you using the latest bindings ? Against which version of libzypp ? Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org

I am using libzypp-binding 0.5.8, and I have tried libzypp 8.8.0 and 9.8.3, but they all don’t work. I 'll try the January version later. Thanks Qiang -----Original Message----- From: Klaus Kaempf [mailto:kkaempf@suse.de] Sent: Monday, August 08, 2011 3:45 PM To: Zhang, Qiang Z Cc: zypp-devel@opensuse.org Subject: Re: libzypp-bindings: callbacks support Python Hi Qiang, * Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 08. 2011 03:16]:
Hi Klaus and all,
Does callbacks works for python in libzypp-bindings?
sure, at least they worked when I tested them back in January.
I have just used the test code(swig/python/tests/commit_callbacks.py), but it seems don't work and CommitReceiver have never been called. Do you know what's the root cause?
Are you using the latest bindings ? Against which version of libzypp ? Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany

* Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 08. 2011 16:38]:
I am using libzypp-binding 0.5.8, and I have tried libzypp 8.8.0 and 9.8.3, but they all don’t work.
Confirmed :-( Sorry for the breakage. Looks like libzypp 8.x changed its signal/slot API used by the commit callbacks. Last time I checked was with libzypp 7.x from openSUSE 11.3 Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org

* Klaus Kaempf <kkaempf@suse.de> [Aug 09. 2011 13:52]:
* Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 08. 2011 16:38]:
I am using libzypp-binding 0.5.8, and I have tried libzypp 8.8.0 and 9.8.3, but they all don’t work.
Fixed now in git. (git://github.com/openSUSE/libzypp-bindings.git - was moved from gitorious.org to github.com last week !) Not all callbacks are fully supported currently. I'll work on this as I find time during the next days. Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org

That's great, I 'll have a try, and waiting for your full callbacks support patches. Thanks again. Qiang -----Original Message----- From: Klaus Kaempf [mailto:kkaempf@suse.de] Sent: Tuesday, August 09, 2011 10:20 PM To: Zhang, Qiang Z Cc: zypp-devel@opensuse.org Subject: [zypp-devel] Re: libzypp-bindings: callbacks support Python * Klaus Kaempf <kkaempf@suse.de> [Aug 09. 2011 13:52]:
* Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 08. 2011 16:38]:
I am using libzypp-binding 0.5.8, and I have tried libzypp 8.8.0 and 9.8.3, but they all don’t work.
Fixed now in git. (git://github.com/openSUSE/libzypp-bindings.git - was moved from gitorious.org to github.com last week !) Not all callbacks are fully supported currently. I'll work on this as I find time during the next days. Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org

Hi Klaus, I have tried call back feature in libzypp-bindings. It works, but Segmentation fault occurs. Here's logs: ---- [root@xq-desktop libzypp]# python commit_callbacks.py Emitting removal of gedit Starting to remove gedit Remove of gedit at 100 % Remove of gedit at 5 % Remove of gedit at 50 % Remove of gedit at 100 % Remove finished Segmentation fault (core dumped) ---- Attached is my test code. My libzypp version is libzypp-8.8.0. Thanks Qiang -----Original Message----- From: Zhang, Qiang Z [mailto:qiang.z.zhang@intel.com] Sent: Wednesday, August 10, 2011 4:06 PM To: Klaus Kaempf Cc: zypp-devel@opensuse.org Subject: RE: [zypp-devel] Re: libzypp-bindings: callbacks support Python That's great, I 'll have a try, and waiting for your full callbacks support patches. Thanks again. Qiang -----Original Message----- From: Klaus Kaempf [mailto:kkaempf@suse.de] Sent: Tuesday, August 09, 2011 10:20 PM To: Zhang, Qiang Z Cc: zypp-devel@opensuse.org Subject: [zypp-devel] Re: libzypp-bindings: callbacks support Python * Klaus Kaempf <kkaempf@suse.de> [Aug 09. 2011 13:52]:
* Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 08. 2011 16:38]:
I am using libzypp-binding 0.5.8, and I have tried libzypp 8.8.0 and 9.8.3, but they all don’t work.
Fixed now in git. (git://github.com/openSUSE/libzypp-bindings.git - was moved from gitorious.org to github.com last week !) Not all callbacks are fully supported currently. I'll work on this as I find time during the next days. Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org �{.n�+�������*iu�ޗ맲��r��z�^�ˬz����uح��ڕ�&��ݱ隊\�^��~��i�������

We are trying to use call back feature in micng (next generation of mic2), so could you please feel free to help to implement install call back, which has not been implemented yet. Thanks Qiang -----Original Message----- From: Zhang, Qiang Z Sent: Tuesday, August 30, 2011 11:28 AM To: Zhang, Qiang Z; Klaus Kaempf Cc: zypp-devel@opensuse.org Subject: RE: [zypp-devel] Re: libzypp-bindings: callbacks support Python Hi Klaus, I have tried call back feature in libzypp-bindings. It works, but Segmentation fault occurs. Here's logs: ---- [root@xq-desktop libzypp]# python commit_callbacks.py Emitting removal of gedit Starting to remove gedit Remove of gedit at 100 % Remove of gedit at 5 % Remove of gedit at 50 % Remove of gedit at 100 % Remove finished Segmentation fault (core dumped) ---- Attached is my test code. My libzypp version is libzypp-8.8.0. Thanks Qiang -----Original Message----- From: Zhang, Qiang Z [mailto:qiang.z.zhang@intel.com] Sent: Wednesday, August 10, 2011 4:06 PM To: Klaus Kaempf Cc: zypp-devel@opensuse.org Subject: RE: [zypp-devel] Re: libzypp-bindings: callbacks support Python That's great, I 'll have a try, and waiting for your full callbacks support patches. Thanks again. Qiang -----Original Message----- From: Klaus Kaempf [mailto:kkaempf@suse.de] Sent: Tuesday, August 09, 2011 10:20 PM To: Zhang, Qiang Z Cc: zypp-devel@opensuse.org Subject: [zypp-devel] Re: libzypp-bindings: callbacks support Python * Klaus Kaempf <kkaempf@suse.de> [Aug 09. 2011 13:52]:
* Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 08. 2011 16:38]:
I am using libzypp-binding 0.5.8, and I have tried libzypp 8.8.0 and 9.8.3, but they all don’t work.
Fixed now in git. (git://github.com/openSUSE/libzypp-bindings.git - was moved from gitorious.org to github.com last week !) Not all callbacks are fully supported currently. I'll work on this as I find time during the next days. Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org {.n + *iu ޗ맲 r z ^ ˬz uح ڕ & ݱ隊\ ^ ~ i

* Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 30. 2011 05:35]:
We are trying to use call back feature in micng (next generation of mic2), so could you please feel free to help to implement install call back, which has not been implemented yet.
The install callbacks are implemented now. Please "git pull" from github.com:openSUSE/libzypp-bindings.git Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org

Hi Klaus, Sorry to interrupt you again, I encounter another issue about libzypp-bindings. Here's our python code: for item in self.Z.pool(): kind = "%s" % item.kind() if kind == "package": resolvable = item.resolvable() provides = resolvable.provides() for cap in provides: # Don't work, with error " 'Capabilities' object is not iterable" print cap.c_str() # This should be the Capability name, right? and I have checked the code and found it's not implemented. Could you please help to implement the iterate function? And perl and ruby already have this feature. Thanks in advance. Qiang -----Original Message----- From: Klaus Kaempf [mailto:kkaempf@suse.de] Sent: Tuesday, August 30, 2011 10:43 PM To: Zhang, Qiang Z Cc: zypp-devel@opensuse.org Subject: Re: [zypp-devel] Re: libzypp-bindings: callbacks support Python * Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 30. 2011 05:35]:
We are trying to use call back feature in micng (next generation of mic2), so could you please feel free to help to implement install call back, which has not been implemented yet.
The install callbacks are implemented now. Please "git pull" from github.com:openSUSE/libzypp-bindings.git Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany

* Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 30. 2011 05:27]:
Hi Klaus,
I have tried call back feature in libzypp-bindings. It works, but Segmentation fault occurs.
Ouch! Can you send a gdb backtrace of the resulting core ? I'll try to reproduce the segfault meanwhile. Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org

* Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 30. 2011 05:27]:
Hi Klaus,
I have tried call back feature in libzypp-bindings. It works, but Segmentation fault occurs. Here's logs:
I can reproduce the segfault meanwhile and it points to memory corruption within Python. :-( Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org

* Klaus Kaempf <kkaempf@suse.de> [Aug 30. 2011 15:20]:
* Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 30. 2011 05:27]:
Hi Klaus,
I have tried call back feature in libzypp-bindings. It works, but Segmentation fault occurs. Here's logs:
I can reproduce the segfault meanwhile and it points to memory corruption within Python. :-(
This seems related to SWIGs wrapping of commit() and an exception raised by commit(). If I ignore the exception by wrapping the call to commit() with try/except then no segfault is triggered. Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org

* Zhang, Qiang Z <qiang.z.zhang@intel.com> [Aug 30. 2011 05:27]:
Hi Klaus,
I have tried call back feature in libzypp-bindings. It works, but Segmentation fault occurs.
Ok, found it. 1. removal_progress must return True or False False means: abort the current action, True means continue 2. removal_problem must be defined in CommitReceiver to catch errors removal_problem must return "retry", "abort" or "ignore". The segfault appears if either "abort" or an unknown response is returned. Find a fixed callbacks.py attached. Enjoy, Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany
participants (2)
-
Klaus Kaempf
-
Zhang, Qiang Z