cleanup_crates: Fix breakage from change in chromite.lib.
This fixes cleanup_crates since the SetupBoard API changed, and removes
Lakitu from the list of boards since it is not supported by the CrOS CI
anymore.
BUG=None
TEST=./cleanup_crates.py -c --log-level=debug
Change-Id: I32c6ed1cfbded46af8e5fd724871fa937bd7fd4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2884399
Commit-Queue: Allen Webb <allenwebb@google.com>
Tested-by: Allen Webb <allenwebb@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/contrib/cleanup_crates.py b/contrib/cleanup_crates.py
index 9c72d70..1505a47 100755
--- a/contrib/cleanup_crates.py
+++ b/contrib/cleanup_crates.py
@@ -24,12 +24,11 @@
import sys
from chromite.lib import build_target_lib
+from chromite.lib import chroot_util
from chromite.lib import commandline
from chromite.lib import constants
-from chromite.lib import cros_build_lib
from chromite.lib import osutils
from chromite.lib import portage_util
-from chromite.service import sysroot
# The path of the cache.
DEFAULT_CACHE_PATH = os.path.join(osutils.GetGlobalTempDir(),
@@ -48,7 +47,7 @@
}
# The set of boards to check. This only needs to be a representative set.
-BOARDS = {'eve', 'lakitu', 'tatl'} | (
+BOARDS = {'eve', 'tatl'} | (
set() if not os.path.isdir(os.path.join(constants.SOURCE_ROOT, 'src',
'private-overlays')) else
{'lasilla-ground', 'mistral'}
@@ -125,17 +124,10 @@
def _get_package_dependencies(board, package):
"""List the ebuild-version dependencies for a specific board & package."""
- if board and not os.path.isdir(cros_build_lib.GetSysroot(board)):
- config = sysroot.SetupBoardRunConfig(
- usepkg=True,
- jobs=os.cpu_count(),
- regen_configs=True,
- update_toolchain=False,
- upgrade_chroot=False,
- init_board_pkgs=True,
- local_build=False)
- sysroot.SetupBoard(build_target_lib.BuildTarget(board),
- run_configs=config)
+ if board and not os.path.isdir(
+ build_target_lib.get_default_sysroot_path(board)):
+ chroot_util.SetupBoard(board, update_chroot=False,
+ update_host_packages=False,)
return portage_util.GetPackageDependencies(board, package)