Refactor config handling and get rid of "args" var passed to each function
In the pmbootstrap codebase, we have "args" as argument that is passed to almost every function. It's a combination of the actual argparser's return value, but combined with the user's config in pmbootstrap.cfg and even more stuff. Here's a nice overview.
Since we pass it to everything, it's essentially a global variable. I've written it that way initially because I didn't want to have global variables, but now I know better.
The build.postmarketos.org codebase is much more recent, and after this was pointed out, it doesn't have this flaw and uses
bpo.config.const
, bpo.config.args
instead. So if one wants to get the postmarketOS mirror there, which was passed as argument, one would use bpo.config.const.mirror
instead, and args
is not passed to other functions. I like this design much better, it's less confusing.
So I think, we should get rid of the current args
eventually. But it should be done across the whole codebase at once, and it's low priority, at least until we get everything from project direction 2020 done. If someone would like to work on this, discuss it here first.