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

Support Configuration Overlays? #87

Open
theory opened this issue Feb 20, 2025 · 5 comments
Open

Support Configuration Overlays? #87

theory opened this issue Feb 20, 2025 · 5 comments

Comments

@theory
Copy link
Owner

theory commented Feb 20, 2025

TIL that the 17.conf file I created is never used, because we only check for, e.g., 17.4.conf. Furthermore, the README suggests that if pgenv does find a version-specific configuration file, it uses it instead of the default.

What say you to these two changes, @fluca1978?

  1. Look for a $major.conf file as well as $major.$minor.conf
  2. Load all the files in revers order: default.conf, then $major.conf, then $major.$minor.conf`, so that you get the defaults and then can override them on a per-version basis?
fluca1978 added a commit to fluca1978/pgenv that referenced this issue Feb 20, 2025
This commit introduces the possibility to handle per-major-version
configuration files (e.g., `17.conf`) that are loaded in the case the
version specific file (.e.g., `17.1.conf`) is not found on the system.
@fluca1978
Copy link
Collaborator

@theory please take a look at my patch. This at least searches for major.conf after major.minor.conf. So far only one file is loaded at a time, the order is major.minor, then major, last default. I think merging the files could be not so smart, also because we set a variable to keep track of which file we loaded. Need surely more work, but it is a starting point.

@theory
Copy link
Owner Author

theory commented Feb 20, 2025

Thanks, yes, this looks good. I presume that prior to version 10, "major" versions are 9.6, 8.4, etc., and not 9 and 8.

I've confirmed that it works with Bash v3.2.57.

@fluca1978
Copy link
Collaborator

Thanks, yes, this looks good. I presume that prior to version 10, "major" versions are 9.6, 8.4, etc., and not 9 and 8.

Yes, my fault thinking that we can drop support for those, but after all we are providing a way to build also "ancient" versions. So this needs a little rework to identify the major version correctly.

I've confirmed that it works with Bash v3.2.57.

Ok, in the next days I will work to make it able to detect also other major versions.

@theory
Copy link
Owner Author

theory commented Feb 20, 2025

Cool, thanks.

fluca1978 added a commit to fluca1978/pgenv that referenced this issue Feb 24, 2025
This commit introduces the possibility to handle per-major-version
configuration files (e.g., `17.conf`) that are loaded in the case the
version specific file (.e.g., `17.1.conf`) is not found on the system.

The loading of a configuration file gives priority to the exact
version, so for instance `17.1.conf`, then if such file is not found
the program tries to load a `17.conf` (i.e., major mode file), and at
last the `default.conf` file.

Close theory#87
@fluca1978
Copy link
Collaborator

@theory I think it is done, according to my tests. If you have some time to have a look at, then we can merge.

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

No branches or pull requests

2 participants