Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 229791 - RPM Obsoletes unversioned Provides too eagerly
Summary: RPM Obsoletes unversioned Provides too eagerly
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: rpm
Version: 4.4
Hardware: All
OS: Linux
urgent
high
Target Milestone: ---
: ---
Assignee: Paul Nasrat
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 188239
TreeView+ depends on / blocked
 
Reported: 2007-02-23 15:18 UTC by Fernando Nasser
Modified: 2007-11-17 01:14 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-04-11 22:00:56 UTC


Attachments (Terms of Use)

Description Fernando Nasser 2007-02-23 15:18:46 UTC
Description of problem:

When processing a versioned Obsoletes like:

Obsoletes:   xml-commons-apis  <=  0:1.3.02

RPM also removes any package that provides an unversioned 'xml-commons-apis'. 
Although it is an awfully bad practice to have unversioned virtual provides,
some third part entities do it, like Sun in their JDK RPM.

So any attempt to remove the real, deprecated, xml-commons-apis package on the
package that replaces it, causes RPM to attempt to remove the JDK RPM, which is
a basic package and cannot be removed.  RPM fails to install the new package.

See Expected Results for my suggested behavior and Additional Info for a
suggested pseudo-code.

Version-Release number of selected component (if applicable):

Any rpm 4.4.x version.


How reproducible:

Always

Steps to Reproduce:
1. Install the Sun JDK RPM, like  jdk-1.5.0_08-fcs.i586
2. Try and install a package like xml-commons that tries and Obsoletes
xml-commons-apis with a <= version with:
rpm -i -vv xml-commons
3. Note the message:
D:   Obsoletes: xml-commons-apis = 0:1.3.02-2jpp                erases
jdk-1.5.0_08-fcs.i586
  
Actual results:

Installation fails

Expected results:

Only a xml-commons-apis package (or provider) with a specified version that was
>= than the one specified would be removed.  Or, if >= must be kept removing
unversioned provides, at least do not match for a '=' version specification.

Additional info:

This policy is enforced in lib/rpmds.c, in the function rpmdsCompare

 /* If either EVR is non-existent or empty, always overlap. */
 if (!(A->EVR[A->i] && *A->EVR[A->i] && B->EVR[B->i] && *B->EVR[B->i])) {
   result = 1;
   goto exit;
 } 

What should be done is:

If the Obsoletes is unversioned, Then do indeed remove the same name package

Else (Obsoletes is versioned) 
  If Obsoletes version _not_ with '=', Then remove other package
  
  Else (Obsoletes version with '='), continue to next loop iteration (i.e.,
leave the unversioned provides package alone)

With this change, Obsoletes with '>=' would still keep the old behavior for
backward compatibility (if that is indeed deemed necessary  --  perhaps it is
necessary as a way to remove package with unversioned provides with something
less powerful than a unversioned Obsoletes?).

On the other hand, one at least have a way to remove deprecated packages with
one (or more) Obsoletes with '='.  Not ideal (one needs to require an updated
system, consider packages coming from other sources etc., but at least it is a
way out.

Of course, if '>=' can be made to ignore unversioned provides altogether that
would be much preferable.

Comment 10 Jeff Johnson 2007-03-15 14:27:53 UTC
The Sun package, not rpm, needs to be fixed.

WONTFIX

Comment 15 RHEL Product and Program Management 2007-04-11 22:00:57 UTC
Product Management has reviewed and declined this request.  You may appeal this
decision by reopening this request. 


Note You need to log in before you can comment on or make changes to this bug.