Ticket #13: yum-3.2.21-consider-ts.patch

File yum-3.2.21-consider-ts.patch, 4.0 kB (added by bergolth, 2 years ago)

also consider transaction set on install and remove (yum 3.2.21 to 3.2.24)

  • yum/__init__.py

    old new  
    25852585                    self.tsInfo.addObsoleted(obsoletee, po) 
    25862586                    tx_return.append(txmbr) 
    25872587            else: 
     2588                # naive handling of packages that are already in the transaction set 
     2589                if not self.allowedMultipleInstalls(po): 
     2590                    for tsmember in self.tsInfo.matchNaevr(name = po.name): 
     2591                        self.tsInfo.remove(tsmember.pkgtup) 
     2592 
    25882593                txmbr = self.tsInfo.addInstall(po) 
    25892594                tx_return.append(txmbr) 
    25902595         
     
    28552860         
    28562861        tx_return = [] 
    28572862        pkgs = [] 
    2858          
     2863        tspkgs = [] 
    28592864         
    28602865        if po: 
    28612866            pkgs = [po]   
     2867            tspkgs = self.tsInfo.getMembers(po.pkgtup) 
    28622868        else: 
    28632869            if kwargs.has_key('pattern'): 
    28642870                if kwargs['pattern'][0] == '@': 
     
    28792885                        self.logger.critical(_('No Match for argument: %s') % arg) 
    28802886                    else: 
    28812887                        pkgs.extend(depmatches) 
    2882                  
     2888 
     2889                (e,m,u) = self.tsInfo.matchPackageNames([kwargs['pattern']]) 
     2890                tspkgs.extend(e) 
     2891                tspkgs.extend(m) 
    28832892            else:     
    28842893                nevra_dict = self._nevra_kwarg_parse(kwargs) 
    28852894 
     
    28912900                    if not kwargs.get('silence_warnings', False): 
    28922901                        self.logger.warning(_("No package matched to remove")) 
    28932902 
     2903                tspkgs = self.tsInfo.matchNaevr(name=nevra_dict['name'], 
     2904                           arch=nevra_dict['arch'], epoch=nevra_dict['epoch'], 
     2905                           ver=nevra_dict['version'], rel=nevra_dict['release']) 
     2906 
     2907        # naive handling of packages that are already in the transaction set 
     2908        for txmbr in tspkgs: 
     2909            self.tsInfo.remove(txmbr.pkgtup) 
     2910 
    28942911        for po in pkgs: 
    28952912            txmbr = self.tsInfo.addErase(po) 
    28962913            tx_return.append(txmbr)