On Sep 19, 2008, at 12:21 PM, Alexey Tourbin wrote:
> On Fri, Sep 19, 2008 at 12:08:14PM -0400, Jeff Johnson wrote:
>>>> So? Use a glob pattern against RPMTAG_DIRNAMES
>>>> elements to detect condition pkg-contains-directory.
>>>
>>> Do you mean something like -- ?
>>> %triggerin -- /usr/share/icons/hicolor/*/*/
>>> gtk-update-icon-cache /usr/share/icons/hicolor
>>
>> Yes.
>>
>>> Possible implementation is: retrieve all Triggername index keys
>>> with leading "/", and treat them as patterns. Then do O(N^2) nested
>>> loop: for each DIRNAME in a package, for each Triggername pattern,
>>> check for fnmatch(pattern, dirname).
>>
>> No. I haven't said anything at all about loops or implementation.
>
> But it has to be implemented somehow...
>
... but there are already existing loops over paths, and many better
techniques
than nested loops, that can be used.
Hint: DB_PARTIAL on the pattern stem should be fast retrieve of
directory
candidates. There are likely other performance enhancements available.
>> And how is piping every file to an external script any better or
>> faster?
>
> Technically there's no piping, only a file duplicated on stdin. And
> "filetriggers" are run only once, at the end of transaction (they're
> actually "posttrans filetriggers"), which saves consecutive ldconfig,
> gtk-update-icon-cache, or whatever calls.
>
All you're saying here afaict is that once a file trigger condition
is determined to be TRUE, remaining candidate paths can be ignored.
That's
true if done internally to rpm as well, once pkg-contains-directory
condition
is TRUE, no further processing need be undertaken.
73 de Jeff
Received on Fri Sep 19 18:31:10 2008