Chromium Code Reviews| Index: mod_for_factory_scripts/500populateQualDbs |
| diff --git a/mod_for_factory_scripts/500populateQualDbs b/mod_for_factory_scripts/500populateQualDbs |
| index fff9a05642290e05285b1fb554a9cc351d828fc0..4424f641255857d6ece3476754b564c0346fd022 100755 |
| --- a/mod_for_factory_scripts/500populateQualDbs |
| +++ b/mod_for_factory_scripts/500populateQualDbs |
| @@ -6,16 +6,25 @@ |
| TEST_DIR="${ROOT_FS_DIR}/usr/local/autotest/site_tests/hardware_Components" |
| -pushd ${TEST_DIR} 1> /dev/null |
| +pushd "${TEST_DIR}" >/dev/null |
|
Nick Sanders
2010/11/18 05:12:08
Can you check for existence of dir
Hung-Te
2010/11/18 05:49:31
Just saw you've created another refine for that -
|
|
Nick Sanders
2010/11/18 05:12:08
Can you also clean 600xxx in mod_for_factory
Hung-Te
2010/11/18 05:49:31
Added in latest CL.
|
| # Remove the DB directories belonging to other boards. |
| KEEPDB="data_${BOARD}" |
| -ls -d data_* 2> /dev/null | grep -v ${KEEPDB} | xargs rm -fr |
| +ls -d data_* 2>/dev/null | grep -v "${KEEPDB}" | xargs rm -fr |
| -# Ensure there is DB directory in x86-agz and x86-mario. |
| -if [ ! -d ${KEEPDB} -a \ |
| - \( "${BOARD}" = "x86-agz" -o "${BOARD}" = "x86-mario" \) ]; then |
| - echo "No component DB directory found at: ${KEEPDB}" |
| -fi |
| +# Ensure there is DB directory in authorized list |
| +case "${BOARD}" in |
| + x86-agz | x86-mario ) |
| + if [ ! -d "${KEEPDB}" ]; then |
| + echo "No component DB directory found at: ${KEEPDB}" |
| + # TODO(hungte) should we exit as failure when the DB is missing? |
| + fi |
| + ;; |
| -popd 1> /dev/null |
| + * ) |
| + # No need to check for unknown boards |
| + true |
| + ;; |
| +esac |
| + |
| +popd >/dev/null |