On Tue, Feb 13, 2024, 4:34 PM Tonus <[email protected]> wrote: > Hi all > > I have a slackbuild that builds man pages if Pandoc is installed > (autodetected). > > If it isn't, the man pages compression in the SBo template makes the > script fail > What's the good practice ? Add `|| true` at the end of the lines ? > > Tryed on clean system without Pandoc and on my system that has Pandoc, > it builds fine. > > -- > Regards, > > Tonus >
There are a couple of options: 1. You could do an if/then check to see if the man pages exist and then run the command if found. 2. You could require the user to pass an option to enable man page support (with the note pandoc is required) and then use that to enable/disable the building of the man pages (I assume they have an on/off override of the autodetect). You could continue to use that flag to determine if the man pages should be compressed. 3. You could detect whether pandoc is installed and make the above decision for the user based on that. Personally, #1 seems the easiest. Just detect if there are man pages with an if/then statement and if they are, run the compression command: if [ -d $PKG/usr/man ]; then # run compression command fi (You may need to tweak that if statement depending on how the program handles dirs.) Jeremy
_______________________________________________ SlackBuilds-users mailing list [email protected] https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/ FAQ - https://slackbuilds.org/faq/
