Ticket #13: yum-consider-tsinfo.patch

File yum-consider-tsinfo.patch, 4.0 kB (added by bergolth, 3 years ago)

also consider transaction set on install and remove (patch should be complete now :-))

  • yum/__init__.py

    old new  
    25752575                    self.tsInfo.addObsoleted(obsoletee, po) 
    25762576                    tx_return.append(txmbr) 
    25772577            else: 
     2578                # naive handling of packages that are already in the transaction set 
     2579                if not self.allowedMultipleInstalls(po): 
     2580                    for tsmember in self.tsInfo.matchNaevr(name = po.name): 
     2581                        self.tsInfo.remove(tsmember.pkgtup) 
     2582 
    25782583                txmbr = self.tsInfo.addInstall(po) 
    25792584                tx_return.append(txmbr) 
    25802585         
     
    28462851         
    28472852        tx_return = [] 
    28482853        pkgs = [] 
    2849          
     2854        tspkgs = [] 
    28502855         
    28512856        if po: 
    28522857            pkgs = [po]   
     2858            tspkgs = self.tsInfo.getMembers(po.pkgtup) 
    28532859        else: 
    28542860            if kwargs.has_key('pattern'): 
    28552861                if kwargs['pattern'][0] == '@': 
     
    28702876                        self.logger.critical(_('No Match for argument: %s') % arg) 
    28712877                    else: 
    28722878                        pkgs.extend(depmatches) 
    2873                  
     2879 
     2880                (e,m,u) = self.tsInfo.matchPackageNames([kwargs['pattern']]) 
     2881                tspkgs.extend(e) 
     2882                tspkgs.extend(m) 
    28742883            else:     
    28752884                nevra_dict = self._nevra_kwarg_parse(kwargs) 
    28762885 
     
    28822891                    if not kwargs.get('silence_warnings', False): 
    28832892                        self.logger.warning(_("No package matched to remove")) 
    28842893 
     2894                tspkgs = self.tsInfo.matchNaevr(name=nevra_dict['name'], 
     2895                           arch=nevra_dict['arch'], epoch=nevra_dict['epoch'], 
     2896                           ver=nevra_dict['version'], rel=nevra_dict['release']) 
     2897 
     2898        # naive handling of packages that are already in the transaction set 
     2899        for txmbr in tspkgs: 
     2900            self.tsInfo.remove(txmbr.pkgtup) 
     2901 
    28852902        for po in pkgs: 
    28862903            txmbr = self.tsInfo.addErase(po) 
    28872904            tx_return.append(txmbr)