rust_uprev: Ensure that packages can be built

Although rust_uprev emerges rust, this does not ensure that
all affected packages (rust, rust-bootstrap, rust-host) can be built
from the new sources. For example, it is possible to build and install
rust-host, then make changes to it, and re-running rust_uprev will then
not rebuild it, because it is already installed at the requested version.

This CL changes rust_uprev so that it first removes rust, rust-host, and
rust-bootstrap if they are installed, so that unbuildable packages will
be detected by rust_uprev.

BUG=b:232833366
TEST=Run with installed rust-host package that is unbuildable, see error

Change-Id: I7aeb7d1ac01e737e322bf005a31f1d678e52e042
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3653197
Tested-by: Bob Haarman <inglorion@chromium.org>
Reviewed-by: George Burgess <gbiv@chromium.org>
Commit-Queue: Bob Haarman <inglorion@chromium.org>
1 file changed