void-mklive
void-mklive copied to clipboard
mklive.sh: start using lib.sh functions.
No longer [wip], as I am no longer going to work on it - I have completed the changes I set out to make. I will hapilly justify my changes and fix what is suggested if it relates to them.
@paper42 Thank you for taking the time to review this PR. I tried to add very few comments, because other shell scripts in the project have excellent comments and this one had almost none. My instinct is to be more verbose actually... So, I am not going to remove them.
why remove die/error_out and add bailout? there's a die() in lib.sh. and why no longer use print_step? IMO if we start putting => in front of info_msgs that should go into the function so it's uniform everywhere
I agree with paper on the comments, most of them are made totally redundant by reading the code. leave comments for complex or nonobvious code
why remove die/error_out and add bailout? there's a die() in lib.sh. and why no longer use print_step? IMO if we start putting => in front of info_msgs that should go into the function so it's uniform everywhere
die() from lib.sh will remove $ROOTFS allways.
There is a need to keep the whole of $BUILDDIR because a user may need to inspect it in case of a problem, if they have specified -K .
I replaced error_out() with bailout() because a) there is a function named bailout already in the repo - in mknet.sh.in - and b) error_out() was working only with a different die() function than that which exists in lib.sh.
print_step() was removed because it is removed elsewhere in the repo (mknet.sh.in) when support for the lib.sh was introduced.
Introducing => in messages in lib.sh may be a good thing. It is used in both xbps-src and the runit-void scripts, so that will be consistent.
I agree with paper on the comments, most of them are made totally redundant by reading the code. leave comments for complex or nonobvious code
I can add more substantive comments (and more verbose) if that is the goal. I was prompted to add something due to the work that has been done in other scripts years ago by @the-maldridge ... Granted, my changes are much less extensive - the bare minimum to have lib.sh functions in mklive and have some consistency with other scripts.