cpio: Bad magic

Panu Matilainen pmatilai at laiskiainen.org
Mon May 31 17:49:53 UTC 2010

On Mon, 31 May 2010, Harry Rickards wrote:

> Hi,
> When building my package with rpmbuild, I'm getting the following error:
> error: create archive failed on file
> /builddir/build/BUILDROOT/lives-1.3.3-1.fc13.x86_64/usr/share/doc/lives-1.3.3/AUTHORS:
> cpio: Bad magic
> I've tried reinstalling cpio and glibc, and I've got enough space
> left. I can view AUTHORS fine with cat, and even compress it with
> cpio. The strange part is, this error also occurs when using koji -
> see the build log at
> http://koji.fedoraproject.org/koji/getfile?taskID=2220058&name=build.log.
> The source rpm is at
> http://hotfile.com/dl/45779573/83852f4/lives-1.3.3-1.fc13.src.rpm.html.
> Any help is appreciated!

The error message is wonderfully obscure, but the actual problem is here:

Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.XGPmZR
+ umask 022
+ cd /builddir/build/BUILD
+ cd lives-1.3.3
+ export DOCDIR
+ rm -rf 
+ /bin/mkdir -p 
+ cp -pr avi_encoder.py.1 build-lives-rfx-plugin.1 
build-lives-rfx-plugin-multi.1 dirac_encoder.py.1 gif_encoder.py.1 lives.1 
mkv_encoder.py.1 mng_encoder.py.1 ogm_encoder.py.1 smogrify.1 
+ exit 0

%doc wipes out anything else in the doc directory, in this case AUTHORS 
and probably something else too, so when rpm tries to put the files into 
the cpio archive it fails because the files don't exist. You need to use 
either %doc or manual directory ownership of the doc directory, you can't 
mix them.

And of course the whole thing is just stupid behavior from rpm, the only 
excuse for this is "it's always been like that"...

 	- Panu -

More information about the devel mailing list