cpio: Bad magic

Harry Rickards harry at linux.com
Mon May 31 17:57:01 UTC 2010


On 31 May 2010 18:49, Panu Matilainen <pmatilai at laiskiainen.org> wrote:
> 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
> +
> DOCDIR=/builddir/build/BUILDROOT/lives-1.3.3-1.fc13.x86_64/usr/share/doc/lives-1.3.3
> + export DOCDIR
> + rm -rf
> /builddir/build/BUILDROOT/lives-1.3.3-1.fc13.x86_64/usr/share/doc/lives-1.3.3
> + /bin/mkdir -p
> /builddir/build/BUILDROOT/lives-1.3.3-1.fc13.x86_64/usr/share/doc/lives-1.3.3
> + 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
> theora_encoder.py.1
> /builddir/build/BUILDROOT/lives-1.3.3-1.fc13.x86_64/usr/share/doc/lives-1.3.3
> + 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"...
>


Thanks for finding the problem! In the wiki, at
http://fedoraproject.org/wiki/How_to_create_an_RPM_package#.25files_prefixes,
it does talk about this problem but doesn't anywhere say that it comes
up with this error. I'm very new to Fedora packaging so probably not
the best person to do it, but would someone be able to update the wiki
to say that this 'gotcha' creates a cpio bad magic error?

Thanks


-- 
Harry Rickards - harry at linux.com
Vote Lib Dem - Building a fairer Britain - http://libdems.org.uk


More information about the devel mailing list