Skip to content

[th/merge-envsetup] prepare: drop "envsetup" directory and add all the code to "prepare/envsetup.sh"

Thomas Haller requested to merge th/merge-envsetup into main

Code does not necessarily get easier to understand by splitting it into a larger number of files. In particular, this code was sourced by envsetup.sh (thus strongly related). It was cannot be meaningfully used alone or for some other different purpose (it's not reusable). We also don't have a plugin architecture, where unspecified plugins would extend the workings of envsetup.sh (nor would that be desirable, giving the complexity of handling what we know, and much more so for code that we don't know).

Well, maybe "pkg_install_el7.sh" has some clear purpose, but since RHEL/Fedora versions are similar, it prevents us from reusing common code, instead the installation of el8 and el9 is entirely separate. Needlessly.

Drop the files and move all the code to "envsetup.sh". With this we can see in one file what is happening. Otherwise, you see just a call to install_packages(), which is defined somewhere else (which expands to 37 lines of shell) and then calls "install_"$release"_packages", which is defined somewhere else again (and even larger).

By seeing all code in one place, there is a possibility to simplify things. Also, we will need to extend the workings of envsetup.sh, because I want to run this in a container.

Merge request reports

Loading