grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Allow user-defined functions to override builtins.


From: Michel Hermier
Subject: Re: [PATCH] Allow user-defined functions to override builtins.
Date: Sun, 25 May 2014 11:08:28 +0200


Le 22 mai 2014 09:32, "Vladimir 'φ-coder/phcoder' Serbinenko" <address@hidden> a écrit :
>
> On 19.05.2014 08:37, Glenn Washburn wrote:
> > Currently, builtin commands take precedence over user-defined
> > functions.  This patch reverses that precedence, so that users can
> > "override" builtin commands.  Builtin commands may be accessed by
> > issuing the command prefixed by an '@' character.
> >
> Overriding builtins sounds like a bad idea. For once it creates a
> language which is heavily dependent on context. This gets hairy and
> messy very fast.
This probably true, but it add 2 great values for me.
One can add tracing/debugging for cheap even on generated/3 party scripts, as afaik grub don't offer a tracing mode, this can be even more hairy.
One can emulate some extra funtionnality on older version to some point, without the need to make custom wrappers, and requiring to hack 3rd party scripts.
So it's true one can mess, and make the things dependant of context, and maybe not all builtin should be overwritable, but when one feel the need to override a builtin, he usually have good reason to do it, even if it can be done in other ways.
> > My motivation for this change is to hook insmod in loaded configfiles
> > which set $prefix to a different location than desired.  If there are
> > any changes needed to help get this functionality included, please let
> > me know.
> >
> Could you detail your usercase more? $prefix is the location where
> modules are, why not just set it to right location?
>
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]