update hooks: add feedback messages to slow chrome cleanup

Some people think this upgrade hook gets stuck when in reality, it has
to delete a lot of files (gigs worth).  Add some progress messages so
people know it's doing something.

BUG=chromium-os:32052
TEST=manually running 25_suppress_incremental_build_across_chroot showed pretty messages

Change-Id: Ie20980fb2c60c980b617e98d68b0e5f9633fbb2a
Reviewed-on: https://gerrit.chromium.org/gerrit/26111
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Mike Frysinger 2012-06-26 11:52:15 -04:00 committed by Gerrit
parent 298f61ab25
commit aa58465a3f

View File

@ -10,13 +10,15 @@
# pulls the content out to the new location within the chroot. # pulls the content out to the new location within the chroot.
upgrade_path() { upgrade_path() {
local src="/var/cache/distfiles/target/$1" local src="/var/cache/distfiles/target/$2"
local dest="/var/cache/chromeos-chrome/$1" local dest="/var/cache/chromeos-chrome/$2"
info "[$1/4] Checking $src vs $dest"
if [ -d "$src" ]; then if [ -d "$src" ]; then
if [ -d "$dest" ]; then if [ -d "$dest" ]; then
# User has already built it- thus wipe the src and use what's in # User has already built it- thus wipe the src and use what's in
# the chrome specific cache. # the chrome specific cache.
info "[$1/4] Cleaning $src; this could take a while"
sudo rm -rf "$src" sudo rm -rf "$src"
else else
sudo mv "$src" "$dest" sudo mv "$src" "$dest"
@ -27,9 +29,9 @@ upgrade_path() {
sudo mkdir -p 0775 /var/cache/chromeos-chrome/ sudo mkdir -p 0775 /var/cache/chromeos-chrome/
sudo chown "$USER:portage" /var/cache/chromeos-chrome/ sudo chown "$USER:portage" /var/cache/chromeos-chrome/
upgrade_path chrome-src upgrade_path 1 chrome-src
upgrade_path chrome-src-internal upgrade_path 2 chrome-src-internal
upgrade_path chrome-src-custom upgrade_path 3 chrome-src-custom
upgrade_path chrome-src-custom-internal upgrade_path 4 chrome-src-custom-internal
exit 0 exit 0