[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 5/8] builtins/source: parse the -i option
From: |
Phi Debian |
Subject: |
Re: [PATCH v2 5/8] builtins/source: parse the -i option |
Date: |
Sun, 19 May 2024 08:39:56 +0200 |
On Sun, May 19, 2024 at 1:17 AM Matheus Afonso Martins Moreira <
matheus@matheusmoreira.com> wrote:
>
> Those should continue to work without any changes.
> They should even be compatible with each other:
> there should be no problems with sourcing -i a script
> which then sources another script normally or uses
> one of the module management solutions.
>
> -- Matheus
>
Not true, the hack to break the whole thing is
old source.sh relying on the current {source,.,$PATH} behavior
The source.sh is alive (maintained)
One come along a say look I got this neat library to colorize stuff, it
depend on a couple of other library (meaning they do source -i inside) the
library (the top one may be) decide that source -i is the general way to go
a decide a despotic alias source='source -i' this could be a general setup
of this package manager.
Back to good'ol source.sh now any 'source' it does are biased.
I agry that true to for other shell options/variable,
'libraries/packages/imports' can break the whole thing too though (IFS is a
good one) but so far we managed :-)
So at the end, the poor one that rely on actual {source,.,$PATH}would have
to warn in its coding convention, never ever source a .sh that rely on
BASH_SOURCE_PATH,
I know a grep would suffice to enforce it, but there is no reasons to force
that.
Another things that bugs me, why not implementing your invention in a
dynamically loaded builtin, advertise it on github, and let the one who
really needs this great thing be their choice download it, and use it.
I personally have my own bash and own ksh for our internal needs, we
maintain them, and we have our own set of internally crafted builtins, I
would not dare push them to shell maintainers, fearing breaking all who
depend on bash/ksh/dash whatever for their OS startup, init script,
configure script etc...
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Matheus Afonso Martins Moreira, 2024/05/14
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Matheus Afonso Martins Moreira, 2024/05/18
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Greg Wooledge, 2024/05/18
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Lawrence Velázquez, 2024/05/18
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Matheus Afonso Martins Moreira, 2024/05/18
- Re: [PATCH v2 5/8] builtins/source: parse the -i option,
Phi Debian <=
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Matheus Afonso Martins Moreira, 2024/05/19
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Phi Debian, 2024/05/20
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Chet Ramey, 2024/05/20
- Re: [PATCH v2 5/8] builtins/source: parse the -i option, Chet Ramey, 2024/05/20
Re: [PATCH v2 5/8] builtins/source: parse the -i option, Robert Elz, 2024/05/18
Re: [PATCH v2 5/8] builtins/source: parse the -i option, Chet Ramey, 2024/05/20
Re: [PATCH v2 5/8] builtins/source: parse the -i option, Matheus Afonso Martins Moreira, 2024/05/20