chroot_version_hooks.d: clean out old chromeos-base/chromeos

Now that our builders aren't pulling in chromeos-base/chromeos to build
binpkgs, people with older chroots are hitting an unresolvable block.
We don't need this package anymore so just unmerge it.

TEST=`./run_chroot_version_hooks` removed chromeos-base/chromeos package & from world set from all boards

Change-Id: Ia92ae3c0cd3ec3f95fa1cb5c3fa2d8641b762157
Reviewed-by: Gaurav Shah <>
Tested-by: Mike Frysinger <>
Commit-Queue: Mike Frysinger <>
diff --git a/chroot_version_hooks.d/90_migrate_to_target-os b/chroot_version_hooks.d/90_migrate_to_target-os
new file mode 100644
index 0000000..7c27b27
--- /dev/null
+++ b/chroot_version_hooks.d/90_migrate_to_target-os
@@ -0,0 +1,17 @@
+# Copyright 2014 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+# Some people have chromeos-base/chromeos listed in their @world set which
+# causes binpkg-only upgrades to fail: we aren't building this package
+# anymore as we've converted everyone to virtual/target-os.  So clean it out.
+sudo sed -i -e "/^${package//\//\/}$/d" /build/*/var/lib/portage/world
+for sysroot in /build/*; do
+  if qlist --root "${sysroot}" -ICe ${package} >&/dev/null; then
+    info "Cleaning ${package} from ${sysroot}"
+    sudo qmerge --root "${sysroot}" -yU ${package}
+  fi