andytinycat / puppet-omnibus

Omnibus package of Puppet with an embedded Ruby and required gems (Chef-style)
55 stars 34 forks source link

Fix up pre-uninstall script so it uses the correct scriptlet argument #18

Closed jgmchan closed 8 years ago

jgmchan commented 10 years ago

The pre-uninstall scriptlet blocks the removal of a package. It is trying to compare the scriptlet argument to a string with the value of "upgrade" but this doesn't work with RPM version 4.8.0 and it doesn't seem to be documented.

Modified the scriptlet to compare integer values as described in the below sources: https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s04s05.html http://www.rpm.org/max-rpm-snapshot/s1-rpm-inside-scripts.html

beddari commented 10 years ago

This is ran also in the deb case so a little care needs to be taken ... upgrade is a param to prerm there http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html

So we'll have to cater for both in that check - I'd rather not split the code. I'm not clear right now if we could just always remove the links, also for the deb upgrade case?