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
[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