]] Helmut Grohne 

> Hi Tollef,
> 
> On Fri, Oct 24, 2014 at 02:27:16PM +0200, Tollef Fog Heen wrote:
> > Have the links created by triggers on /usr/bin/$arch-gcc.
> 
> I have long pondered this possibility and concluded that triggers are
> the wrong tool for the job. Here are a couple of reasons:
> 
>  1. Triggering on /usr/bin/$arch-gcc is equivalent to triggering on
>     /usr/bin, because triggers cannot contain wildcards. Triggering on
>     /usr/bin is equivalent to triggering on every other package
>     installation. This sounds like a very bad idea.

The list of arches is effectively static (and can be gotten from dpkg),
so I don't see why that matters. You'd just add a trigger on all of
them.

>  2. So maybe triggering on something else is better. Possibly
>     /usr/lib/gcc? Unfortunately, cross compilers use /usr/lib/cross-gcc,
>     so we'd miss them. Furthermore, it has already been pointed out that
>     gcc is not the only compiler and pkg-config is used for other
>     languages than C. Packages such as pm-utils or x11-xkb-utils work
>     without one. So ideally, pkg-config should trigger on the
>     installation of any foreign-arch package.

That doesn't matter, you still need build-essential installed, which
pulls in gcc.

>  3. During the freeze of jessie we have seen that when triggers are done
>     wrong (i.e. missing noawait when it is required) causes great pain.

Fair point.

> So I talked to Guillem Jover and he came up with an entirely different
> solution: dpkg hooks. By passing --pre-invoke or --post-invoke to dpkg,
> it invokes a shell command before or after certain operations.  Since
> dpkg version 1.17.19, there are DPKG_HOOK_ACTION values
> "add-architecture" and "remove-architecture" which trigger on dpkg
> --add-architecture and dpkg --remove-architecture, i.e. exactly what we
> need.
> 
> Of course, care must be taken to not break the system with a bad hook.

Interesting approach.

> +post-invoke=if test \( "$DPKG_HOOK_ACTION" = add-architecture -o 
> "$DPKG_HOOK_ACTION" = remove-architecture \) -a -x 
> /usr/share/pkg-config-dpkghook; then /usr/share/pkg-config-dpkghook update; fi

That runs in shell context and -o / -a are XSIsms, so should probably
rather use && and || instead. 

> So what do you think about this approach? Can you apply it? Please Cc me
> in your reply.

>From a quick skim, it looks pretty good.  I'll certainly play with this
and assuming I don't encounter problems or concerns, merge it.

Thanks,  :-)
-- 
Tollef Fog Heen
UNIX is user friendly, it's just picky about who its friends are


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to