Bug 839656

Summary: Non-existent directories marked as %ghost cause build to fail
Product: [Fedora] Fedora Reporter: Niels de Vos <ndevos>
Component: rpmAssignee: Fedora Packaging Toolset Team <packaging-team>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 17CC: ffesti, jnovy, kkeithle, packaging-team, pknirsch, pmatilai
Target Milestone: ---Keywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-20 16:28:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 839668    
Attachments:
Description Flags
example spec file for reproducing none

Description Niels de Vos 2012-07-12 13:52:13 UTC
Created attachment 597813 [details]
example spec file for reproducing

Description of problem:
The attached .spec contains an example where %ghost is used for a directory and a file. Building this package works fine with rpm-4.8.0-27.el6.x86_64, but fails with rpm-4.9.1.3-7.fc17.x86_64.

Version-Release number of selected component (if applicable):
rpm-4.9.1.3-7.fc17.x86_64

How reproducible:
100%

Steps to Reproduce:
1. download the attached spec file as /tmp/itsaghost.spec
2. rpmbuild -ba /tmp/itsaghost.spec


Actual results:
Processing files: itsaghost-1.0-1.fc17.x86_64
error: Recognition of file "/home/ndevos/rpmbuild/BUILDROOT/itsaghost-1.0-1.fc17.x86_64/var/lib/ghost" failed: mode 100755 cannot open `/home/ndevos/rpmbuild/BUILDROOT/itsaghost-1.0-1.fc17.x86_64/var/lib/ghost' (No such file or directory)


Expected results:
Something among the lines of:
Processing files: itsaghost-1.0-1.el6.x86_64
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/ndevos/rpmbuild/BUILDROOT/itsaghost-1.0-1.el6.x86_64
Wrote: /home/ndevos/rpmbuild/SRPMS/itsaghost-1.0-1.el6.src.rpm
Wrote: /home/ndevos/rpmbuild/RPMS/x86_64/itsaghost-1.0-1.el6.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.IdnFhg
+ umask 022
+ cd /home/ndevos/rpmbuild/BUILD
+ rm -rf /home/ndevos/rpmbuild/BUILDROOT/itsaghost-1.0-1.el6.x86_64
+ exit 0


Additional info:
This problem was hit in the glusterfs sources where a bundled glusterfs.spec.in is the base for a glusterfs.spec included in an archive created with 'make dist'. The %ghost directory and file are created during runtime, and not during 'make install'.

Any clarification on why this fails, and if the spec file can/should be adjusted would be much appreciated.

Comment 1 Panu Matilainen 2012-07-13 08:34:24 UTC
Hmm, curious case, and easily reproduced. I can think of several issues why it would fail, what's not so obvious how it succeeds :) I'm on vacation for the next two weeks so further investigation will have to wait. 

In the meanwhile an easy workaround is to create the %ghost directory during build, eg in the reproducer spec 'mkdir -p %{buildroot}/var/lib/ghost' instead of 'mkdir -p %{buildroot}/var/lib'.

Also this is limited to non-existent %ghost directories only, summary updated.

Comment 2 Panu Matilainen 2012-08-01 14:11:18 UTC
Fixed upstream now. I'm still a bit puzzled how it manages to "work" on RHEL-6, but maybe I'll just shrug it away for now...

Comment 3 Niels de Vos 2012-08-01 14:38:00 UTC
Thanks for 'fixing' this upstream. Please update this Bug when packages are available for testing.

Comment 4 Fedora Update System 2012-10-03 11:40:03 UTC
rpm-4.10.1-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/rpm-4.10.1-1.fc18

Comment 5 Fedora Update System 2012-10-03 17:04:38 UTC
Package rpm-4.10.1-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing rpm-4.10.1-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-15295/rpm-4.10.1-1.fc18
then log in and leave karma (feedback).

Comment 6 Kaleb KEITHLEY 2012-10-11 13:01:15 UTC
This doesn't fix the bug on Fedora 17.

Can we get a backport of the fix into rpm-4.9 for Fedora 17?

Or get rpm-4.10 on Fedora 17?

Comment 7 Kaleb KEITHLEY 2012-10-17 18:56:49 UTC
We reported this bug against F17.

The fix is only in F18. As such I don't see how this can be Status: ON_QA.

Can we get a response to comment 6 please?

We'd like to see this fix backported into rpm-4.9 for Fedora 17.

Comment 8 Fedora Update System 2012-12-20 16:28:50 UTC
rpm-4.10.1-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.