Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 TEST_DIR="${ROOT_FS_DIR}/usr/local/autotest/site_tests/hardware_Components" | 7 TEST_DIR="${ROOT_FS_DIR}/usr/local/autotest/site_tests/hardware_Components" |
| 8 | 8 |
| 9 pushd ${TEST_DIR} 1> /dev/null | 9 if [ -d "${TEST_DIR}" ]; then |
| 10 pushd "${TEST_DIR}" >/dev/null | |
| 10 | 11 |
| 11 # Remove the DB directories belonging to other boards. | 12 # Remove the DB directories belonging to other boards. |
| 12 KEEPDB="data_${BOARD}" | 13 KEEPDB="data_${BOARD}" |
| 13 ls -d data_* 2> /dev/null | grep -v ${KEEPDB} | xargs rm -fr | 14 ls -d data_* 2>/dev/null | grep -v "${KEEPDB}" | xargs rm -fr |
| 14 | 15 |
| 15 # Ensure there is DB directory in x86-agz and x86-mario. | 16 # Ensure there is DB directory in x86-agz and x86-mario. |
| 16 if [ ! -d ${KEEPDB} -a \ | 17 if [ ! -d "${KEEPDB}" -a \ |
|
Hung-Te
2010/11/18 05:30:18
I'd suggest to rewrite this as
if [ ! -d "${KEEPDB
Nick Sanders
2010/11/18 05:54:15
Thanks, that is much better!
| |
| 17 \( "${BOARD}" = "x86-agz" -o "${BOARD}" = "x86-mario" \) ]; then | 18 \( "${BOARD}" = "x86-agz" -o "${BOARD}" = "x86-mario" \) ]; then |
| 18 echo "No component DB directory found at: ${KEEPDB}" | 19 echo "No component DB directory found at: ${KEEPDB}" |
| 20 fi | |
| 21 | |
| 22 popd >/dev/null | |
| 19 fi | 23 fi |
| 20 | |
| 21 popd 1> /dev/null | |
| OLD | NEW |