All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Magic/File problems
@ 2011-08-09 15:57 jani.uusi-rantala
  2011-08-11 15:29 ` Saul Wold
  0 siblings, 1 reply; 5+ messages in thread
From: jani.uusi-rantala @ 2011-08-09 15:57 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]

I was experiencing same issue today with latest Yocto master ca394457c5d7b2cb4544de7ce2d29008ec6173ae (in Fedora R15):

| error: magic_load(ms, /usr/share/misc/magic) failed: File 5.4 supports only version 7 magic files. `/usr/share/misc/magic.mgc' is version 8
| rpmbuild.real: rpmfc.c:1154: rpmfcClassify: Assertion `mg != ((void *)0)' failed.


This seems to be a problem with rpmbuild using the wrong magic file from rpmfcClassify. This kind of simple fix in package_rpm.class appears to work:

Defines _rpmfc_magic_path variable:

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index ddbfc09..3f00857 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -822,6 +822,8 @@ python do_package_rpm () {
        targetvendor = bb.data.getVar('TARGET_VENDOR', d, True)
        pkgwritedir = bb.data.expand('${PKGWRITEDIRRPM}/${PACKAGE_ARCH}', d)
        pkgarch = bb.data.expand('${PACKAGE_ARCH}', d)
+       magicfile = bb.data.expand('${STAGING_DIR_NATIVE}/usr/share/misc/magic.mgc', d)
+
        bb.mkdirhier(pkgwritedir)
        os.chmod(pkgwritedir, 0755)

@@ -834,7 +836,7 @@ python do_package_rpm () {
        cmd = cmd + " --define '__find_provides " + outprovides + "'"
        cmd = cmd + " --define '_unpackaged_files_terminate_build 0'"
        cmd = cmd + " --define 'debug_package %{nil}'"
+       cmd = cmd + " --define '_rpmfc_magic_path " + magicfile + "'"
        cmd = cmd + " -bb " + outspecfile


- Jani


[-- Attachment #2: Type: text/html, Size: 2509 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* Magic/File problems
@ 2011-08-01 17:55 Jeff Mitchell
  2011-08-01 22:18 ` Saul Wold
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Mitchell @ 2011-08-01 17:55 UTC (permalink / raw)
  To: yocto@yoctoproject.org

On my host system I have the "file" utility version 5.05. The version in 
poky/in my build directories is version 5.04. I'm seeing a lot of builds 
fail with the following:

| error: magic_load(ms, /usr/share/misc/magic) failed: File 5.4 supports 
only version 7 magic files. `/usr/share/misc/magic.mgc' is version 8

Note that the version there is 5.4; this doesn't match anything as far 
as I can tell.

Any ideas?

Thanks,
Jeff


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-11 15:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-09 15:57 Magic/File problems jani.uusi-rantala
2011-08-11 15:29 ` Saul Wold
  -- strict thread matches above, loose matches on Subject: below --
2011-08-01 17:55 Jeff Mitchell
2011-08-01 22:18 ` Saul Wold
2011-08-02 14:31   ` Jeff Mitchell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.