Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 3979

Summary: Upgrade from directory to file fails
Product: [Retired] Red Hat Linux Reporter: dharris
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-09 16:26:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description dharris 1999-07-10 15:09:30 UTC
When a package has a member file which is a directory, and
a later release of the package has that same filename as a
regular file, the upgrade fails trying to unlink the
directory. RPM needs to be a tad smarter about removing the
existing files and directories.

Here's my test:

# rpm -qlp --dump testdirupgrade-1.0-1.i386.rpm
/testfile 1024 931618691  040755 root root 0 0 912 X
# rpm -qlp --dump testdirupgrade-2.0-1.i386.rpm
/testfile 0 931618699 d41d8cd98f00b204e9800998ecf8427e
0100644 root root 0 0 912 X

As you can see, the testdirupgrade-1.0-1 package owns
"/testfile" as a directory, while the testdirupgrade-2.0-1
package owns it as a zero-length file.

Upgrading from directory to file is a problem:

# rpm -i testdirupgrade-1.0-1.i386.rpm
# rpm -U testdirupgrade-2.0-1.i386.rpm
can't unlink /testfile-RPMDELETE: Is a directory

However, upgrading from file to directory is just fine:

# rpm -e testdirupgrade
# rpm -i testdirupgrade-2.0-1.i386.rpm
# rpm -U testdirupgrade-1.0-1.i386.rpm --oldpackage

I've placed the .src.rpm files for these test packages on
up on web for your convenience..
http://www.davideous.com/misc/testdirupgrade-1.0-1.src.rpm
http://www.davideous.com/misc/testdirupgrade-2.0-1.src.rpm

Comment 1 Jeff Johnson 2001-01-09 16:26:14 UTC
*** Bug 13819 has been marked as a duplicate of this bug. ***

Comment 2 Jeff Johnson 2002-07-20 18:55:24 UTC
This is a variant of #61413

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