Re: thoughts on rudimentary dependency handling

From: Avery Payne <avery.p.payne_at_gmail.com>
Date: Wed, 7 Jan 2015 23:58:44 -0800

On Wed, Jan 7, 2015 at 6:53 PM, Laurent Bercot <ska-supervision_at_skarnet.org>
wrote:
>
> Unfortunately, the envdir tool, which I use to abstract away the daemons
>> and settings, only chain-loads; it would be nice if it had a persistence
>> mechanism, so that I could "load once" for the scope of the shell script.
>>
>
> Here's an ugly hack that allows you do that using envdir:
> set -a
> eval $({ env; envdir ../.env env; } | grep -vF -e _= -e SHLVL= | sort |
> uniq -u)
> set +a
>

Thanks! When I can carve out a bit of time this week I'll put it in and
finish up the few bits needed. Most of the dependency loop is already
written, I just didn't have a somewhat clean way of pulling in the
$CMDWHATEVER settings without repeatedly reading ./env over and over.


> It only works for variables you add, though, not for variables you remove.


It will work fine. I'm attempting to pre-load values that will remain
constant inside the scope of the script, so there isn't a need to change
them at runtime.
Received on Thu Jan 08 2015 - 07:58:44 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC