Re: Treating 'not found' packages as errors

seth vidal <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <1208976893.26936.29.camel@cutter>
On Wed, 2008-04-23 at 20:31 +0200, Anders Blomdell wrote:

> now the problem is that this program:
> 
> #!/usr/bin/python
> 
> import yum, os, sys
> 
> my = yum.YumBase()
> my.conf.basecachedir = '/tmp/whereever'
> if not os.path.exists(my.conf.basecachedir):
>     os.makedirs(my.conf.basecachedir)
> my.conf.cache = 0
> my.repos.setCacheDir(my.conf.basecachedir)
> 
> my.install(name='xpdf')
> my.install(name='xwnc')
> my.resolveDeps()
> my.processTransaction()
> 
> when run as root correctly installs xpdf and xwnc, but when run as an ordinary
> user just quitely does nothing. How do I check if installation is successful?

take a look at the code for processTransaction() and the callback it can
take.
the callback will be helpful to you

and also take a look at what my.install() returns - it returns a list of
TransactionMember objects for the pkgs it added to the transaction.

-sv
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.