Bug 175912 - RPM fails to enforce self conflict
RPM fails to enforce self conflict
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: rpm (Show other bugs)
3.0
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Panu Matilainen
http://www.redhat.com/archives/rpm-li...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-12-16 02:17 EST by Demetri Mouratis
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-19 14:49:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Demetri Mouratis 2005-12-16 02:17:14 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

Description of problem:
I've created a custom RPM that has a Conflicts line on previous releases of itself.  This is intended to enforce the non-upgradability of the RPM.  Contrary to the expected behavior, RPM ignore the conflicts and attempts to install the new release.

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

How reproducible:
Always

Steps to Reproduce:
1.  Create RPM with Conflicts on previous release of itself
2.  Up release number and create a new release
3.  Install the new release
4.  Observe the failed conflict
  

Actual Results:  I ended up with two releases of the RPM installed.

Expected Results:  The RPM command (or up2date) should have failed at dependency resolution.

Additional info:

[root@dev-db1 root]# rpm -q ncc-business-objects
ncc-business-objects-3.0.0.0-11
[root@dev-db1 src]# rpm -qp ncc-business-objects-3.0.0.0-13.noarch.rpm --conflicts
ncc-business-objects = 3.0.0.0-11
[root@dev-db1 src]# rpm -Uvvv --test ncc-business-objects-3.0.0.0-13.noarch.rpm
D: ============== ncc-business-objects-3.0.0.0-13.noarch.rpm
D: Expected size:   1133683060 = lead(96)+sigs(180)+pad(4)+data(1133682780)
D:   Actual size:   1133683060
D: ncc-business-objects-3.0.0.0-13.noarch.rpm: MD5 digest: OK (960fe73a30747855a325ac13735f1f02)
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Providename rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Pubkeys rdonly mode=0x0
D:  read h#     273 Header sanity check: OK
D: ========== DSA pubkey id c63ce15f7940cda1
D:  read h#     463 Header V3 DSA signature: OK, key ID 7940cda1
D:      added binary package [0]
D: found 0 source and 1 binary packages
D: ========== +++ ncc-business-objects-3.0.0.0-13 noarch/linux 0x0
D: opening  db index       /var/lib/rpm/Depends create mode=0x0
D: opening  db index       /var/lib/rpm/Basenames rdonly mode=0x0
D:  read h#     269 Header sanity check: OK
D: ========== DSA pubkey id 219180cddb42a60e
D:  read h#      34 Header V3 DSA signature: OK, key ID db42a60e
D:  Requires: /bin/sh                                       YES (db files)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1       YES (rpmlib provides)
D:  Requires: rpmlib(CompressedFileNames) <= 3.0.4-1        YES (rpmlib provides)
D: Conflicts: ncc-business-objects = 3.0.0.0-11             NO
D: opening  db index       /var/lib/rpm/Conflictname rdonly mode=0x0
D: ========== --- ncc-business-objects-3.0.0.0-11 noarch/linux 0x0
D: opening  db index       /var/lib/rpm/Requirename rdonly mode=0x0
D: ========== DSA pubkey id c63ce15f7940cda1
D:  read h#     464 Header V3 DSA signature: OK, key ID 7940cda1
D:  Requires: ncc-business-objects                          YES (added provide)
D:  read h#     465 Header V3 DSA signature: OK, key ID 7940cda1
D:  Requires: ncc-business-objects                          YES (added provide)
D: closed   db index       /var/lib/rpm/Depends
D: ========== recording tsort relations
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth)
D:     0    0    0    1    0 -ncc-business-objects-3.0.0.0-11
D: ========== successors only (0 bytes)
D:     1    0    0    0    0 +ncc-business-objects-3.0.0.0-13
D: installing binary packages
D: mounted filesystems:
D:     i    dev bsize       bavail       iavail mount point
D:     0 0x3a00  4096       245377      1000885 /
D:     1 0x0002  1024            0           -1 /proc
D:     2 0x0007  1024            0           -1 /dev/pts
D:     3 0x0008  1024            0           -1 /proc/bus/usb
D:     4 0x0801  1024       176066        52168 /boot
D:     5 0x0009  4096       192351       192350 /dev/shm
D:     6 0x3a01  4096       490413       496625 /usr
D:     7 0x3a02  4096       399782       260873 /var
D:     8 0x0811  4096            0           -1 /ora04
D:     9 0x0823   512    221202432       864072 /ora02
D:    10 0x0824   512     56745216       221661 /ora03
D: sanity checking 2 elements
D: opening  db index       /var/lib/rpm/Name rdonly mode=0x0
D: computing 11384 file fingerprints
Preparing packages for installation...
D: computing file dispositions
D: ========== +++ ncc-business-objects-3.0.0.0-13 noarch-linux 0x0
D: Expected size:   1133683060 = lead(96)+sigs(180)+pad(4)+data(1133682780)
D:   Actual size:   1133683060
D:   install: ncc-business-objects-3.0.0.0-13 has 5692 files, test = 1
D: ========== --- ncc-business-objects-3.0.0.0-11 noarch-linux 0x0
D:     erase: ncc-business-objects-3.0.0.0-11 has 5692 files, test = 1
D: closed   db index       /var/lib/rpm/Pubkeys
D: closed   db index       /var/lib/rpm/Conflictname
D: closed   db index       /var/lib/rpm/Providename
D: closed   db index       /var/lib/rpm/Requirename
D: closed   db index       /var/lib/rpm/Basenames
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages

The only time I got a somewhat expected behavior was when I accidentilly included the current release in the Conflicts line and attemtped and rpm -Uvh of the same release as currently installed.
Comment 1 Demetri Mouratis 2005-12-16 19:58:19 EST
I tried added forward looking conflicts as well, to no avail:

[root@dev3-rep01 root]# rpm -q ncc-role-report ncc-business-objects
ncc-business-objects-config
ncc-role-report-3.0.0.0-3203
ncc-business-objects-3.0.0.0-16
ncc-business-objects-config-3.0.0.0-3203
[root@dev3-rep01 root]# rpm -q --conflicts ncc-business-objects
ncc-business-objects < 3.0.0.0-16
ncc-business-objects > 3.0.0.0-16
[root@dev3-rep01 root]# rpm -Uvh
/usr/src/redhat/RPMS/noarch/ncc-business-objects-3.0.0.0-17.noarch.rpm
Preparing...                ########################################### [100%]
Upgrading ncc-business-objects is not supported.  Aborting...
error: %pre(ncc-business-objects-3.0.0.0-17) scriptlet failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping
ncc-business-objects-3.0.0.0-17
[root@dev3-rep01 root]# rpm -q ncc-role-report ncc-business-objects
ncc-business-objects-config
ncc-role-report-3.0.0.0-3203
ncc-business-objects-3.0.0.0-16
ncc-business-objects-config-3.0.0.0-3203
[root@dev3-rep01 root]# rpm -Uvh --test
/usr/src/redhat/RPMS/noarch/ncc-business-objects-3.0.0.0-17.noarch.rpm
Preparing...                ########################################### [100%]
[root@dev3-rep01 root]# rpm -ivh --test
/usr/src/redhat/RPMS/noarch/ncc-business-objects-3.0.0.0-17.noarch.rpm
error: Failed dependencies:
        ncc-business-objects < 3.0.0.0-17 conflicts with
ncc-business-objects-3.0.0.0-17
        ncc-business-objects > 3.0.0.0-16 conflicts with
ncc-business-objects-3.0.0.0-16

Comment 2 Jeff Johnson 2006-01-07 10:57:53 EST
Can you supply a simple reproducer illustrating the functionality that you desire?
Comment 3 Demetri Mouratis 2006-01-11 14:47:52 EST
# rpm -q ncc-business-objects

You should see ncc-business-objects-3.0.0.0-11 installed.

# rpm -Uvh ncc-business-objects-3.0.0.0-12.noarch.rpm  

This should fail with a message like:
error: Failed dependencies:
ncc-business-objects > 3.0.0.0-11 conflicts with ncc-business-objects-3.0.0.0-11:
Comment 4 Jeff Johnson 2006-08-05 07:39:33 EDT
You appear to want to have rpm dependencies guarantee that
only a single instance of a package can be installed.

There are many reasons why rpm dependencies are not the correct
place to implement that guarantee, mostly because the ability to reinstall
an existing package is often useful to insure that, indeed, a package
is installed correctly.

Try adding a test in %pre for a previous identical instance of a package if you must
insure a single instance of a package is installed.

WONTFIX
Comment 5 RHEL Product and Program Management 2007-10-19 14:49:52 EDT
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
 
For more information of the RHEL errata support policy, please visit:
http://www.redhat.com/security/updates/errata/
 
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.

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