python_cleaner: handle misplaced chromite paths

The chroot upgrade hook created a chromite symlink in the
/usr/lib/pythonX.X/site-packages directory.  When update_chroot
changed (871a40aa8f627d7ed34206f22313f32a647eff24) from running
the hook to making the symlink itself, it introduced a bug where
it would create the symlink in just /usr/lib/pythonX.X/.

The python_cleaner script tried to clean up chromite links, but
it only handles the right path (site-packages/) which means the
old path sticks around and constantly triggers us.

Fix the make_chroot script to create the symlink where we expect,
and update python_cleaner to clean out all the possible paths.

We also allow the clean up step to run whenever we get triggered
so that we clean up in the case where python gets updated but we
still have old cruft laying around.  The overhead for the rm/ln/
rmdirs is low.

BUG=chromium:206038
TEST=`./python_cleaner` cleaned up various chromite links in /usr/lib64/ and left one behind

Change-Id: I9a5f262767839b3b867238dea608f95d1da700f8
Reviewed-on: https://gerrit.chromium.org/gerrit/47519
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
2 files changed