| 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 # Script to archive build results. Used by the buildbots. | 7 # Script to archive build results. Used by the buildbots. |
| 8 | 8 |
| 9 # Load common constants. This should be the first executable line. | 9 # Load common constants. This should be the first executable line. |
| 10 # The path to common.sh should be relative to your script's location. | 10 # The path to common.sh should be relative to your script's location. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 zip -r "$ZIPFILE" * | 109 zip -r "$ZIPFILE" * |
| 110 cd - | 110 cd - |
| 111 | 111 |
| 112 # Update LATEST file | 112 # Update LATEST file |
| 113 echo "$LAST_CHANGE" > "${FLAGS_to}/LATEST" | 113 echo "$LAST_CHANGE" > "${FLAGS_to}/LATEST" |
| 114 | 114 |
| 115 # Make sure files are readable | 115 # Make sure files are readable |
| 116 chmod 644 "$ZIPFILE" "${FLAGS_to}/LATEST" | 116 chmod 644 "$ZIPFILE" "${FLAGS_to}/LATEST" |
| 117 chmod 755 "$OUTDIR" | 117 chmod 755 "$OUTDIR" |
| 118 | 118 |
| 119 if [ $FLAGS_official_build -eq $FLAGS_TRUE ] | 119 if [ $FLAGS_test_mod -eq $FLAGS_TRUE -a $FLAGS_official_build -eq $FLAGS_TRUE ] |
| 120 then | 120 then |
| 121 echo "Creating hwqual archive" | 121 echo "Creating hwqual archive" |
| 122 HWQUAL_NAME="chromeos-hwqual-${FLAGS_board}-${CHROMEOS_VERSION_STRING}" | 122 HWQUAL_NAME="chromeos-hwqual-${FLAGS_board}-${CHROMEOS_VERSION_STRING}" |
| 123 "${SCRIPTS_DIR}/archive_hwqual" --from "${OUTDIR}" \ | 123 "${SCRIPTS_DIR}/archive_hwqual" --from "${OUTDIR}" \ |
| 124 --output_tag "${HWQUAL_NAME}" | 124 --output_tag "${HWQUAL_NAME}" |
| 125 fi | 125 fi |
| 126 | 126 |
| 127 # Purge old builds if necessary | 127 # Purge old builds if necessary |
| 128 if [ $FLAGS_keep_max -gt 0 ] | 128 if [ $FLAGS_keep_max -gt 0 ] |
| 129 then | 129 then |
| 130 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." | 130 echo "Deleting old builds (all but the newest ${FLAGS_keep_max})..." |
| 131 cd "$FLAGS_to" | 131 cd "$FLAGS_to" |
| 132 # +2 because line numbers start at 1 and need to skip LATEST file | 132 # +2 because line numbers start at 1 and need to skip LATEST file |
| 133 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` | 133 rm -rf `ls -t1 | tail --lines=+$(($FLAGS_keep_max + 2))` |
| 134 cd - | 134 cd - |
| 135 fi | 135 fi |
| 136 | 136 |
| 137 echo "Done." | 137 echo "Done." |
| OLD | NEW |