[zypp-devel] How to use libzypp-bindings to create a sysroot from a repo?
Hi, all i'm using libzypp-bindings to create an MeeGo sysroot, i know zypper command can do this. zypper --root /meego-sysroot ar http://repo.meego.com/MeeGo/builds/trunk/1.1.80.0.20101005.1/core/repos/ia32... core zypper --root /meego-sysroot install -t pattern meego-core zypper can do it, i believe libzypp-bindings also can do it, but unfortunately , i can't find a tutorial for this, so i only can read zypper and libzypp code to understand how to do it. I tried to do such a script: -----------Cut here---------------------- #! /usr/bin/python import sys import zypp zypp.KeyRing.setDefaultAccept( zypp.KeyRing.ACCEPT_UNSIGNED_FILE | zypp.KeyRing.ACCEPT_VERIFICATION_FAILED ) repoManagerOptions = zypp.RepoManagerOptions(zypp.Pathname("/meego-sysroot")) repoManager = zypp.RepoManager(repoManagerOptions) repoManager.addRepositories(zypp.Url("file:///home/yangyi/test.repo")) repos = repoManager.knownRepositories() for repo in repos: if not repo.enabled(): continue print "Build cache for repo %s" % repo.url() if not repoManager.isCached( repo ): repoManager.buildCache( repo, zypp.RepoManager.BuildIfNeeded ) repoManager.loadFromCache( repo ); Z = zypp.ZYppFactory_instance().getZYpp() Z.initializeTarget( zypp.Pathname("/zypper-root") ) Z.target().load(); sys.exit(0) --------------Cut here---------------------- $ cat test.repo [core] name=core enabled=1 autorefresh=0 baseurl=http://repo.meego.com/MeeGo/builds/trunk/1.1.80.0.20101005.1/core/repos/ia32... type=NONE keeppackages=0 $ When i run this script, the error is below: Traceback (most recent call last): File "list_resolvables.py", line 6, in <module> zypp.KeyRing.setDefaultAccept( zypp.KeyRing.ACCEPT_UNSIGNED_FILE | zypp.KeyRing.ACCEPT_VERIFICATION_FAILED ) TypeError: in method 'KeyRing_setDefaultAccept', argument 1 of type 'zypp::KeyRing::DefaultAccept' This is just a beginning, i want to install many packages and groups/patterns from a kickstart file into /meego-sysroot once, is it possible? anybody can give an sample to do this. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Thursday 14 October 2010 09:22:03 Yi Yang wrote:
Traceback (most recent call last): File "list_resolvables.py", line 6, in <module> zypp.KeyRing.setDefaultAccept( zypp.KeyRing.ACCEPT_UNSIGNED_FILE | zypp.KeyRing.ACCEPT_VERIFICATION_FAILED ) TypeError: in method 'KeyRing_setDefaultAccept', argument 1 of type 'zypp::KeyRing::DefaultAccept'
That's a bug in the bindings, we try to fix this ASAP. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Michael Andres <ma@suse.de> [Oct 14. 2010 13:22]:
On Thursday 14 October 2010 09:22:03 Yi Yang wrote:
Traceback (most recent call last): File "list_resolvables.py", line 6, in <module> zypp.KeyRing.setDefaultAccept( zypp.KeyRing.ACCEPT_UNSIGNED_FILE | zypp.KeyRing.ACCEPT_VERIFICATION_FAILED ) TypeError: in method 'KeyRing_setDefaultAccept', argument 1 of type 'zypp::KeyRing::DefaultAccept'
That's a bug in the bindings, we try to fix this ASAP.
Here libzypps strict typing gets into the way. zypp.KeyRing.ACCEPT_UNSIGNED_FILE refers to the DefaultAcceptBits enum and appears as Integer in Python. However, zypp.KeyRing.setDefaultAccept() expects a 'DefaultAccept' type and swig cannot sufficiently decode zypp/KeyRing.h to provide an automatic type conversion. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Klaus Kaempf <kkaempf@suse.de> [Oct 14. 2010 13:28]:
* Michael Andres <ma@suse.de> [Oct 14. 2010 13:22]:
That's a bug in the bindings, we try to fix this ASAP.
Here libzypps strict typing gets into the way. zypp.KeyRing.ACCEPT_UNSIGNED_FILE refers to the DefaultAcceptBits enum and appears as Integer in Python.
However, zypp.KeyRing.setDefaultAccept() expects a 'DefaultAccept' type and swig cannot sufficiently decode zypp/KeyRing.h to provide an automatic type conversion.
A quick solution is to provide an explicit type conversion function, e.g. %inline %{ zypp::KeyRing::DefaultAccept toDefaultAccept(int bits) { return (zypp::KeyRing::DefaultAccept) static_cast<zypp::KeyRing::DefaultAccept>(bits); } %} and use this in the sample code as zypp.KeyRing_setDefaultAccept(zypp.toDefaultAccept(zypp.KeyRing.ACCEPT_UNSIGNED_FILE | zypp.KeyRing.ACCEPT_VERIFICATION_FAILED) ) ^^^^^^^^^^^^^^^^^^^^ A more elaborate solution would involve SWIG typemaps (http://www.swig.org/Doc1.3/Typemaps.html) Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Tuesday 19 October 2010 13:55:47 Klaus Kaempf wrote:
A quick solution is to provide an explicit type conversion function, e.g.
Well, it looks like swig/python has some trouble to handle the DefaultAccept type at all (better said, I have trouble to tell swig how to handle it). It complains about possible memory leak and misssing dtor... So I finally fixed it by providing integer based versions of KeyRing::defaultAcceptBits / KeyRing::setDefaultAcceptBits. You need zypp bindings version -0.5.5 for this. This version will be available soon at: obs://zypp:Code11_3-Branch http://download.opensuse.org/repositories/zypp:/Code11_3-Branch/openSUSE_11.... obs://zypp:Head http://download.opensuse.org/repositories/zypp:/Head/openSUSE_Factory/ -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Thanks a lot, it does fix my issue.
-----Original Message----- From: Michael Andres [mailto:ma@suse.de] Sent: Wednesday, October 20, 2010 7:20 PM To: zypp-devel@opensuse.org Subject: Re: [zypp-devel] How to use libzypp-bindings to create a sysroot from a repo? (fixed in 0.5.5)
On Tuesday 19 October 2010 13:55:47 Klaus Kaempf wrote:
A quick solution is to provide an explicit type conversion function, e.g.
Well, it looks like swig/python has some trouble to handle the DefaultAccept type at all (better said, I have trouble to tell swig how to handle it). It complains about possible memory leak and misssing dtor...
So I finally fixed it by providing integer based versions of KeyRing::defaultAcceptBits / KeyRing::setDefaultAcceptBits. You need zypp bindings version -0.5.5 for this. This version will be available soon at:
obs://zypp:Code11_3-Branch http://download.opensuse.org/repositories/zypp:/Code11_3-Branch/openSUSE _11.3/
obs://zypp:Head http://download.opensuse.org/repositories/zypp:/Head/openSUSE_Factory/
--
cu, Michael Andres
+------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
How to let RepoManager use setDefaultAccept to accept unsigned file and verification failure, my issue is it still deny to build repo cache although I have set default accept. Build cache for repo http://repo.meego.com/MeeGo/builds/1.0.99/1.0.99.1.20101012.1/core/repos/ia3... Traceback (most recent call last): File "list_resolvables.py", line 26, in <module> repoManager.buildCache( repo, zypp.RepoManager.BuildIfNeeded ) File "/usr/lib/python2.6/site-packages/zypp.py", line 2586, in buildCache def buildCache(self, *args): return _zypp.RepoManager_buildCache(self, *args) RuntimeError: History: - Signature verification failed for repomd.xml [|] Valid metadata not found at specified URL(s)
-----Original Message----- From: Michael Andres [mailto:ma@suse.de] Sent: Wednesday, October 20, 2010 7:20 PM To: zypp-devel@opensuse.org Subject: Re: [zypp-devel] How to use libzypp-bindings to create a sysroot from a repo? (fixed in 0.5.5)
On Tuesday 19 October 2010 13:55:47 Klaus Kaempf wrote:
A quick solution is to provide an explicit type conversion function, e.g.
Well, it looks like swig/python has some trouble to handle the DefaultAccept type at all (better said, I have trouble to tell swig how to handle it). It complains about possible memory leak and misssing dtor...
So I finally fixed it by providing integer based versions of KeyRing::defaultAcceptBits / KeyRing::setDefaultAcceptBits. You need zypp bindings version -0.5.5 for this. This version will be available soon at:
obs://zypp:Code11_3-Branch http://download.opensuse.org/repositories/zypp:/Code11_3-Branch/openSUSE _11.3/
obs://zypp:Head http://download.opensuse.org/repositories/zypp:/Head/openSUSE_Factory/
--
cu, Michael Andres
+------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Friday 22 October 2010 09:30:08 Yang, Yi Y wrote:
How to let RepoManager use setDefaultAccept to accept unsigned file and verification failure, my issue is it still deny to build repo cache although I have set default accept.
Try setting gpgcheck=0 in your test.repo file. If it does not work, export 'ZYPP_LOGFILE=/tmp/zypp.log' and I'll have a look at the logfile. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Friday 22 October 2010 10:19:31 Michael Andres wrote:
On Friday 22 October 2010 09:30:08 Yang, Yi Y wrote:
How to let RepoManager use setDefaultAccept to accept unsigned file and verification failure, my issue is it still deny to build repo cache although I have set default accept.
Try setting
gpgcheck=0
The above will work too, but may not be what you want. Back to your code: zypp.KeyRing.setDefaultAccept( zypp.KeyRing.ACCEPT_UNSIGNED_FILE | zypp.KeyRing.ACCEPT_VERIFICATION_FAILED ) If your repo is unsigned (no repomd.xml.asc / repomd.xml.key) ACCEPT_UNSIGNED_FILE will help. But if your repo is signed the 1st question is whether to trust an unknown key or not. The 2nd question is how to handle a failed verification (ACCEPT_VERIFICATION_FAILED). So you should also set one out of: TRUST_KEY_TEMPORARILY (for this session only) TRUST_AND_IMPORT_KEY (permanently import to rpmdb) -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Thanks a lot, with TRUST_KEY_TEMPORARILY, it can build repo cache, but it can't give out any progress, how to set a callback for showing progress on building repo cache? Another issue is proxy, my network needs to set http proxy, how do I use libzypp bindings' python API to set proxy for every repo (some repos don't need proxy but others need)
-----Original Message----- From: Michael Andres [mailto:ma@suse.de] Sent: Friday, October 22, 2010 8:18 PM To: zypp-devel@opensuse.org Subject: Re: [zypp-devel] How to use libzypp-bindings to create a sysroot from a repo? (fixed in 0.5.5)
On Friday 22 October 2010 10:19:31 Michael Andres wrote:
On Friday 22 October 2010 09:30:08 Yang, Yi Y wrote:
How to let RepoManager use setDefaultAccept to accept unsigned file and verification failure, my issue is it still deny to build repo cache although I have set default accept.
Try setting
gpgcheck=0
The above will work too, but may not be what you want. Back to your code:
zypp.KeyRing.setDefaultAccept( zypp.KeyRing.ACCEPT_UNSIGNED_FILE | zypp.KeyRing.ACCEPT_VERIFICATION_FAILED )
If your repo is unsigned (no repomd.xml.asc / repomd.xml.key) ACCEPT_UNSIGNED_FILE will help.
But if your repo is signed the 1st question is whether to trust an unknown key or not. The 2nd question is how to handle a failed verification (ACCEPT_VERIFICATION_FAILED).
So you should also set one out of:
TRUST_KEY_TEMPORARILY (for this session only) TRUST_AND_IMPORT_KEY (permanently import to rpmdb)
--
cu, Michael Andres
+------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Wednesday 27 October 2010 04:59:56 Yang, Yi Y wrote:
Thanks a lot, with TRUST_KEY_TEMPORARILY, it can build repo cache, but it can't give out any progress, how to set a callback for showing progress on building repo cache?
I don't know whether this works with the bindings.
Another issue is proxy, my network needs to set http proxy, how do I use libzypp bindings' python API to set proxy for every repo (some repos don't need proxy but others need)
With libzypp-8.2.1 you can have "proxy=" ( "_none_" | host[":"port] ) in your .repo file. This currently does not work with mirrorlist, but a fix for this is on the way. Also missing: a RepoInfo.setProxy method, in case you're using temporary repos (without .repo file). -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Michael Andres <ma@suse.de> [Oct 27. 2010 13:15]:
On Wednesday 27 October 2010 04:59:56 Yang, Yi Y wrote:
Thanks a lot, with TRUST_KEY_TEMPORARILY, it can build repo cache, but it can't give out any progress, how to set a callback for showing progress on building repo cache?
I don't know whether this works with the bindings.
Swig primarily creates bindings 'into' C or C++ code. The reverse (like callbacks) is possible, but needs a bit of engineering. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Wednesday 27 October 2010 14:12:39 Klaus Kaempf wrote:
* Michael Andres <ma@suse.de> [Oct 27. 2010 13:15]:
I don't know whether this works with the bindings.
(like callbacks) is possible, but needs a bit of engineering.
That's what I wanted to say: I don't think this 'bit of engineering' happened. Once python/callbacks.i contained some sketch(?) which was removed, as it referred to some obsolete report. Maybe this can be re-activated, but I currently don't have time to look at it... -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Another issue: Traceback (most recent call last): File "list_resolvables.py", line 77, in <module> policy.downloadMode(zypp.DownloadMode.DownloadInAdvance) AttributeError: 'module' object has no attribute 'DownloadMode' Why DownloadMode isn't available in libzypp-bindings? After some investigation, I can set which packages and patterns will be installed, then it indeed starts installation, but at some one point, it terminates because of unknown reason, by the way, it didn't give any progress about downloading and installing packages, how to set callbacks for downloading and installing packages? Traceback (most recent call last): File "list_resolvables.py", line 80, in <module> result = Z.commit( policy ) File "/usr/lib/python2.6/site-packages/zypp.py", line 3671, in commit def commit(self, *args): return _zypp.ZYpp_Ptr_commit(self, *args) RuntimeError: Installation aborted by user How do I get detailed error log? Here is my code: ----------------------X------------------- #! /usr/bin/python import sys import zypp #keyringreport = zypp.KeyRingReport.KeyRingReport() zypp.KeyRing.setDefaultAccept( zypp.KeyRing.ACCEPT_UNSIGNED_FILE | zypp.KeyRing.ACCEPT_VERIFICATION_FAILED | zypp.KeyRing.ACCEPT_UNKNOWNKEY | zypp.KeyRing.TRUST_KEY_TEMPORARILY ) repoManagerOptions = zypp.RepoManagerOptions(zypp.Pathname("/home/yangyi/zypper-root")) repoManagerOptions.knownReposPath = zypp.Pathname("/home/yangyi/cache/etc/zypp/repos.d") repoManagerOptions.repoCachePath = zypp.Pathname("/home/yangyi/cache/var/cache/zypp") #repoManagerOptions.repoRawCachePath = zypp.Pathname(repoManagerOptions.repoCachePath.c_str() + "/raw") repoManagerOptions.repoRawCachePath = zypp.Pathname("/home/yangyi/cache/raw") #repoManagerOptions.repoSolvCachePath = zypp.Pathname(repoManagerOptions.repoCachePath.c_str() + "/solv") repoManagerOptions.repoSolvCachePath = zypp.Pathname("/home/yangyi/cache/solv") #repoManagerOptions.repoPackagesCachePath = zypp.Pathname(repoManagerOptions.repoCachePath.c_str() + "/packages") repoManagerOptions.repoPackagesCachePath = zypp.Pathname("/home/yangyi/cache/packages") repoManager = zypp.RepoManager(repoManagerOptions) #repoManager.addRepositories(zypp.Url("file:///home/yangyi/libzypp-bindings-0.5.4-mine/examples/python/test.repo")) #repoManager.addRepositories(zypp.Url("http://download.opensuse.org/repositories/openSUSE:/11.3:/Live/standard/open...")) #repoManager.addRepositories(zypp.Url("http://mirrors.kernel.org/fedora/releases/13/Fedora/i386/os/")) repos = repoManager.knownRepositories() for repo in repos: if not repo.enabled(): continue print "Build cache for repo %s" % repo.url() if not repoManager.isCached( repo ): repoManager.buildCache( repo, zypp.RepoManager.BuildIfNeeded ) repoManager.loadFromCache( repo ); Z = zypp.ZYppFactory_instance().getZYpp() Z.initializeTarget( zypp.Pathname("/home/yangyi/zypper-root") ) Z.target().load(); """ %packages @MeeGo Core @MeeGo Base @Minimal MeeGo X Window System gstreamer tracker geoclue qt qt-mobility sensorfw wget min openssh-server sample-media bootchart %end """ print "Items: %d" % ( Z.pool().size() ) patterns = ["MeeGo Core", "MeeGo Base", "Minimal MeeGo X Window System"] packages = ["gstreamer", "tracker", "geoclue", "qt", "qt-mobility", "sensorfw", "wget", "min", "openssh-server", "sample-media", "bootchart"] for item in Z.pool(): kind = "%s" % item.kind() if kind == "pattern": summary = "%s" % item.summary() name = "%s" % item.name() if name in patterns or summary in patterns: print summary item.status().setToBeInstalled (zypp.ResStatus.USER) elif kind == "package": name = "%s" % item.name() if name in packages: print name item.status().setToBeInstalled (zypp.ResStatus.USER) if not Z.resolver().resolvePool(): raise "Solver Error" policy = zypp.ZYppCommitPolicy() #policy.downloadMode(zypp.DownloadMode.DownloadInAdvance) policy.dryRun( False ) policy.syncPoolAfterCommit( False ) result = Z.commit( policy ) print result ----------------------X-------------------
-----Original Message----- From: Michael Andres [mailto:ma@suse.de] Sent: Wednesday, October 27, 2010 8:56 PM To: zypp-devel@opensuse.org Subject: Re: [zypp-devel] How to use libzypp-bindings to create a sysroot from a repo? (fixed in 0.5.5)
On Wednesday 27 October 2010 14:12:39 Klaus Kaempf wrote:
* Michael Andres <ma@suse.de> [Oct 27. 2010 13:15]:
I don't know whether this works with the bindings.
(like callbacks) is possible, but needs a bit of engineering.
That's what I wanted to say: I don't think this 'bit of engineering' happened.
Once python/callbacks.i contained some sketch(?) which was removed, as it referred to some obsolete report. Maybe this can be re-activated, but I currently don't have time to look at it...
--
cu, Michael Andres
+------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Monday 01 November 2010 08:39:40 Yang, Yi Y wrote:
Another issue:
Traceback (most recent call last): File "list_resolvables.py", line 77, in <module> policy.downloadMode(zypp.DownloadMode.DownloadInAdvance) AttributeError: 'module' object has no attribute 'DownloadMode'
Why DownloadMode isn't available in libzypp-bindings?
Fixed in -0.5.6
terminates because of unknown reason, by the way, it didn't give any progress about downloading and installing packages, how to set callbacks for downloading and installing packages?
Need to find some time or someone more familiar with swig/python for this.
How do I get detailed error log?
export ZYPP_LOGFILE=/tmp/zypplog In -0.5.6 I also added setZyppLogfile function: zypp.setZyppLogfile("") // off zypp.setZyppLogfile("-") // stderr zypp.setZyppLogfile("/tmp/mylog") // file -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+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LS0tLS0tLS0tLS0tLS0tLS0tKw0KPiBLZXkgZmluZ2VycHJpbnQgPSAyREZBIDVENzMgMThCMSBFN0VGIEE4NjIgIDI3QUMgM0ZCOCA5RTNBIDI3QzYgQjBFNA0KPiArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKw0KPiBNaWNoYWVsIEFuZHJlcyAgICAgICAgICAgICBaWVBQIERldmVsb3BtZW50DQo+IG1hQHN1c2UuZGUNCj4gU1VTRSBMSU5VWCBQcm9kdWN0cyBHbWJILCBHRjogIE1hcmt1cyBSZXgsICBIUkIgMTY3NDYgKEFHIE51ZXJuYmVyZykNCj4gTWF4ZmVsZHN0cmFzc2UgNSwgRC05MDQwOSBOdWVybmJlcmcsIEdlcm1hbnksICsrNDkgKDApOTExIC0gNzQwIDUzLTANCj4gKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsNCj4gDQo+IC0tDQo+IFRvIHVuc3Vic2NyaWJlLCBlLW1haWw6IHp5cHAtZGV2ZWwrdW5zdWJzY3JpYmVAb3BlbnN1c2Uub3JnDQo+IEZvciBhZGRpdGlvbmFsIGNvbW1hbmRzLCBlLW1haWw6IHp5cHAtZGV2ZWwraGVscEBvcGVuc3VzZS5vcmcNCg0K-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.orgFor additional commands, e-mail: zypp-devel+help@opensuse.org
On Wednesday 03 November 2010 02:46:54 Yang, Yi Y wrote:
Is there a plan to add python/callbacks.i in next version?
We try.
I hope zypp.DownloadMode.DownloadInAdvance and
in -0.5.6
zypp.pool.GetResolvablesToInsDel are available in libzypp-bindings, anybody
in -0.5.7 Z = zypp.ZYppFactory_instance().getZYpp() todo = zypp.GetResolvablesToInsDel( Z.pool() ) for item in todo._toDelete: print '-- %s | %s-%s | %s' % (item.repoInfo().alias(), item.name(), item.edition(), item.status() ) for item in todo._toInstall: print '++ %s | %s-%s | %s' % (item.repoInfo().alias(), item.name(), item.edition(), item.status() ) -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
VGhhbmsgeW91IGZvciB5b3VyIHF1aWNrIGZpeGVzLiBBbm90aGVyIGlzc3VlLCBpZiBhIHJlcXVpcmUgY2FuJ3QgYmUgbWV0LCBob3cgdG8gZ2V0IGFuZCBvdXRwdXQgdGhpcyByZXF1aXJlIGluZm8/IEZvciBleGFtcGxlLCBhIHBhdHRlcm4gQSBpbmNsdWRlcyBwYWNrYWdlIEIgYnV0IEIgaXNuJ3QgaW4gcmVwbywgaWYgSSB3YW50IHRvIGluc3RhbGwgQSwgQiB3b24ndCBiZSByZXNvbHZlZCwgc28gSSBzaG91bGQgZ2V0IHRoaXMgaW5mbyBhbmQgb3V0cHV0IGl0LCBteSBpc3N1ZSBpcyBob3cgdG8gZmluZCBCIGFuZCBkZWNpZGUgaXQgaXNuJ3Qgc29sdmVkIGluIGxpYnp5cHAtYmluZGluZ3MuDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogTWljaGFlbCBBbmRyZXMgW21haWx0bzptYUBzdXNlLmRlXQ0KPiBTZW50OiBXZWRuZXNkYXksIE5vdmVtYmVyIDAzLCAyMDEwIDk6NDcgUE0NCj4gVG86IHp5cHAtZGV2ZWxAb3BlbnN1c2Uub3JnDQo+IFN1YmplY3Q6IF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ZW0uc3RhdHVzKCkgKQ0KPiANCj4gDQo+IC0tDQo+IA0KPiBjdSwNCj4gICAgIE1pY2hhZWwgQW5kcmVzDQo+IA0KPiArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKw0KPiBLZXkgZmluZ2VycHJpbnQgPSAyREZBIDVENzMgMThCMSBFN0VGIEE4NjIgIDI3QUMgM0ZCOCA5RTNBIDI3QzYgQjBFNA0KPiArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKw0KPiBNaWNoYWVsIEFuZHJlcyAgICAgICAgICAgICBaWVBQIERldmVsb3BtZW50DQo+IG1hQHN1c2UuZGUNCj4gU1VTRSBMSU5VWCBQcm9kdWN0cyBHbWJILCBHRjogIE1hcmt1cyBSZXgsICBIUkIgMTY3NDYgKEFHIE51ZXJuYmVyZykNCj4gTWF4ZmVsZHN0cmFzc2UgNSwgRC05MDQwOSBOdWVybmJlcmcsIEdlcm1hbnksICsrNDkgKDApOTExIC0gNzQwIDUzLTANCj4gKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsNCj4gDQo+IC0tDQo+IFRvIHVuc3Vic2NyaWJlLCBlLW1haWw6IHp5cHAtZGV2ZWwrdW5zdWJzY3JpYmVAb3BlbnN1c2Uub3JnDQo+IEZvciBhZGRpdGlvbmFsIGNvbW1hbmRzLCBlLW1haWw6IHp5cHAtZGV2ZWwraGVscEBvcGVuc3VzZS5vcmcNCg0K-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.orgFor additional commands, e-mail: zypp-devel+help@opensuse.org
I can't see 0.5.7 in libzypp-bindings git tree.
-----Original Message----- From: Michael Andres [mailto:ma@suse.de] Sent: Wednesday, November 03, 2010 9:47 PM To: zypp-devel@opensuse.org Subject: Re: [zypp-devel] How to use libzypp-bindings to create a sysroot from a repo? (fixed in 0.5.5)
On Wednesday 03 November 2010 02:46:54 Yang, Yi Y wrote:
Is there a plan to add python/callbacks.i in next version?
We try.
I hope zypp.DownloadMode.DownloadInAdvance and
in -0.5.6
zypp.pool.GetResolvablesToInsDel are available in libzypp-bindings, anybody
in -0.5.7
Z = zypp.ZYppFactory_instance().getZYpp() todo = zypp.GetResolvablesToInsDel( Z.pool() ) for item in todo._toDelete: print '-- %s | %s-%s | %s' % (item.repoInfo().alias(), item.name(),
item.edition(), item.status() )
for item in todo._toInstall: print '++ %s | %s-%s | %s' % (item.repoInfo().alias(), item.name(), item.edition(), item.status() )
--
cu, Michael Andres
+------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
I can't see 0.5.7 in libzypp-bindings git tree.
On Thursday 04 November 2010 06:39:51 Yang, Yi Y wrote: pushed -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Thanks, it does work, another issue: swig/python detected a memory leak of type 'ResolverProblemList *', no destructor found. Traceback (most recent call last): File "list_resolvables.py", line 99, in <module> for problem in Z.resolver().problems(): TypeError: 'SwigPyObject' object is not iterable When Z.resolver().resolvePool() returns False, it should have resolving issue, I want to know what resulted in this, read zypper code and find Z.resolver().problems() should be what I want, but obviously it doesn't work, why? Any known way to do it?
-----Original Message----- From: Michael Andres [mailto:ma@suse.de] Sent: Thursday, November 04, 2010 5:51 PM To: zypp-devel@opensuse.org Subject: Re: [zypp-devel] How to use libzypp-bindings to create a sysroot from a repo? (fixed in 0.5.5)
I can't see 0.5.7 in libzypp-bindings git tree.
On Thursday 04 November 2010 06:39:51 Yang, Yi Y wrote: pushed
--
cu, Michael Andres
+------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Hi, I have two issues and hope you can be concerned about and fix it. if I have a resolving issue, the below code can't work if not Z.resolver().resolvePool(): for problem in Z.resolver().problems(): print "%s" % problem.description() raise "Solver Error" The result is: swig/python detected a memory leak of type 'ResolverProblemList *', no destructor found. Traceback (most recent call last): File "list_resolvables.py", line 99, in <module> for problem in Z.resolver().problems(): TypeError: 'SwigPyObject' object is not iterable , the below code also has issue: for item in installed_pkgs: if not zypp.isKindPattern(item): print item.repoInfo().packagesPath() print zypp.asKindPackage(item).location().filename() print "%s.%s %s:%d" % (item.name(), item.arch(), item.edition(), item.installSize()) swig/python detected a memory leak of type 'zypp::OnMediaLocation *', no destructor found. Traceback (most recent call last): File "list_resolvables.py", line 132, in <module> print zypp.asKindPackage(item).location().filename() AttributeError: 'SwigPyObject' object has no attribute 'filename' They are necessary for me, anyone can help fix them in next release, thanks.
-----Original Message----- From: Michael Andres [mailto:ma@suse.de] Sent: Thursday, November 04, 2010 5:51 PM To: zypp-devel@opensuse.org Subject: Re: [zypp-devel] How to use libzypp-bindings to create a sysroot from a repo? (fixed in 0.5.5)
I can't see 0.5.7 in libzypp-bindings git tree.
On Thursday 04 November 2010 06:39:51 Yang, Yi Y wrote: pushed
--
cu, Michael Andres
+------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Yang, Yi Y <yi.y.yang@intel.com> [Nov 16. 2010 08:56]:
Hi, I have two issues and hope you can be concerned about and fix it.
Hi, sorry it took so long to catch up with this.
if I have a resolving issue, the below code can't work
if not Z.resolver().resolvePool(): for problem in Z.resolver().problems(): print "%s" % problem.description() raise "Solver Error"
The result is:
swig/python detected a memory leak of type 'ResolverProblemList *', no destructor found. Traceback (most recent call last): File "list_resolvables.py", line 99, in <module> for problem in Z.resolver().problems(): TypeError: 'SwigPyObject' object is not iterable
This is fixed now in 'master' branch of libzypp-bindings. The fix for the other issue (AttributeError: 'SwigPyObject' object has no attribute 'filename') will come in a moment. Both are caused by lack of 'knowledge' by swig about the internal data structures of libzypp. The short-time fix is to add more %include statements to swig (thereby increasing the overall size of the bindings), the long-term fix is to base the bindings on a new API concept (see branch 'new_api' in git). Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Thanks a lot. I'll try it.
-----Original Message----- From: Klaus Kaempf [mailto:kkaempf@suse.de] Sent: Monday, December 06, 2010 9:45 PM To: Yang, Yi Y Cc: Michael Andres; zypp-devel@opensuse.org Subject: Re: [zypp-devel] How to use libzypp-bindings to create a sysroot from a repo? (fixed in 0.5.5)
* Yang, Yi Y <yi.y.yang@intel.com> [Nov 16. 2010 08:56]:
Hi, I have two issues and hope you can be concerned about and fix it.
Hi,
sorry it took so long to catch up with this.
if I have a resolving issue, the below code can't work
if not Z.resolver().resolvePool(): for problem in Z.resolver().problems(): print "%s" % problem.description() raise "Solver Error"
The result is:
swig/python detected a memory leak of type 'ResolverProblemList *', no destructor found. Traceback (most recent call last): File "list_resolvables.py", line 99, in <module> for problem in Z.resolver().problems(): TypeError: 'SwigPyObject' object is not iterable
This is fixed now in 'master' branch of libzypp-bindings.
The fix for the other issue (AttributeError: 'SwigPyObject' object has no attribute 'filename') will come in a moment.
Both are caused by lack of 'knowledge' by swig about the internal data structures of libzypp. The short-time fix is to add more %include statements to swig (thereby increasing the overall size of the bindings), the long-term fix is to base the bindings on a new API concept (see branch 'new_api' in git).
Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Yang, Yi Y <yi.y.yang@intel.com> [Nov 16. 2010 08:56]:
, the below code also has issue:
for item in installed_pkgs: if not zypp.isKindPattern(item): print item.repoInfo().packagesPath() print zypp.asKindPackage(item).location().filename() print "%s.%s %s:%d" % (item.name(), item.arch(), item.edition(), item.installSize())
swig/python detected a memory leak of type 'zypp::OnMediaLocation *', no destructor found. Traceback (most recent call last): File "list_resolvables.py", line 132, in <module> print zypp.asKindPackage(item).location().filename() AttributeError: 'SwigPyObject' object has no attribute 'filename'
This one is also fixed now in git master. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Thanks, will try it, maybe you can release a new version.
-----Original Message----- From: Klaus Kaempf [mailto:kkaempf@suse.de] Sent: Tuesday, December 07, 2010 3:01 AM To: Yang, Yi Y Cc: Michael Andres; zypp-devel@opensuse.org Subject: Re: [zypp-devel] How to use libzypp-bindings to create a sysroot from a repo? (fixed in 0.5.5)
* Yang, Yi Y <yi.y.yang@intel.com> [Nov 16. 2010 08:56]:
, the below code also has issue:
for item in installed_pkgs: if not zypp.isKindPattern(item): print item.repoInfo().packagesPath() print zypp.asKindPackage(item).location().filename() print "%s.%s %s:%d" % (item.name(), item.arch(), item.edition(),
item.installSize())
swig/python detected a memory leak of type 'zypp::OnMediaLocation *', no
destructor found.
Traceback (most recent call last): File "list_resolvables.py", line 132, in <module> print zypp.asKindPackage(item).location().filename() AttributeError: 'SwigPyObject' object has no attribute 'filename'
This one is also fixed now in git master.
Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
I want to build libzypp-bindings on openSUSE 11.1, 11,2 and 11.3, but obviously libzypp is old, so I also have to build libzypp even libsatsolvers, however I found many packages on openSUSE depend on libzypp so that I failed to install them, do you have any good solution for this?
-----Original Message----- From: Klaus Kaempf [mailto:kkaempf@suse.de] Sent: Tuesday, December 07, 2010 3:01 AM To: Yang, Yi Y Cc: Michael Andres; zypp-devel@opensuse.org Subject: Re: [zypp-devel] How to use libzypp-bindings to create a sysroot from a repo? (fixed in 0.5.5)
* Yang, Yi Y <yi.y.yang@intel.com> [Nov 16. 2010 08:56]:
, the below code also has issue:
for item in installed_pkgs: if not zypp.isKindPattern(item): print item.repoInfo().packagesPath() print zypp.asKindPackage(item).location().filename() print "%s.%s %s:%d" % (item.name(), item.arch(), item.edition(),
item.installSize())
swig/python detected a memory leak of type 'zypp::OnMediaLocation *', no
destructor found.
Traceback (most recent call last): File "list_resolvables.py", line 132, in <module> print zypp.asKindPackage(item).location().filename() AttributeError: 'SwigPyObject' object has no attribute 'filename'
This one is also fixed now in git master.
Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
* Yang, Yi Y <yi.y.yang@intel.com> [Dec 08. 2010 03:40]:
I want to build libzypp-bindings on openSUSE 11.1, 11,2 and 11.3, but obviously libzypp is old, so I also have to build libzypp even libsatsolvers, however I found many packages on openSUSE depend on libzypp so that I failed to install them, do you have any good solution for this?
libzypp-bindings is now able to detect the version of the underlying libzypp library. We could use that to adapt the bindings to the actual libzypp. I'll create a 'libzypp-bindings' project to just build the bindings for various OSses. Klaus -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Good news, don't forget to tell me when it is ready for use.
-----Original Message----- From: Klaus Kaempf [mailto:kkaempf@suse.de] Sent: Wednesday, December 08, 2010 4:36 PM To: Yang, Yi Y Cc: Michael Andres; zypp-devel@opensuse.org Subject: Re: [zypp-devel] How to use libzypp-bindings to create a sysroot from a repo? (fixed in 0.5.5)
* Yang, Yi Y <yi.y.yang@intel.com> [Dec 08. 2010 03:40]:
I want to build libzypp-bindings on openSUSE 11.1, 11,2 and 11.3, but obviously libzypp is old, so I also have to build libzypp even libsatsolvers, however I found many packages on openSUSE depend on libzypp so that I failed to install them, do you have any good solution for this?
libzypp-bindings is now able to detect the version of the underlying libzypp library. We could use that to adapt the bindings to the actual libzypp.
I'll create a 'libzypp-bindings' project to just build the bindings for various OSses.
Klaus -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Michael Andres <ma@suse.de> [Nov 03. 2010 14:47]:
On Wednesday 03 November 2010 02:46:54 Yang, Yi Y wrote:
Is there a plan to add python/callbacks.i in next version?
We try.
Work has started in git master now ;-) Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Thank you very much, I'm very eager to get it, this is blocking my progress :-)
-----Original Message----- From: Michael Andres [mailto:ma@suse.de] Sent: Thursday, October 14, 2010 7:22 PM To: zypp-devel@opensuse.org Subject: Re: [zypp-devel] How to use libzypp-bindings to create a sysroot from a repo?
On Thursday 14 October 2010 09:22:03 Yi Yang wrote:
Traceback (most recent call last): File "list_resolvables.py", line 6, in <module>
zypp.KeyRing.setDefaultAccept( zypp.KeyRing.ACCEPT_UNSIGNED_FILE |
zypp.KeyRing.ACCEPT_VERIFICATION_FAILED ) TypeError: in method 'KeyRing_setDefaultAccept', argument 1 of type 'zypp::KeyRing::DefaultAccept'
That's a bug in the bindings, we try to fix this ASAP.
--
cu, Michael Andres
+------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres ZYPP Development ma@suse.de SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (4)
-
Klaus Kaempf
-
Michael Andres
-
Yang, Yi Y
-
Yi Yang