I've been struggling with this problem for almost a week now. I've posted this to linux-server forum, but no response. This is a more involved explanation.
I have an FC13 x86_64 server with all updates and having trouble building RPMs, but I am not sure it's specifically an RPM problem. I think it's a tty management or file I/O or other type of problem.
When spec files have a "%files -f filelist.txt", which contains the list of files for the RPM, it calls the /usr/lib/check-files script, which sorts the files that are supposed to be in the RPM and compares them with the files that are in the built RPM before they are packaged. At least I believe that is what happens.
Here is the actual code from the script that fails:
find $RPM_BUILD_ROOT -type f -o -type l | LC_ALL=C sort > $FILES_DISK
LC_ALL=C sort > $FILES_RPM
The trouble is that the sort fails. Here's the trace from the check-files script:
+ find /root/rpmbuild/BUILDROOT/sed-4.2.1-5.fc13.x86_64 -type f -o -type l
sort: stat failed: -: Bad file descriptor
+ diff -d /tmp/rpmv4Db1s /tmp/rpmPdDsKU
The first sort succeeds because it reads data sent by the "find" in the same shell. The second sort fails because (I think) it cannot read data from stdin for some reason.
What could possibly cause this? I've checked various permissions, libraries, even used strace extensively, all of which is inconclusive.
This is one of my test server boxes, so this problem is something that I've caused, but I have no idea what.
I also replaced sort with cat and just tried to redirect stdin in that file to a temporary file, and that also fails. It must not be receiving the data it expects.
I've tried running it with selinux disabled and that has no effect.
Ideas greatly appreciated.