RPM Community Forums

Mailing List Message of <rpm-devel>

Minor annoyance with libmagic <-> pcreposix.h

From: Jeff Johnson <n3npq@mac.com>
Date: Fri 29 Feb 2008 - 21:07:27 CET
Message-Id: <388A9155-3BA4-471E-B456-36D256F8D43F@mac.com>
I build rpm with internal file and pcreposix.h.

I finally got annoyed at these (harmless) messages:

error: magic_file(ms, /X/tmp/time-root/usr/share/doc/time-1.7/ 
COPYING) failed: line 8854: regexec error 17, (match failed)
error: magic_file(ms, /X/tmp/time-root/usr/share/doc/time-1.7/NEWS)  
failed: line 8854: regexec error 17, (match failed)
error: magic_file(ms, /X/tmp/time-root/usr/share/doc/time-1.7/README)  
failed: line 8854: regexec error 17, (match failed)
error: magic_file(ms, /X/tmp/time-root/usr/share/info/time.info.gz)  
failed: line 8854: regexec error 17, (match failed)

to chase down the cause.

It turns out that PCRE's POSIX regex emulation has different return  
codes
than the system regexec(3) errors.

Internal file is using the system, not the PCRE pcreposix.h, regexec.

So a failure to match, normally ignored, is promoted to an error instead

I'll add a bandaid check to disable the message in rpmio/rpmmg.c,
but a real fix either has to teach file internal to build with  
<pcreposix.h>,
or (even better IMHO) pcreposix.h should rearrange its return
code enum to return exactly the same numerical values as, say, glibc  
regexec(3).

73 de Jeff
Received on Fri Feb 29 21:07:45 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.