From d899f8d93fa894437fa6315515233789b32f6494 Mon Sep 17 00:00:00 2001 From: David James Date: Wed, 17 Aug 2011 05:22:52 -0700 Subject: [PATCH] Recompile any old perl modules after perl upgrade Whenever perl is upgraded, it is a good idea to clean out any old modules and recompile them. This check ensures that perl-cleaner is run once and only once after each major perl upgrade. BUG=chromium-os:19244 TEST=Run preflight queue with perl upgrade and old sdk. Verify that old perl modules are removed in the first run. Verify perl-cleaner is not run again in subsequent runs. Run sdk builder and confirm sdk builder runs perl-cleaner every time since it starts with an old version of perl. Change-Id: Ib14f9d73122d5ff2c7a23afc3f56905e30ff2cbc Reviewed-on: http://gerrit.chromium.org/gerrit/6149 Reviewed-by: Anush Elangovan Tested-by: David James --- update_chroot | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/update_chroot b/update_chroot index 23d6b536b3..6d8883e025 100755 --- a/update_chroot +++ b/update_chroot @@ -58,3 +58,9 @@ fi eretry sudo -E ${EMERGE_CMD} ${EMERGE_FLAGS} \ chromeos-base/hard-host-depends world +# If the user still has old perl modules installed, update them. +PERL_VERSIONS=$(find /usr/lib*/perl5/vendor_perl/ -maxdepth 1 -mindepth 1 \ + -type d -printf '%P\n' | sort -u | wc -w) +if [ "$PERL_VERSIONS" -gt 1 ] ; then + sudo /usr/sbin/perl-cleaner --all +fi