[Yum-devel] [PATCH] Add a simple "how many packages does this provider require" test.

Seth Vidal skvidal at fedoraproject.org
Wed Apr 21 18:58:52 UTC 2010



On Tue, 20 Apr 2010, James Antill wrote:

>
> ...with this patch we'd pick "pkgA" because it had "less" requirements,
> even though it actually requires 1 more thing. However, real world
> result on F12:


General idea is great - a few nitpicks.

> +        if len(rec_depsolve) > 1:
> +            for po in rec_depsolve:
> +                # FIXME: Can't str() this to something usable...
> +                fake_txmbr = misc.GenericHolder()

make this transactioninfo.TransactionMember() and pack it normally.


it'll save us from having some other random info added to the object later 
and _checkInstall()  thinking it is getting REAL txmbr objects.





>
> +                rec_depsolve[po] = self._checkInstall(fake_txmbr)
> +
> +        #  We don't want to decide to use a "shortest first", if something else
> +        # has told us to pick something else. But we want to pick between
> +        # multiple "best" packages. So we just give a bump to those packages
> +        # which are already winning.
> +        bestnum = max(pkgresults.values())
> +        for po in pkgs:
> +            if pkgresults[po] != bestnum:
> +                continue
> +            pkgresults[po] += 1000
>             pkgresults[po] += (len(po.name)*-1)
>

1000 is a bump? wow, hate to see what you think spiking looks like :)

-sv



More information about the Yum-devel mailing list