blob: 2d869413b389be1004773dee0c95c6ea8e5727cc [file] [log] [blame]
#!/bin/bash
# Copyright (c) 2010 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.
TEST_DIR="${ROOT_FS_DIR}/usr/local/autotest/site_tests/hardware_Components"
if [ -d "${TEST_DIR}" ]; then
pushd "${TEST_DIR}" >/dev/null
# Remove the DB directories belonging to other boards.
KEEPDB="data_${BOARD}"
ls -d data_* 2>/dev/null | grep -v "${KEEPDB}" | xargs rm -fr
if [ "${BOARD}" = "x86-agz" -o "${BOARD}" = "x86-mario" ]; then
# Ensure there is a DB directory in x86-agz or x86-mario.
if [ ! -d "${KEEPDB}" ]; then
echo "No component DB directory found at: ${KEEPDB}"
fi
# Remove the default DB since it is unnecessary.
DEFAULTDB="approved_components.default"
rm -f "${DEFAULTDB}"
fi
popd >/dev/null
fi