Bug 223639 - rpm removes %doc files under some conditions when they should not be removed
rpm removes %doc files under some conditions when they should not be removed
Status: CLOSED DUPLICATE of bug 140055
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-20 21:32 EST by Sam Varshavchik
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-07-03 08:21:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
First spec file (435 bytes, text/plain)
2007-01-20 21:32 EST, Sam Varshavchik
no flags Details
Second spec file (435 bytes, text/plain)
2007-01-20 21:33 EST, Sam Varshavchik
no flags Details

  None (edit)
Description Sam Varshavchik 2007-01-20 21:32:15 EST
Description of problem:

It's already known that if rpm/yum crashes in the middle of processing a long
transaction, you'll have a big mess on your hands with hundreds of packages
having both the old and the new version installed at the same time, forcing
manual removal of each package's old version.

When this happens, all %doc files are going to be removed when the old version
of the package is uninstalled, if both the old and the new package have the same
version, but different releases.

This anomalous behavior can be easily reproduced using rpm -i and rpm -e, as
follows.

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

All versions of rpm, going back many years.

How reproducible:

Always

Steps to Reproduce:

1. echo "foobar"  >.../SOURCES/dummy.tar.gz    # Need a dummy tarball to build this

2. rpmbuild the following two spec files.

3. You will end up with two packages: bugtest-1-1.%{_arch}.rpm and
bugtest-1-2.%{_arch}.rpm

4. Both packages contain the same %doc file: /usr/share/doc/bugtest-1/doc.txt

5. rpm -i bugtest-1-1.*.rpm

6. rpm -i bugtest-1-2.*.rpm

# No error, because both packages do not install any conflicting files.  In
reality, this happens during rpm -U

7. rpm -e bugtest-1-1

Actual results:

/usr/share/doc/bugtest-1/doc.txt will be removed by rpm -e bugtest-1-1, even
though it is still installed by bugtest-1-2

Expected results:

/usr/share/doc/bugtest-1/doc.txt should not be removed.  It is still a part of
an installed package.

Additional info:

This anomalous behavior is also observed with locale files (in
/usr/share/doc/locale), but I have not yet come up with an easily-reproducible
test case.
Comment 1 Sam Varshavchik 2007-01-20 21:32:15 EST
Created attachment 146069 [details]
First spec file
Comment 2 Sam Varshavchik 2007-01-20 21:33:21 EST
Created attachment 146070 [details]
Second spec file
Comment 3 Jeff Johnson 2007-01-21 11:10:58 EST
Yep. See #209306 for details.

DUPLICATE
Comment 4 Jeff Johnson 2007-01-21 21:29:42 EST
FWIW, rpm-4.4.8 (which has removed the skip lists mentioned in #209306) "works"

$ sudo rpm -ivh bugtest-1-1.i686.rpm 
Preparing...                ########################################### [100%]
   1:bugtest                ########################################### [100%]
$ sudo rpm -ivh bugtest-1-2.i686.rpm 
Preparing...                ########################################### [100%]
   1:bugtest                ########################################### [100%]
$ sudo rpm -e bugtest-1-1
$ rpm -Vv bugtest
........   /usr/share/doc/bugtest-1
........ d /usr/share/doc/bugtest-1/doc.txt
$ ls -al /usr/share/doc/bugtest-1/
total 36
drwxr-xr-x   2 root root  4096 2007-01-21 21:23 .
drwxr-xr-x 759 root root 24576 2007-01-21 21:23 ..
-rw-r--r--   1 root root     4 2007-01-21 21:17 doc.txt

So UPSTREAM or DUPLICATE, your call.

Thanks for the reproducer.
Comment 5 Jeff Johnson 2007-04-01 15:37:18 EDT
Performance degradation related to this problem is likely fixed in rpm cvs, will be in rpm-4.4.9-0.3 when 
built.

UPSTREAM
Comment 6 Panu Matilainen 2007-07-03 08:21:01 EDT

*** This bug has been marked as a duplicate of 140055 ***

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