[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: export vs $(origin )
From: |
Dmitry Goncharov |
Subject: |
Re: export vs $(origin ) |
Date: |
Thu, 2 Jul 2020 11:01:52 -0400 |
On Thu, Jul 2, 2020 at 8:49 AM Jan Beulich <jbeulich@suse.com> wrote:
> is it really intended for "export"
> without any assignment done at the same time to change the origin of a
> previously undefined variable from "undefined" to "file"?
"export" without any assignment done at the same time sets the origin
to "environment".
export wom
introduces the variable to the env and set origin to environment.
export wom=
also assigns the value of the variable and sets the origin to "file".
> It doesn't
> change "default" to "file" for a variable with a default value, for
> comparison.
export CC=
sets origin to "file" because a new value from the file is assigned.
export CC
keeps origin intact because the value does not change.
> As to the use case - to be able to determine whether a variable has
> been given a non-default value, and for such a check to be independent
> of whether
> - -R was passed to make
> - export lives ahead or after the check
> a change in behavior would seem to be needed, as such a check can,
> afaict, only sensibly check for "undefined" and "default".
Can you post a sample makefile which demonstrates what you want to achieve?
regards, Dmitry