[U-Boot] [BUG] cmd : 'env exists envvar' does not display the existence of environment variable

Hi,
u-boot Version: 2019.10 H/W Board : Beaglebone Black
'env exists env_varName' does not display the existance status of 'env_varName' environment variable.
----------------------------------------- => help env env - environment handling commands
Usage: env ask name [message] [size] - ask for environment variable env default [-f] -a - [forcibly] reset default environment env default [-f] var [...] - [forcibly] reset variable(s) to their default values env delete [-f] var [...] - [forcibly] delete variable(s) env edit name - edit environment variable env exists name - tests for existence of variable env export [-t | -b | -c] [-s size] addr [var ...] - export environment env import [-d] [-t [-r] | -b | -c] addr [size] [var ...] - import environment env print [-a | name ...] - print environment env print -e [name ...] - print UEFI environment env run var [...] - run commands in an environment variable env save - save environment env set -e name [arg ...] - set UEFI variable; unset if 'arg' not specified env set [-f] name [arg ...]
=> printenv ver ver=U-Boot 2019.10 (Oct 14 2019 - 00:47:50 -0700) => env exists ver => -----------------------------------------
What is the expected Output and where is the result updated??
-Adarsh
https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=263e577d-8a0d-4805-aed0-c94705b9fd3a I’m protected online with Avast Free Antivirus. Get it here — it’s free forever. https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=263e577d-8a0d-4805-aed0-c94705b9fd3a <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Dear Adarsh Babu Kalepalli,
you should not flag your postings with a BUG marker if you simply domn't understand how to use the tools. Please do this only when you are really sure there is a misbehaviour.
In message CAJgxa7cv2GiQpS3HwMgC=uAN88Z0KM5b7Frei_gEik1xC=nqyg@mail.gmail.com you wrote:
'env exists env_varName' does not display the existance status of 'env_varName' environment variable.
Which part of the documention states that it should _display_ such a status?
env exists name - tests for existence of variable
This says it "tests", but it does say nothing obout outputting any such information. The command to output such information is "env print".
=> printenv ver ver=U-Boot 2019.10 (Oct 14 2019 - 00:47:50 -0700) => env exists ver =>
What is the expected Output and where is the result updated??
Above behaviour is absolutely correct. The command returns a proper status which can be used in conditionals etc., for example:
U-Boot> env exists foo ; echo RC=$? RC=1 U-Boot> if env exists bootdelay ; then echo BOOTDELAY exists ; else echo BOOTDELAY does not exist ; fi BOOTDELAY exists U-Boot> if env exists bootdelay ; then echo BOOTDELAZ exists ; else echo BOOTDELAZ does not exist ; fi BOOTDELAZ exists U-Boot> env exists bootdelay && printenv bootdelay bootdelay=3
There is no bug.
Best regards,
Wolfgang Denk

Hello Wolfgang Denk,
It's my mistake to tag this observation as a bug. I will take care such thing does not repeat .
Could you *please clarify* couple of my queries* regarding posting questions* to the mailing list.
+ Most of the postings in the mailing list are observed to be code patches. Could we also post our observations/opinions on the code/commands/issues on a particular u-boot release and discuss with other u-boot contributors?? If yes, is there any specific string (similar to [PATCH] for a patch or a [BUG] for a bug etc) to be mentioned in the subject line??
I posted the below two queries earlier (first one yesterday and second one during last month)
1.[U-Boot] cmd: clarification on 'env ask' command execution 2.Unable to delete the hush shell local variables
Both of them were not forwarded by the moderator (not sure what was wrong ). I re-sent the second query yesterday to the mailing list with subject line "*[U-Boot] [BUG] cmd : Local Hush Variable Could not be deleted* " and it got forwarded.
So, any specific guidelines to post queries/observations/bugs for discussion will be definitely helpful and keep us going.
+ For newbies, could you suggest any pre-requisites, initial documents or guidelines to follow while they explore u-boot ( from user/tester/developer perspective ).
Regards, Adarsh
https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=263e577d-8a0d-4805-aed0-c94705b9fd3a I’m protected online with Avast Free Antivirus. Get it here — it’s free forever. https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=263e577d-8a0d-4805-aed0-c94705b9fd3a <#m_6203331441722922600_m_-6344178679015369129_m_4688685467448139936_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
On Mon, Oct 14, 2019 at 4:06 PM Wolfgang Denk wd@denx.de wrote:
Dear Adarsh Babu Kalepalli,
you should not flag your postings with a BUG marker if you simply domn't understand how to use the tools. Please do this only when you are really sure there is a misbehaviour.
In message <CAJgxa7cv2GiQpS3HwMgC=uAN88Z0KM5b7Frei_gEik1xC= nqyg@mail.gmail.com> you wrote:
'env exists env_varName' does not display the existance status of 'env_varName' environment variable.
Which part of the documention states that it should _display_ such a status?
env exists name - tests for existence of variable
This says it "tests", but it does say nothing obout outputting any such information. The command to output such information is "env print".
=> printenv ver ver=U-Boot 2019.10 (Oct 14 2019 - 00:47:50 -0700) => env exists ver =>
What is the expected Output and where is the result updated??
Above behaviour is absolutely correct. The command returns a proper status which can be used in conditionals etc., for example:
U-Boot> env exists foo ; echo RC=$? RC=1 U-Boot> if env exists bootdelay ; then echo BOOTDELAY exists ; else echo BOOTDELAY does not exist ; fi BOOTDELAY exists U-Boot> if env exists bootdelay ; then echo BOOTDELAZ exists ; else echo BOOTDELAZ does not exist ; fi BOOTDELAZ exists U-Boot> env exists bootdelay && printenv bootdelay bootdelay=3
There is no bug.
Best regards,
Wolfgang Denk
-- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de You don't need a weatherman to know which way the wind blows. - Bob Dylan
https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=263e577d-8a0d-4805-aed0-c94705b9fd3a I’m protected online with Avast Free Antivirus. Get it here — it’s free forever. https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=263e577d-8a0d-4805-aed0-c94705b9fd3a <#m_6203331441722922600_m_-6344178679015369129_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Dear Adarsh,
In message CAJgxa7ev2Zao61SDjOt+2k5qJfDxiY1bwTqmcFg=G4iSk-u7KQ@mail.gmail.com you wrote:
Could you *please clarify* couple of my queries* regarding posting questions* to the mailing list.
I can try...
- Most of the postings in the mailing list are observed to be code patches.
Could we also post our observations/opinions on the code/commands/issues on a particular u-boot release and discuss with other u-boot contributors??
Of course you can also just ask questions. But as you probably see, this is a pretty high volume mailing list, so there is always a chance that such messages may be missed.
If yes, is there any specific string (similar to [PATCH] for a patch or a [BUG] for a bug etc) to be mentioned in the subject line??
No, there is no such tag. But it is always a good idea to add the custodian for the affected sub-system on Cc: ; normally you can find such information in the MAINTAINERS file, or try using the scripts/get_maintainer.pl tool. in case of environment code you just have bad luck, as the entry for MAINTAINERS has not been added yet to mainline (but it was seen on the mailing list).
1.[U-Boot] cmd: clarification on 'env ask' command execution 2.Unable to delete the hush shell local variables
Both of them were not forwarded by the moderator (not sure what was wrong ).
I can see 1. at https://lists.denx.de/pipermail/u-boot/2019-October/386682.html
I re-sent the second query yesterday to the mailing list with subject line "*[U-Boot] [BUG] cmd : Local Hush Variable Could not be deleted* " and it got forwarded.
You can avoid that your messages need a maintainer's attention by subscribing to the mailing list. there is tons of spam messages that need to get manually cleaned up, and it's easy to miss a regular posting, especially if the subject line is not clear enough.
So, any specific guidelines to post queries/observations/bugs for discussion will be definitely helpful and keep us going.
- For newbies, could you suggest any pre-requisites, initial documents or
guidelines to follow while they explore u-boot ( from user/tester/developer perspective ).
I found it always useful to read and remember the recommendations posted in [1].
[1] http://www.catb.org/%7eesr/faqs/smart-questions.html
Best regards,
Wolfgang Denk
participants (2)
-
Adarsh Babu Kalepalli
-
Wolfgang Denk