Closed jonchun closed 4 years ago
I realized that surely what I'm trying to do is not unique. Managing packages by attaching instructions on how to install/compile each package from source is surely a solved problem. Turns out linuxbrew is a thing and it might be what I need to handle everything.
After thinking about it some more -- I'm not going with linuxbrew. Even if I reinvent the wheel a bit, I think my original idea of just setting up bash scripts will be much easier to maintain for my use-case. Additionally, doing it the original way allows me to define dependencies as apt packages so that when I eventually distribute this, I can recursively search through all of my modules and create a list of every apt package I install/use and add it as a dependency when I bundle it as apt. Using brew would mean having to move everything to yet another package management ecosystem.
After working on things the current way, I'm quickly starting to realize that it is a bit of a pain to be maintaining all of the installation steps in Python. Instead, I want to refactor the modules into modules and components.
modules will still categorize things that are being installed by their broader function. So for example, the
lookandfeel
module would be responsible for changing and configuring the appearance of everything. However, rather than having it all as a single module withrun()
andpre()
doing everything, I want to split it up one more time into "components", which would be responsible for installing each separate part of the process. For example, a single plasmoid would be a component, or a single theme would be a component. Since I'm bundling most things from source, one component would effectively represent one git source repository. Then, each module will just be basically consist of a list that installs each component in order. The benefit of this approach is that since I'm using subprocess anways, it's dumb to be writing python based wrappers to each shell command that I run. Instead, I want to just complete the install of each package in bash since most packages that require installing have their instructions in bash. e.g.so in
albert_component.py
, there will be a hidden function that automatically checks to see if there is a file calledalbert_component.sh
in the same directory. If there is, it will execute the bash script during itsrun()
method.