Trying to get logic honor if-statements to control output

I cannot help you on the programming part - others might though - but if you only want to get the job done, this plugin from our exchange handles YUM/DNF based systems.
If this is merely a training exercise, I am sure someone can give you pointers. :slight_smile: