Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash -p | 1 #!/bin/bash -p |
| 2 | 2 |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium 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 # usage: dirdiffer.sh old_dir new_dir patch_dir | 7 # usage: dirdiffer.sh old_dir new_dir patch_dir |
| 8 # | 8 # |
| 9 # dirdiffer creates a patch directory patch_dir that represents the difference | 9 # dirdiffer creates a patch directory patch_dir that represents the difference |
| 10 # between old_dir and new_dir. patch_dir can be used with dirpatcher to | 10 # between old_dir and new_dir. patch_dir can be used with dirpatcher to |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 XZ="$(dirname "${0}")/xz" | 153 XZ="$(dirname "${0}")/xz" |
| 154 readonly XZ | 154 readonly XZ |
| 155 readonly GBS_SUFFIX='$gbs' | 155 readonly GBS_SUFFIX='$gbs' |
| 156 readonly BZ2_SUFFIX='$bz2' | 156 readonly BZ2_SUFFIX='$bz2' |
| 157 readonly GZ_SUFFIX='$gz' | 157 readonly GZ_SUFFIX='$gz' |
| 158 readonly XZ_SUFFIX='$xz' | 158 readonly XZ_SUFFIX='$xz' |
| 159 readonly PLAIN_SUFFIX='$raw' | 159 readonly PLAIN_SUFFIX='$raw' |
| 160 | 160 |
| 161 # Workaround for http://code.google.com/p/chromium/issues/detail?id=83180#c3 | 161 # Workaround for http://code.google.com/p/chromium/issues/detail?id=83180#c3 |
| 162 # In bash 4.0, "declare VAR" no longer initializes VAR if not already set. | 162 # In bash 4.0, "declare VAR" no longer initializes VAR if not already set. |
| 163 DIRDIFFER_EXCLUDE="${DIRDIFFER_EXCLUDE:-}" | 163 : ${DIRDIFFER_EXCLUDE:=} |
| 164 DIRDIFFER_NO_DIFF="${DIRDIFFER_NO_DIFF:-}" | 164 : ${DIRDIFFER_NO_DIFF:=} |
|
TVL
2011/05/20 02:14:01
i'll trust you on this syntax, it isn't one I've s
Mark Mentovai
2011/05/20 02:26:35
TVL wrote:
| |
| 165 | 165 |
| 166 err() { | 166 err() { |
| 167 local error="${1}" | 167 local error="${1}" |
| 168 | 168 |
| 169 echo "${ME}: ${error}" >& 2 | 169 echo "${ME}: ${error}" >& 2 |
| 170 } | 170 } |
| 171 | 171 |
| 172 declare -a g_cleanup g_verify_exclude | 172 declare -a g_cleanup g_verify_exclude |
| 173 cleanup() { | 173 cleanup() { |
| 174 local status=${?} | 174 local status=${?} |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 trap - EXIT | 536 trap - EXIT |
| 537 } | 537 } |
| 538 | 538 |
| 539 if [[ ${#} -ne 3 ]]; then | 539 if [[ ${#} -ne 3 ]]; then |
| 540 usage | 540 usage |
| 541 exit 2 | 541 exit 2 |
| 542 fi | 542 fi |
| 543 | 543 |
| 544 main "${@}" | 544 main "${@}" |
| 545 exit ${?} | 545 exit ${?} |
| OLD | NEW |