Klaus Kaempf schrieb:
* Michael Andres
[May 05. 2009 12:24]: On Monday 04 May 2009 02:28:02 Elmar Stellnberger wrote:
wanna make a package stat - how many packages are currently installed from a given source: how can I * query for all installed packages Z = zypp.ZYppFactory_instance().getZYpp() Z.initializeTarget( zypp.Pathname("/") ) Z.target().load();
The satsolver provide an alternative for simple package operations. A simple example would be
import satsolver
pool = satsolver.Pool() pool.set_arch("i686") repo = pool.add_rpmdb( "/" ) print repo.size(), " installed packages" for s in pool: print s, s.vendor()
(see sat-solver/bindings/python/tests/rpmdb.py http://git.opensuse.org/?p=projects/zypp/sat-solver.git;a=blob_plain;f=bindi...)
The code won't help you. Look at the 'item.repoInfo().alias()' output in the above example. An installed packages repository is the '@system' repository, aka the rpm database, an not the repository package was installed from.
Actually, I question the value of this information because of mirrors. The package origin, usually covered in the package vendor and its signing key, is more valuable.
Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
Does this code simply query the vendor tag of installed rpms? .. or does it use the info from /var/log/zypp/history or any other source? -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org