[Yum-devel] yum buildTrascation

seth vidal skvidal at fedoraproject.org
Mon Nov 21 15:00:32 UTC 2011


On Mon, 21 Nov 2011 17:55:47 +0530
Janardhan Molumuri <mjanardhan at gmail.com> wrote:

> I am trying to run depresolve (dependency resolution check) on a newly
> created yum repo using yum.yumBase.buildTransaction() but the result
> is a empty transcation. Any ideas on this? I don't find good
> documentation on these methods, if you have any please do point me.
> 
> 
> snippet:
>     my.repos.disableRepo("*")
> 
>     newrepo = yum.yumRepo.YumRepository(repoid)
>     newrepo.name = repoid
>     newrepo.baseurl = [url]
>     newrepo.basecachedir = my.conf.cachedir
>     newrepo.metadata_expire = 0
>     newrepo.timestamp_check = False
>     newrepo.enablegroups = 1
>     # we want *all* metadata
>     newrepo.mdpolicy = 'group:all'
> 
>     # add our new repo
>     my.repos.add(newrepo)
>     # enable that repo
>     my.repos.enableRepo(repoid)
>     # setup the repo dirs/etc
>     my.doRepoSetup(thisrepo=repoid)
> 
>     (code, msgs) =
> my.buildTransaction(unfinished_transactions_check=False)
> 
> 
>     print "ecode",code
>     print "\n".join(msgs)
> 
> <>
> Success - empty transaction

nowhere in that code do you tell yum to DO anything.


you've added the repo - but you've never said 'install a pkg' or
'remove a pkg' or even 'update'.

until you do the transaction is empty.

-sv


More information about the Yum-devel mailing list