[Slackbuilds-users] Good practice to manage autodetected optional deps

Tonus tonus1 at free.fr
Wed Feb 14 02:52:11 UTC 2024


On Tue, Feb 13, 2024 at 05:08:03PM -0800, Jeremy Hansen wrote:
>On Tue, Feb 13, 2024, 4:34 PM Tonus <tonus1 at free.fr> 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 ?
>>
>
>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.
>

Thank you for your input !

I choosed to go with 2. with a sed command to leave have the Pandoc 
install optional.

Hope it's clean enough.

-- 
Regards,

Tonus


More information about the SlackBuilds-users mailing list