Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 158143 Details for
Bug 245707
yum ignores conflicts with installed packages
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
fix for both problems described above
yum-checkconflicts-2.diff (text/plain), 8.16 KB, created by
Florian Festi
on 2007-06-28 16:55:57 UTC
(
hide
)
Description:
fix for both problems described above
Filename:
MIME Type:
Creator:
Florian Festi
Created:
2007-06-28 16:55:57 UTC
Size:
8.16 KB
patch
obsolete
>Index: yum/depsolve.py >=================================================================== >RCS file: /cvsroot/yum/cvs/yum/yum/depsolve.py,v >retrieving revision 1.171 >diff -u -r1.171 depsolve.py >--- yum/depsolve.py 26 Jun 2007 16:01:01 -0000 1.171 >+++ yum/depsolve.py 28 Jun 2007 16:54:14 -0000 >@@ -35,6 +35,15 @@ > import warnings > warnings.simplefilter("ignore", Errors.YumFutureDeprecationWarning) > >+ >+cmp_flags = {"GT": rpm.RPMSENSE_GREATER, >+ "GE": rpm.RPMSENSE_EQUAL | rpm.RPMSENSE_GREATER, >+ "LT": rpm.RPMSENSE_LESS, >+ "LE": rpm.RPMSENSE_LESS | rpm.RPMSENSE_EQUAL, >+ "EQ": rpm.RPMSENSE_EQUAL, >+ None: 0 } >+ >+ > class Depsolve(object): > def __init__(self): > packages.base = self >@@ -777,6 +786,8 @@ > if len(thisneeds) == 0: > self._dcobj.already_seen[txmbr] = 1 > ret.extend(thisneeds) >+ >+ ret.extend(self._checkConflicts()) > > return ret > >@@ -920,13 +931,6 @@ > reqs = txmbr.po.returnPrco('requires') > provs = txmbr.po.returnPrco('provides') > >- flags = {"GT": rpm.RPMSENSE_GREATER, >- "GE": rpm.RPMSENSE_EQUAL | rpm.RPMSENSE_GREATER, >- "LT": rpm.RPMSENSE_LESS, >- "LE": rpm.RPMSENSE_LESS | rpm.RPMSENSE_EQUAL, >- "EQ": rpm.RPMSENSE_EQUAL, >- None: 0 } >- > # if this is an update, we should check what the old > # requires were to make things faster > oldreqs = [] >@@ -947,10 +951,10 @@ > if dep is None: > dep = self._provideToPkg(req) > if dep is None: >- reqtuple = (req[0], version_tuple_to_string(req[2]), flags[req[1]]) >+ reqtuple = (req[0], version_tuple_to_string(req[2]), cmp_flags[req[1]]) > self._dcobj.addRequires(txmbr.po, [reqtuple]) > ret.append( ((txmbr.name, txmbr.version, txmbr.release), >- (req[0], version_tuple_to_string(req[2])), flags[req[1]], None, >+ (req[0], version_tuple_to_string(req[2])), cmp_flags[req[1]], None, > rpm.RPMDEP_SENSE_REQUIRES) ) > continue > >@@ -976,39 +980,60 @@ > if not found: > member.setAsDep(txmbr.po) > >- for conflict in txmbr.po.returnPrco('conflicts'): >- (r, f, v) = conflict >- txmbrs = self.tsInfo.matchNaevr(name=r) >- for tx in self.tsInfo.getMembersWithState(output_states = TS_INSTALL_STATES): >- if tx.name != r and r not in tx.po.provides_names: >- continue >- if tx.po.checkPrco('provides', (r, f, v)): >+ # check if installed packages have conflict with this one >+ for po in self.rpmdb.returnPackages(): >+ if self.tsInfo.getMembersWithState(po.pkgtup, output_states=TS_REMOVE_STATES): >+ continue >+ for conflict in po.returnPrco('conflicts'): >+ if txmbr.po.checkPrco('provides', conflict): >+ (r, f, v) = conflict > ret.append( ((txmbr.name, txmbr.version, txmbr.release), >- (r, version_tuple_to_string(v)), flags[f], >- None, rpm.RPMDEP_SENSE_CONFLICTS) ) >+ (r, version_tuple_to_string(v), cmp_flags[f], None, >+ rpm.RPMDEP_SENSE_CONFLICTS) )) > >- inst = self.rpmdb.whatProvides(r, None, None) >- for pkgtup in inst: >- txmbrs = self.tsInfo.getMembersWithState(pkgtup, >- TS_REMOVE_STATES) >- if not txmbrs: >- po = self.getInstalledPackageObject(pkgtup) >- if po.checkPrco('provides', (r, f, v)): >- ret.append( ((txmbr.name, txmbr.version, txmbr.release), >- (r, version_tuple_to_string(v)), flags[f], >- None, rpm.RPMDEP_SENSE_CONFLICTS) ) >- >- for instpkg in self.rpmdb.searchConflicts(txmbr.name): >- prcotuple = (txmbr.name, 'EQ', (txmbr.epoch, txmbr.version, txmbr.release)) >- if instpkg.checkPrco('conflicts', prcotuple): >- # if the conflict-having-version is being removed then well, it doesn't matter >- if self.tsInfo.getMembersWithState(instpkg.pkgtup, output_states=TS_REMOVE_STATES): >- continue >- instevr = (instpkg.epoch, instpkg.ver, instpkg.rel) >- ret.append( ((txmbr.name, txmbr.version, txmbr.release), >- (instpkg.name, version_tuple_to_string(instevr)), rpm.RPMSENSE_EQUAL, >- None, rpm.RPMDEP_SENSE_CONFLICTS) ) >- >+ # check if this package has conflicts against installed packages >+ for conflict in txmbr.po.returnPrco('conflicts'): >+ ret.extend(self._findOldConflict(txmbr.po, *conflict)) >+ return ret >+ >+ def _findNewConflict(self, po, r, f, v): >+ result = [] >+ for tx in self.tsInfo.getMembersWithState(output_states = TS_INSTALL_STATES): >+ # no conflicts between same NEVR >+ if tx.po.pkgtup[0] == po.pkgtup[0] and tx.po.pkgtup[2:] == po.pkgtup[2:]: >+ continue >+ if tx.name != r and r not in tx.po.provides_names: >+ continue >+ if tx.po.checkPrco('provides', (r, f, v)): >+ result.append( ((po.name, po.version, po.release), >+ (r, version_tuple_to_string(v)), cmp_flags[f], >+ None, rpm.RPMDEP_SENSE_CONFLICTS) ) >+ return result >+ >+ def _findOldConflict(self, po, r, f, v): >+ result = [] >+ inst = self.rpmdb.whatProvides(r, None, None) >+ for pkgtup in inst: >+ # no conflicts between same NEVR >+ if pkgtup[0] == po.pkgtup[0] and pkgtup[2:] == po.pkgtup[2:]: >+ continue >+ txmbrs = self.tsInfo.getMembersWithState(pkgtup, >+ TS_REMOVE_STATES) >+ if not txmbrs: >+ po = self.getInstalledPackageObject(pkgtup) >+ if po.checkPrco('provides', (r, f, v)): >+ result.append( ((po.name, po.version, po.release), >+ (r, version_tuple_to_string(v)), cmp_flags[f], >+ None, rpm.RPMDEP_SENSE_CONFLICTS) ) >+ return result >+ >+ def _checkConflicts(self): >+ # check all new packages if they conflict each other >+ ret = [ ] >+ for txmbr in self.tsInfo.getMembersWithState(output_states=TS_INSTALL_STATES): >+ po = txmbr.po >+ for conflict in txmbr.po.returnPrco('conflicts'): >+ ret.extend(self._findNewConflict(po, *conflict)) > return ret > > def _checkRemove(self, txmbr): >@@ -1079,12 +1104,6 @@ > for (prov, removeList) in removes.items(): > (r, f, v) = prov > for po in removeList: >- flags = {"GT": rpm.RPMSENSE_GREATER, >- "GE": rpm.RPMSENSE_EQUAL | rpm.RPMSENSE_GREATER, >- "LT": rpm.RPMSENSE_LESS, >- "LE": rpm.RPMSENSE_LESS | rpm.RPMSENSE_EQUAL, >- "EQ": rpm.RPMSENSE_EQUAL, >- None: 0 } > f = v = None > for (rr, rf, rv) in po.requires: > if rr == r: >@@ -1093,12 +1112,12 @@ > break > > self._removing.append(po.pkgtup) >- reqtuple = (r, version_tuple_to_string(v), flags[f]) >+ reqtuple = (r, version_tuple_to_string(v), cmp_flags[f]) > self._dcobj.addRequires(po, [reqtuple]) > > ret.append( ((po.name, po.version, po.release), > (r, version_tuple_to_string(v)), >- flags[f], None, rpm.RPMDEP_SENSE_REQUIRES) ) >+ cmp_flags[f], None, rpm.RPMDEP_SENSE_REQUIRES) ) > > return ret >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 245707
:
157909
| 158143