Avoid errors when publishing UDFs
This is based on !1254 (merged)
It adds more safety checks, and reduces some conditions which gave non-zero exit code but are totally ok. Warning fatigue has been part of the reasons for my errors releasing %Tails_5.18
Edited by boyska