RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Is there an implementation for PCRE <-> POSIX interconversion?

From: Jeff Johnson <n3npq@mac.com>
Date: Sat 19 Apr 2008 - 14:41:17 CEST
Message-Id: <CCBA40AE-E685-4CF2-9296-99C218C31A7E@mac.com>

On Apr 18, 2008, at 10:11 PM, R P Herrold wrote:

> On Fri, 18 Apr 2008, Wichmann, Mats D wrote:
>
>> Hey speaking of wars, let's provide another excuse to put PCRE  
>> into LSB :-)  (I've already been thinking about that, FWIW)
>
> Bad Mats; bad bad Mats
>

So jesting. OK.

A little reading indicates that I have inadvertently worded
my question re a PCRE <-> POSIX conversion "implementation" incorrectly.

What I'm looking for is a _SYNTAX_ converter between PCRE <-> POSIX  
RE's.
That has nothing whatsoever to do with NFA <-> DFA implementations of
RE's, performance considerations, API's or anything else.

But PCRE _SYNTAX_ is the tip of the the regex technology battles that
users see that forces an EITHER ... OR ... dialect choice, which often
implies an implementation choice.

I was hoping that the _SYNTAX_ can be interconverted for a significant
subset of all possible PCRE <-> POSIX expressions. I'm perfectly willing
to try a imperfect, known flawed, interconversion of _SYNTAX_ if the
patterns that are typically needed by RPM can be mostly converted  
reliably.

Note: "significant" and "typically needed". YMMV, as always.

But except for some attempts by PHP ideologues trying to eliminate erep
methods for language purity, I fail to find a _SYNTAX_ converter.

Found several other items that are perhaps of use in RPM. This paper
on a glob-like (I believe that users are more comfortable with '*'  
splatted
DWIM patterns than any more precise representation of their intent)  
syntax
that can be converted into a regex used by SELinux file contexts (which
is a very similar problem space to "package management" because both
file context configuration and "packages" are containers for essentially
file path objects):

     http://www.tresys.com/files/docs/FCGlob-A-New-SELinux-File- 
Context-Syntax.pdf

The underlying history is that lib/rpmsx.c was directly stolen from  
libselinux
because API's like matchpathcon did not exist at the time rpm was  
requested
to install SELinux xattr's, and so I had to swipe some rather nice  
but tricky
code from libselinux sources.

SELinux is permitted to change in intelligent ways, RPM (so far) has  
not that luxury.

See the current discussions about prehistoric (9 years ago ==  
mesozoic era for software)
functionality in RPM concerning what is now known as the "LSB format"  
on lsb-discuss.

Perhaps I will regain my ability to jest by reading about FCGlob's ...

73 de Jeff
Received on Sat Apr 19 14:41:36 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.