Bug 223639 - rpm removes %doc files under some conditions when they should not be removed
Summary: rpm removes %doc files under some conditions when they should not be removed
Keywords:
Status: CLOSED DUPLICATE of bug 140055
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-01-21 02:32 UTC by Sam Varshavchik
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-07-03 12:21:01 UTC
Type: ---
Embargoed:


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

Description Sam Varshavchik 2007-01-21 02:32:15 UTC
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-21 02:32:15 UTC
Created attachment 146069 [details]
First spec file

Comment 2 Sam Varshavchik 2007-01-21 02:33:21 UTC
Created attachment 146070 [details]
Second spec file

Comment 3 Jeff Johnson 2007-01-21 16:10:58 UTC
Yep. See #209306 for details.

DUPLICATE

Comment 4 Jeff Johnson 2007-01-22 02:29:42 UTC
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 19:37:18 UTC
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 12:21:01 UTC

*** 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.