bug-make
[Top][All Lists]
Advanced

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

[bug #65360] Extend -p output with export status of each variable.


From: Dmitry Goncharov
Subject: [bug #65360] Extend -p output with export status of each variable.
Date: Mon, 26 Feb 2024 21:19:20 -0500 (EST)

Follow-up Comment #4, bug#65360 (group make):


> As for export, would it be better to use the make syntax for this

Sure.
i attached sv65360_fix2.diff and sv65360_test2.diff.
The output is make syntax


$ cat makefile
hello=world
all:;
$ ~/src/gmake/make//l64//make -r -p |grep -B1 hello
# makefile (from 'makefile', line 1)
unexport hello = world



> I'm not a fan of adding the "do not export" to comments for non-exported
variables.  Non-exporting is the default and so we should just not say
anything for non-exported variables.

There are variables which are exported by default, MAKEFLAGS, MAKE_TERMOUT,
MAKE_TERMERR, and the variables inherited from env.
When should make print "export" for these?
If make prints "export" for these variable when these variables are exported,
that'd be the opposite of what make does for regular make variables.
PATH and SHELL are even worse, because these variables are exported by default
on certain operating systems only.

For now, this attached patch sv65360_fix2.diff prints either "export" or
"unexport" for each variable. Unless there is an approach to deal with these
variables differently.


$ cat makefile
unexport hello
all:;
$ hello=world ~/src/gmake/make//l64//make -r -p |grep -B1 hello
# environment
unexport hello = world




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65360>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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