Failure to execute if directory is not named "kiauh" #194
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Linux Distribution
Distro-agnostic; tested on ubuntu groovy
What happened
KIAUH errors on line 14 if the working directory is not named "kiauh". This seems to be because SRCDIR is set as one directory above "kiauh", and line 14 appends "/kiauh/scripts" without verifying that the folder is indeed named "kiauh".
There are many reasons why this could be the case - for example, if a user downloads the source archive in ZIP format from GitHub (in which case the downloaded archive will extract to "kiauh-master").
What did you expect to happen
KIAUH should execute as long as the directory structure is intact, regardless of the name of the "kiauh" folder.
How to reproduce
Install KIAUH and verify that it is in a working state.
Rename the "kiauh" folder to something else (for example, "definitely-not-kiauh").
Attempt to run
kiauh.sh.Additional information
No response
why would you do that? rename the folder, that would break the scripts that look for kiauh
First of all i don't see this as a bug. It is the currently intended behavior. You do have a point in case someone downloads the sources as an archive, though this is not the recommended way and it contradicts the current installation instructions.
I don't see any other reasons or use cases why you have to rename the root folder, are there any? On the other hand i also don't see a particular downside to it.
I might consider improving that behavior with version 4 of KIAUH.
Pardon the delayed response!
IMO it's bad practice to ambiguously crash depending on the name of the working directory, especially if the tool is intended to be installed in the user's home directory. By FHS,
/homeshould only be used to store configuration data and a user's personal files. (FHS v2.3 formerly stated "Therefore, no program should rely on this location"; however, that was amended in 2015, and it can reasonably be assumed that /home is safe to store user-specific config files.)I see a couple of alternatives:
/opt/kiauhor/usr/local/kiauhcan be reasonably assumed to be a fixed path regardless of distro and does not interfere with a user's home directory.Please extract KIAUH to ~/kiauh.orkiauh.sh must be located in ~/kiauh. Fix this? (Y/n)This will not happen.
I think this is also not an ideal solution.
This is probably what im going to try for. As i stated previously i don't see a real downside of it.
If you want your software you are using strictly apply to that standard, you are currently out of luck and shouldn't even consider installing anything from the klipper ecosystem since none of them respect the FHS 😄
Commit
1d16235c24should fix this request and will be live once the PR is merged.