ZOSOpenTools / meta

Meta repository to tie together the various underlying z/OS Open Source tools repositories here
https://zosopentools.github.io/meta/
Apache License 2.0
37 stars 25 forks source link

Export environment key-value pairs #780

Closed DevonianTeuchter closed 3 weeks ago

DevonianTeuchter commented 3 weeks ago

Add the capability that when sourcing zopen-config, specifying the --knv or --eknv parameters will also output a key=value listing of the environment variables that zopen-config has calculated form the various appenv files. This output can be captured to a file and used to source directly, noting that if packages change their appenv files in the future or if packages are added/removed, the static file will become stale and need to be regenerated by sourcing zopen-config again.

lbdyck commented 3 weeks ago

any chance that the generated file can be compared to the new environment after a zopen upgrade/install/remove is performed and let the user know that the static file has changed and thus they may need to take some action?

DevonianTeuchter commented 3 weeks ago

any chance that the generated file can be compared to the new environment after a zopen upgrade/install/remove is performed and let the user know that the static file has changed and thus they may need to take some action?

The problem is, there is no (current) way to track where that static file is to do the comparison with, as that is down to the user. Once (if) this PR ships and the re-worked installer does, it'd likely be possible to get a scriptlet to do this, exporting to a dedicated file somewhere (possibly configurable via a zopen-config setting).
I guess the question is, does the functionality provided in this PR meet your needs (to write key=vals to screen to allow redirecting to a file), even if currently requires a wee bit of manual intervention?

lbdyck commented 3 weeks ago

it works for me - even with the manual efforts required :)

THANK YOU

IgorTodorovskiIBM commented 3 weeks ago

Just to double check, was this tested under the /bin/sh shell?