[Yum-devel] Need to destroy and rebuild the ts?

David Farning dfarning at sbcglobal.net
Fri Feb 27 03:33:16 UTC 2004


On Thu, 2004-02-26 at 19:03 -0500, seth vidal wrote:
> You have a set of packages, you know want to install some subset of
> them. You mark that subset as 'i'. You then do a ts.check(). It returns
> back the problems and if you have things in mode 'a' it returns to you
> it's estimate of which package provides that dependency. Now, then you
> have to add those into the ts in mode 'i' or 'u'. You can't CHANGE the
> state in a single ts. You must destroy the ts and start over.

Seth, you are misunderstanding how this works--at least in the rpm4.3
A Quote from doxygen

A rpm.ts object has the following methods:

      * addInstall(hdr,data,mode) Add an install element to a
        transaction set. 
        Parameters:
                hdr 
                the header to be added 
                data 
                user data that will be
                passed to the transaction
                callback during transaction
                execution 
                mode 
                optional argument that
                specifies if this package
                should be installed ('i'),
                upgraded ('u'), or if it is
                just available to the
                transaction when computing
                dependencies but no action
                should be performed with it
                ('a').


> The method you're describing is NOT how the transaction sets will
> function. You may want them to function that way but that's not how it
> works.

I can only say read the source.    

> You really need to stop focusing on yum 2.0.X and focus on what things
> are needed for HEAD. 2.0.x is not going to get a lot of love to it in
> significant ways, it's not worth the time.

Huh, I think that I am looking at HEAD, I just reran

cvs -d :pserver:anonymous at devel.linux.duke.edu:/cvsroot/yum/cvs co -r
HEAD yum

Am looking at nevral.py lines 308 -321

 _ts = self.populateTs(addavailable = 0)
        deps = _ts.check()
        if not deps:
            log(5, 'Quick Check only')
            return (0, 'Success - deps resolved')
        del deps
        del _ts
        log(5, 'Long Check')
        depscopy = []
        unresolveableloop = 0
        while CheckDeps==1 or conflicts != 1 or unresolvable != 1:
            errors=[]
            _ts = self.populateTs(addavailable = 1)
            deps = _ts.check()

and lines 466-467

           del _ts
           del deps

Is this code no longer relevant? Because, the ts is still being
destroyed and rebuilt unnecessarily.  

Dave Farning




More information about the Yum-devel mailing list