[pacman-dev] [PATCH] Enable Perl regular expressions in NoExtract.

Allan McRae allan at archlinux.org
Wed Jun 5 20:16:45 EDT 2013


On 06/06/13 05:11, Patrick Steinhardt wrote:
> On Wed, Jun 05, 2013 at 03:19:18PM -0400, Andrew Gregory wrote:
>> On 06/05/13 at 03:10pm, Patrick Steinhardt wrote:
>>> On Wed, Jun 05, 2013 at 10:28:25PM +1000, Allan McRae wrote:
>>>> On 05/06/13 16:16, Andrew Gregory wrote:
>>>>>
>>>>> I tend to think that the particular problem at issue here would be
>>>>> better solved by a negation operator ala gitignore:
>>>>>
>>>>>  NoExtract = usr/share/locale/* !usr/share/locale/en_US/*
>>>>
>>>>
>>>> I like this idea.
>>>
>>> How would you ignore all but two files in this directory then?
>>>
>>> NoExtract = !usr/share/locale/en_US/* !usr/share/locale/locale.alias
>>>
>>> One problem that comes to my mind: the first inverse match
>>> already includes locale.alias and as such it would not be
>>> extracted. The second term would exclude locale.alias but include
>>> en_US/*.
>>>
>>> Currently we abort as soon as the first expression (whether it is
>>> PCRE or fnmatch) matches. If we do it like that we would need to
>>> always iterate over all entries in NoExtract and check if a later
>>> occurence of the same file exists that overwrites previous
>>> occurences. _If_ a later term matches again it is unclear as to
>>> what to do, as stated above.
>>>
>>
>> I would simply have the last match win.  It's simple, flexible, and we
>> can still abort as soon as we find a match if we just check them in
>> reverse order.  So you could do what you want with:
>>
>>  NoExtract = usr/share/locale/*
>>  NoExtract = !usr/share/locale/en_US/*
>>  NoExtract = !usr/share/locale/locale.alias
> 
> usr/share/locale/locale.alias already matches en_US/*.

Huh?    Also, what does gitignore do in this case.

Anyway, it should be fairly easy to implement this.
1) exact file matches follow their rule
2) more specific globs take precedence over less specific globs.
Done...




More information about the pacman-dev mailing list