[Yum-devel] [PATCH] if we have some duplicate installed pkgs that do not conflict and we update for the newer one but something deps on the older one. We shouldn't fail against the rpm tscheck, we should fail well before then.

James Antill james at fedoraproject.org
Thu Oct 8 04:00:23 UTC 2009


On Wed, 2009-10-07 at 16:35 -0400, Seth Vidal wrote:
> This adds 'YumBase.doesThisUpdate(pkg1, pkg2)' which lets this check take less time.
> ---
>  yum/__init__.py |   23 ++++++++++++++++++++++-
>  1 files changed, 22 insertions(+), 1 deletions(-)
> 
> diff --git a/yum/__init__.py b/yum/__init__.py
> index 79383a5..1dc1022 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -3154,7 +3154,13 @@ class YumBase(depsolve.Depsolve):
>                  elif ipkg.verLT(available_pkg):
>                      txmbr = self._add_up_txmbr(requiringPo, available_pkg, ipkg)
>                      tx_return.append(txmbr)
> -
> +        
> +        for txmbr in tx_return:
> +            for i_pkg in self.rpmdb.searchNevra(name=txmbr.name):
> +                if i_pkg not in txmbr.updates:
> +                    if self.doesthisUpdate(txmbr.po, i_pkg):
> +                        self.tsInfo.addUpdated(i_pkg, txmbr.po)
> +                        
>          return tx_return
>          
>      def remove(self, po=None, **kwargs):
> @@ -4138,3 +4144,18 @@ class YumBase(depsolve.Depsolve):
>  
>          return True # We got a new cache dir
>  
> +    def doesthisUpdate(self, pkg1, pkg2):

 Can we make this _doesthisUpdate() so we can do whatever we want with
it a year from now.

> +        """returns True if pkg1 can update pkg2, False if not"""
> +        
> +        if pkg1.name != pkg2.name:
> +            return False
> +        if not pkg1.EVR  > pkg2.EVR:

 pkg1.verGT(pkg2)

> +            return False
> +        if pkg1.arch not in self.arch.archlist:
> +            return False
> +        if rpmUtils.arch.canCoinstall(pkg1.arch, pkg2.arch):
> +            return False
> +        if self.allowedMultipleInstalls(pkg1):
> +            return False
> +            
> +        return True    

 Apart from that, ACK.



More information about the Yum-devel mailing list