I wish to install some RPM packages from a shell script. I want to ensure that each package is indeed installed, but I do not want to update a package that would already have an older version installed (to avoid going to deep into dependency resolution).
How can I achieve this in such a way, that a case where an older version is already installed will return without an error code, while in other cases of failures there will be an error code returned? This so that I am able to control the good execution of the script.