-
Notifications
You must be signed in to change notification settings - Fork 38
ENT-12600: detect-environment: Document and refactor #1737
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
Draft
larsewi
wants to merge
26
commits into
cfengine:master
Choose a base branch
from
larsewi:detect-environment
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for submitting a PR! Maybe @craigcomstock can review this? |
eb0edfd
to
4ccc0c9
Compare
larsewi
commented
Jun 11, 2025
d6ca0df
to
2632a22
Compare
Signed-off-by: Lars Erik Wik <[email protected]>
Renamed function `detect_labels` to `detect_cross_target`, because this is really what it does. Furthermore, I added a comment explaining the code, as well as code to inform about the detection of cross target. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
The rest of the file uses two space indentation. Hence, the check to see if the functions script was sourced should also have two space indentation for consitency. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
Put the pattern block terminators on separate lines, in the detect_distribution function, for the sake of consistency. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
Removed version substitution of the Debian release code-names (e.g., jessie, buster, etc.) from /etc/debian_version. Looking through the [changelog](https://launchpad.net/debian/+source/base-files/+changelog) for the base-files package in Debian, you can easily see that it has never contained the code-names. At least not since version 5.0.3. Furthermore, we have not updated the version substitution since Debian 10 which is End-of-Life. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
There has not been a 1-digit major release of ubuntu for a long time. Hence, there is no point in looking for it when verifying the version number extracted from /etc/lsb-release. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
On SUSE 12 the /etc/SuSE-release file exists with a deprecation warning. However, /etc/os-release also exists. So we might as well remove the parsing of the former and rely on the latter. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
If the former if condition is true, then the latter implicitly cannot be true. Hence, there is no point in evaluating it. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
Put the pattern block terminators on separate lines, in the detect_packaging function, for the sake of consistency. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
Put the pattern block terminators on separate lines, in the detect_arch function, for the sake of consistency. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
For some reason the version detection for FreeBSD and HP-UX was in the detect_arch function. However, it belongs in the detect_os function. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
AIX 5.3 is no longer supported, so we don't need this environment variable anymore. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
2632a22
to
b2be1bc
Compare
Signed-off-by: Lars Erik Wik <[email protected]>
The function "fatal" is not defined in this script. So it may not be available. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
Put the pattern block terminators on separate lines, in the detect_cores function, for the sake of consistency. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
The detect-environment script is quite noicy due to the fact that it prints the environment every time it's sourced. Hence, modified it to print only the environment variables that the script affects. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
If we disable -x to decrease the verbosity of the build scripts. Then these log messages will come in handy. Ticket: ENT-12600 Signed-off-by: Lars Erik Wik <[email protected]>
b2be1bc
to
d02fbb9
Compare
Signed-off-by: Lars Erik Wik <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Build with exotics and no tests
