Open linuxcaffe opened 3 years ago
each "element-name.install" file must contain all the info needed, and can be user-modified to suit individual needs. task.install might look something like;
# this is an install file used by Taskwarrior-installation
# https://github.com/HiveMinds-EU/Taskwarrior-installation
# to install, test and uninstall taskwarrior
# https://taskwarrior.org
#
name=task
source=dpkg
location=~/.task/
dependencies=g++, libgnutls28-dev, uuid-dev, cmake, gnutls-bin
install=apt install taskwarrior
version=task version
uninstall=apt remove taskwarrior
test=task add test task installation ||task test
etc.
Thank you, I think that's a significant improvement on the file structure. I would like to ask 7-3=4 questions.
In my mind I would like to distinguish between install scripts of (taskwarrior, taskserver and timewarrior) and (hook scripts), because I thought making that difference structurally visible makes the repository less overwhelming for new users. So I thought of:
A
:
src/core-components/
for the installation of direct components (e.g. taskwarrior, taskserver, timewarrior), src/hook-scripts/
for the installation of hook scriptssrc/config-scripts/
for configuration scriptssrc/other
for things that are neither).B
:
src/
foldersrc/hook-scripts/
for the installation of hook scriptssrc/config-scripts/
for configuration scriptssrc/other
for things that are neither).C
: something else, feel free to suggest.
My personal preference goes to option A
due to symmetry, yet option B
might more clearly indicate some form of hierarchy.
I think the naming is more compact than install_something.sh
, yet for me, it would be/may have been slightly confusing/deterring to see a .install
extension, instead of a .sh
extension.
I do see how it may be more appropriate if you want to also allow for non-executable install files. Also, based on public data it seems you have more experience in this than I do, so if you indicate this is wise, I will adhere. For correct decision-making procedure, could you perhaps motivate this decision, (even if it may be slightly subjective)?
Your example starts with # this is an install file used by Taskwarrior-installation
. Something I will have to research myself later this weekend (feel free to ingore these 3 questions):
something.install
file such that it can be executed if it contains such code?something.install
instead of install_something.sh
files?something.install
file executable (with chmod +x something.install
)?In principle, I was taught that it is better to have your hardcoded variables in a single place such that if you update/change a hardcoded variable, that you only have to change it in one location. Making each install script an independent module seems to go against this principle. However, given (one of) the purpose(s) of this repository, to make it easy for developers to add their hook-script into the auto-installer, it does make it more simple if the scripts are (more) self-contained. Additionally, I can imagine some devs desires on certain overlapping properties/settings in the install/hardcoded
may not match, and giving the devs the/some freedom to customise this may reduce some unneeded conflict.
I agree with the proposed structure, but I feel like I have not been able to accurately capture its advantages. So it seems a bit of a subjective decision to me. (No questions, this is just to make the design logic explicit, feel free to elaborate.)
something.install
filesYou mentioned potential non-executable install files, and in the example you gave, you included install=apt install taskwarrior
. It gives me the feeling you have (a) different perspective/usecase in mind for these .install
files. One such case I could imagine is configuration .install
files that are somehow passively read from another script, yet that seems to be conflicting with the independent module
idea.
something.install
files question(s).install
files?.install
filesI have been taught to minimise code duplicates. This seems in conflict with fully independent .install
files, as they would not rely on a helper.sh
script with some often used functions.
.install
files questionshelper.sh
script? (At some cost of somewhat reduced independence of these something.install
scripts).Well I guess I was trying to imagine the simplest approach; all of the "heavy lifting" done by tw-install.sh, using 1 config file for user variables and preferences (tw-install.rc) and a config file for each installable element (task.install, tasksh.install, vit.install, etc). The config files should be user-editable, and should not have to be executable. The reason I think all of this should be contained under the ~/.task/ folder, is so that folder can be backed up to a single .zip file, and all tw-install executables and configs get backed up with all the other taskwarrior goodies.
so that everything needed to install/ test/ uninstall each element (task, taskd, at the moment) is self contained and exists in its own file, with an agreed-upon file name convention and essential ingredients. These files don't have to contain executable code, per-se, but must contain a list of each action needed at each step. This removes the task and taskd specific actions from main.sh (tw-install.sh?) and moves them to
~/.task/install/task.install
and~/.task/install/taskd.install
. This abstraction becomes the model for any installable element.