| OLD | NEW | 
|---|
| 1 #!/bin/sh | 1 #!/bin/sh | 
| 2 | 2 | 
| 3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2009 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 # Remove old versioned directories from an .app bundle.  The built-up bundle | 7 # Remove old versioned directories from an .app bundle.  The built-up bundle | 
| 8 # only needs to contain the current versioned directory. | 8 # only needs to contain the current versioned directory. | 
| 9 | 9 | 
| 10 set -e | 10 set -e | 
| 11 | 11 | 
| 12 if [ $# -ne 1 ] ; then | 12 if [ $# -ne 1 ] ; then | 
| 13   echo "usage: ${0} VERSION" >& 2 | 13   echo "usage: ${0} VERSION" >& 2 | 
| 14   exit 1 | 14   exit 1 | 
| 15 fi | 15 fi | 
| 16 | 16 | 
| 17 VERSION="${1}" | 17 VERSION="${1}" | 
| 18 CONTENTS_DIR="${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}" | 18 CONTENTS_DIR="${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}" | 
| 19 VERSIONED_DIR="${CONTENTS_DIR}/Versions" | 19 VERSIONED_DIR="${CONTENTS_DIR}/Versions" | 
| 20 CURRENT_VERSIONED_DIR="${VERSIONED_DIR}/${VERSION}" | 20 CURRENT_VERSIONED_DIR="${VERSIONED_DIR}/${VERSION}" | 
| 21 | 21 | 
| 22 for dir in "${VERSIONED_DIR}/"* ; do | 22 for dir in "${VERSIONED_DIR}/"* ; do | 
| 23   if [ "${dir}" != "${CURRENT_VERSIONED_DIR}" ] ; then | 23   if [ "${dir}" != "${CURRENT_VERSIONED_DIR}" ] ; then | 
| 24     rm -rf "${dir}" | 24     rm -rf "${dir}" | 
| 25   fi | 25   fi | 
| 26 done | 26 done | 
| 27 |  | 
| 28 # Older builds did not use a versioned directory, and instead placed the |  | 
| 29 # framework, helper app, and other components directly within the main app |  | 
| 30 # bundle.  To keep incremental developer builds relatively pristine and |  | 
| 31 # equivalent to clean builds, these old components need to be cleaned up if |  | 
| 32 # present. |  | 
| 33 # Frameworks includes the app framework (Chromium Framework.framework or |  | 
| 34 # Google Chrome Framework.framework) and, if Keystone-enabled, |  | 
| 35 # KeystoneRegistration.framework.  To simplify this script, it removes the |  | 
| 36 # helper app at its old location under either of the supported branding names. |  | 
| 37 # TODO(mark): Remove the following section some time after October 27, 2009, |  | 
| 38 # allowing two weeks for the transition. |  | 
| 39 |  | 
| 40 rm -rf "${CONTENTS_DIR}/Frameworks" \ |  | 
| 41        "${CONTENTS_DIR}/Resources/Chromium Helper.app" \ |  | 
| 42        "${CONTENTS_DIR}/Resources/Google Chrome Helper.app" \ |  | 
| 43        "${CONTENTS_DIR}/MacOS/libavcodec.52.dylib" \ |  | 
| 44        "${CONTENTS_DIR}/MacOS/libavformat.52.dylib" \ |  | 
| 45        "${CONTENTS_DIR}/MacOS/libavutil.50.dylib" |  | 
| OLD | NEW | 
|---|