OLD | NEW |
---|---|
1 #!/bin/bash -e | 1 #!/bin/bash -e |
2 | 2 |
3 # Script to install everything needed to build chromium (well, ideally, anyway) | 3 # Script to install everything needed to build chromium (well, ideally, anyway) |
4 # See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions | 4 # See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions |
5 # and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit | 5 # and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit |
6 | 6 |
7 install_gold() { | 7 install_gold() { |
8 # Gold is optional; it's a faster replacement for ld, | 8 # Gold is optional; it's a faster replacement for ld, |
9 # and makes life on 2GB machines much more pleasant. | 9 # and makes life on 2GB machines much more pleasant. |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 dbg_list= | 161 dbg_list= |
162 fi | 162 fi |
163 | 163 |
164 sudo apt-get update | 164 sudo apt-get update |
165 | 165 |
166 # We initially run "apt-get" with the --reinstall option and parse its output. | 166 # We initially run "apt-get" with the --reinstall option and parse its output. |
167 # This way, we can find all the packages that need to be newly installed | 167 # This way, we can find all the packages that need to be newly installed |
168 # without accidentally promoting any packages from "auto" to "manual". | 168 # without accidentally promoting any packages from "auto" to "manual". |
169 # We then re-run "apt-get" with just the list of missing packages. | 169 # We then re-run "apt-get" with just the list of missing packages. |
170 echo "Finding missing packages..." | 170 echo "Finding missing packages..." |
171 packages="${dev_list} ${lib_list} ${dbg_list} | 171 packages="${dev_list} ${lib_list} ${dbg_list}" |
172 $([ "$(uname -m)" = x86_64 ] && echo ${cmp_list})" | 172 if [ "$(uname -m)" = x86_64 ]; then |
Lei Zhang
2009/08/10 18:53:49
nit: can you put x86_64 in doublequotes?
| |
173 packages+=" ${cmp_list})" | |
174 fi | |
173 echo "Packages required: $packages" | 175 echo "Packages required: $packages" |
174 new_list_cmd="sudo apt-get install --reinstall $(echo $packages)" | 176 new_list_cmd="sudo apt-get install --reinstall $(echo $packages)" |
175 if new_list="$(yes n | LANG=C $new_list_cmd)" | 177 if new_list="$(yes n | LANG=C $new_list_cmd)" |
176 then | 178 then |
177 echo "No missing packages, and the packages are up-to-date." | 179 echo "No missing packages, and the packages are up-to-date." |
178 elif [ $? -eq 1 ] | 180 elif [ $? -eq 1 ] |
179 then | 181 then |
180 # We expect apt-get to have exit status of 1. | 182 # We expect apt-get to have exit status of 1. |
181 # This indicates that we canceled the install with "yes n|". | 183 # This indicates that we canceled the install with "yes n|". |
182 new_list=$(echo $new_list | | 184 new_list=$(echo $new_list | |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
347 sed -e 's/[.]so[.][0-9].*/.so/' | | 349 sed -e 's/[.]so[.][0-9].*/.so/' | |
348 sort -u); do | 350 sort -u); do |
349 [ "x${i##*/}" = "xld-linux.so" ] && continue | 351 [ "x${i##*/}" = "xld-linux.so" ] && continue |
350 [ -r "$i" ] && continue | 352 [ -r "$i" ] && continue |
351 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | | 353 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | |
352 sort -n | tail -n 1)" | 354 sort -n | tail -n 1)" |
353 [ -r "$i.$j" ] || continue | 355 [ -r "$i.$j" ] || continue |
354 sudo ln -s "${i##*/}.$j" "$i" | 356 sudo ln -s "${i##*/}.$j" "$i" |
355 done | 357 done |
356 fi | 358 fi |
OLD | NEW |