| 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 # This script is used to maintain the whitelist for package maintainer scripts. | 7 # This script is used to maintain the whitelist for package maintainer scripts. |
| 8 # If a package maintainer script is in the whitelist file then it is ok to skip | 8 # If a package maintainer script is in the whitelist file then it is ok to skip |
| 9 # running that maintainer script when installing the package. Otherwise there | 9 # running that maintainer script when installing the package. Otherwise there |
| 10 # should be an equivalent script that can perform those operation on a target | 10 # should be an equivalent script that can perform those operation on a target |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 return | 84 return |
| 85 fi | 85 fi |
| 86 | 86 |
| 87 cat <<EOF > "$path" | 87 cat <<EOF > "$path" |
| 88 #!/bin/bash | 88 #!/bin/bash |
| 89 | 89 |
| 90 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 90 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 91 # Use of this source code is governed by a BSD-style license that can be | 91 # Use of this source code is governed by a BSD-style license that can be |
| 92 # found in the LICENSE file. | 92 # found in the LICENSE file. |
| 93 | 93 |
| 94 # $file |
| 95 |
| 96 set -e |
| 97 |
| 94 # \$ROOT - The path to the target root file system. | 98 # \$ROOT - The path to the target root file system. |
| 95 # \$SRC_ROOT - The path to the source tree. | 99 # \$SRC_ROOT - The path to the source tree. |
| 96 | 100 |
| 97 # $file | |
| 98 | |
| 99 # TODO: The equivalent of $file running from outside of the target rootfs | 101 # TODO: The equivalent of $file running from outside of the target rootfs |
| 100 # that only uses tools from the build machine and not from the target. | 102 # that only uses tools from the build machine and not from the target. |
| 103 |
| 104 exit 1 |
| 105 |
| 101 EOF | 106 EOF |
| 102 chmod 0750 "$path" | 107 chmod 0750 "$path" |
| 103 } | 108 } |
| 104 | 109 |
| 105 # Show the script to the user for audit purposes. | 110 # Show the script to the user for audit purposes. |
| 106 # | 111 # |
| 107 # $1 - The script to show. | 112 # $1 - The script to show. |
| 108 show_script() { | 113 show_script() { |
| 109 local path=$1 | 114 local path=$1 |
| 110 local type=$(file -b "$path") | 115 local type=$(file -b "$path") |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 if is_whitelisted "$FLAGS_file"; then | 206 if is_whitelisted "$FLAGS_file"; then |
| 202 echo "Whitelisted" | 207 echo "Whitelisted" |
| 203 else | 208 else |
| 204 echo "Not whitelisted" | 209 echo "Not whitelisted" |
| 205 fi | 210 fi |
| 206 ;; | 211 ;; |
| 207 *) | 212 *) |
| 208 echo "Unknown command." | 213 echo "Unknown command." |
| 209 ;; | 214 ;; |
| 210 esac | 215 esac |
| OLD | NEW |