<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 13, 2024, 4:34 PM Tonus <<a href="mailto:tonus1@free.fr">tonus1@free.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all<br>
<br>
I have a slackbuild that builds man pages if Pandoc is installed <br>
(autodetected).<br>
<br>
If it isn't, the man pages compression in the SBo template makes the script fail<br>
What's the good practice ? Add `|| true` at the end of the lines ?<br>
<br>
Tryed on clean system without Pandoc and on my system that has Pandoc, <br>
it builds fine.<br>
<br>
-- <br>
Regards,<br>
<br>
Tonus<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">There are a couple of options:</div><div dir="auto"><br></div><div dir="auto">1. You could do an if/then check to see if the man pages exist and then run the command if found.</div><div dir="auto">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.</div><div dir="auto">3. You could detect whether pandoc is installed and make the above decision for the user based on that.</div><div dir="auto"><br></div><div dir="auto">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:</div><div dir="auto"><br></div><div dir="auto"><div dir="auto">if [ -d $PKG/usr/man ]; then</div><div dir="auto">  # run compression command</div><div dir="auto">fi</div><div dir="auto"><br></div><div dir="auto">(You may need to tweak that if statement depending on how the program handles dirs.)</div></div><div dir="auto"><br></div><div dir="auto">Jeremy</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>