Update gmerge to support deep upgrades.

With --deep mode, gmerge updates all necessary packages. This is useful for
ensuring dependencies are up to date.

Other features added in this CL:
 - /usr/local/portage is rm -rf'd at beginning of gmerge as well in case
   leftover state is there from a failed merge.
 - Improve error message when devserver is not running.
 - The --extra flag allows you to specify extra flags to emerge. This is useful
   for example to exclude certain packages from the upgrade. E.g
    gmerge -Dn chromeos -x '--usepkg-exclude=trousers'

BUG=chromium-os:15606, chromium-os:11332, chromium-os:14748
TEST=Try gmerging a deep upgrade of power manager. If packages that use enewuser
     / enewgroup are excluded, we can upgrade the rest of the packages. If the
     latest toolchain is used which includes getent, we can upgrade those

Change-Id: Id01b35133486ec9448b62c80194d61ff1360e87e
Reviewed-on: http://gerrit.chromium.org/gerrit/1320
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: David James <davidjames@chromium.org>
2 files changed