On 02.07.2020 17:01, Dmitry Goncharov wrote: > On Thu, Jul 2, 2020 at 8:49 AM Jan Beulich <jbeul...@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.
Not according to my observations. > 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? I can try to; will take a little bit of time though. Jan