xenserver: Revert only the XenServer scripts no longer replaced by OVS.
authorAndrew Evans <aevans@nicira.com>
Thu, 17 Feb 2011 20:51:34 +0000 (12:51 -0800)
committerAndrew Evans <aevans@nicira.com>
Fri, 18 Feb 2011 22:49:09 +0000 (14:49 -0800)
commit5cb12f2eeffdfcb7696bdcb652b581cfd13d1c3a
treefdfaa5bb50e187aeaba9708c1e3e3003b2c1cee3
parent878ae780124c64547591e3e67371d7e5eea8fd5a
xenserver: Revert only the XenServer scripts no longer replaced by OVS.

Commit d66880ee (xenserver: Clean up /usr/sbin/brctl dangling symlink.)
attempted to revert the original XenServer-shipped versions of scripts replaced
by OVS during an RPM upgrade, but the logic was incorrect. It assumed that
%postun of the package being replaced was run before the %post of the new
version replacing it. The reverse is actually true.

Make upgrade and erase cases both work correctly by simply checking whether any
of the files ever replaced in any OVS version are dangling symlinks, and if so,
attempt to copy the saved XenServer original back to its rightful place. In the
upgrade case, if the newly-installed version of OVS lacks any of the scripts in
the previous version, those will be reverted. In the erase case, none of the
OVS replacements will exist, so they will all be dangling symlinks and will all
be reverted.

Furthermore, replace any dangling symlink from /usr/sbin/xen-bugtool to the
now-nonexistent OVS replacement (caused by commit 92dbd5c9 (xenserver: Replace
customized xen-bugtool with plugin to collect qdisc info.)).

Lastly, prevent accidental reversion of files replaced by OVS during rpm -U
(also caused by commit 92dbd5c9).

Bug #4696.
xenserver/openvswitch-xen.spec