void-mklive icon indicating copy to clipboard operation
void-mklive copied to clipboard

mklive.sh: start using lib.sh functions.

Open mobinmob opened this issue 2 years ago • 4 comments
trafficstars

mobinmob avatar Feb 25 '23 15:02 mobinmob

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.

mobinmob avatar Feb 27 '23 13:02 mobinmob

@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.

mobinmob avatar Mar 05 '23 15:03 mobinmob

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

classabbyamp avatar Mar 05 '23 16:03 classabbyamp

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.

mobinmob avatar Mar 05 '23 17:03 mobinmob