Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(getos): allow to override the release file #736

Closed
wants to merge 1 commit into from

Conversation

tintou
Copy link

@tintou tintou commented Jan 26, 2023

The lsb_release program upstream allows to use the LSB_OS_RELEASE environment variable to override the release file to consider, it would be nice to support this here.

For instance, we plan to move away from /etc/upstream-release/lsb-release in elementary OS to /usr/lib/upstream-os-release

Note that the lsb-release file (and its format) is now legacy and isn't even used by lsb_release itself.

Related Issues

Note that this is my first time dealing with TypeScript so any feedback welcome 🙂

The lsb_release program upstream allows to use the LSB_OS_RELEASE environment variable
to override the release file to consider, it would be nice to support this here.

For instance, we plan to move away from /etc/upstream-release/lsb-release in elementary OS
to /usr/lib/upstream-os-release

Note that the lsb-release file (and its format) is now legacy and isn't even used by
lsb_release itself.
@hasezoey
Copy link
Member

Note that this is my first time dealing with TypeScript so any feedback welcome slightly_smiling_face

yes it is the correct way, only problems are:

  • no tests
  • no documentation
  • passing in a possibly undefined value into a function expecting a string

if you want i can make the necessary changes, but would like the question of documentation for the LSB_OS_RELEASE env variable resolved first (to see it is not distro specific)

also as a side-note, is the LSB_OS_RELEASE always a os-release style file or can it also be a lsb-release file?

allows to use the LSB_OS_RELEASE environment variable to override the release file to consider

do you have some documentation regarding this as a standard? because from my searching i could not find anything related and on the distros i have tried i never saw this environment variable

Note that the lsb-release file (and its format) is now legacy and isn't even used by lsb_release itself.

i know that it is legacy, but as long as it exists, it provides all the information that is required for here (distro name, distro version)
also as a note, the command itself is not used because i personally found that it is not provided as common as the files are, but the files are always existing (most notably docker images)

@tintou
Copy link
Author

tintou commented Jan 27, 2023

Sorry, I'm reconsidering this, I had to use LSB_OS_RELEASE in a very specific use case when I needed it to return the upstream distro codename but this shouldn't ever be the case here.

As a side note:

  • LSB_OS_RELEASE is guaranteed to be an os-release format
  • LSB_ETC_LSB_RELEASE used to exist for the lsb-release format

But it probably doesn't make sense to add it here.

@tintou tintou closed this Jan 27, 2023
@tintou
Copy link
Author

tintou commented Jan 27, 2023

Thank you for the kind review though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants