OLD | NEW |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # This figures out the architecture of the version of Python we are building | 6 # This figures out the architecture of the version of Python we are building |
7 # pyautolib against. | 7 # pyautolib against. |
8 # | 8 # |
9 # python_arch.sh /usr/lib/libpython2.5.so.1.0 | 9 # python_arch.sh /usr/lib/libpython2.5.so.1.0 |
10 # python_arch.sh /path/to/sysroot/usr/lib/libpython2.4.so.1.0 | 10 # python_arch.sh /path/to/sysroot/usr/lib/libpython2.4.so.1.0 |
11 # | 11 # |
12 | 12 |
13 file_out=$(file --dereference "$1") | 13 file_out=$(file --dereference "$1") |
14 if [ $? -ne 0 ]; then | 14 if [ $? -ne 0 ] || [ ! -e "$1" ] ; then |
Mark Mentovai
2014/01/13 22:39:24
A short form of your checkin comment would do a wh
vapier
2014/01/13 22:45:19
done
| |
15 echo unknown | 15 echo unknown |
16 exit 0 | 16 exit 0 |
17 fi | 17 fi |
18 | 18 |
19 echo $file_out | grep -qs "ARM" | 19 echo $file_out | grep -qs "ARM" |
20 if [ $? -eq 0 ]; then | 20 if [ $? -eq 0 ]; then |
21 echo arm | 21 echo arm |
22 exit 0 | 22 exit 0 |
23 fi | 23 fi |
24 | 24 |
25 echo $file_out | grep -qs "MIPS" | 25 echo $file_out | grep -qs "MIPS" |
26 if [ $? -eq 0 ]; then | 26 if [ $? -eq 0 ]; then |
27 echo mipsel | 27 echo mipsel |
28 exit 0 | 28 exit 0 |
29 fi | 29 fi |
30 | 30 |
31 echo $file_out | grep -qs "x86-64" | 31 echo $file_out | grep -qs "x86-64" |
32 if [ $? -eq 0 ]; then | 32 if [ $? -eq 0 ]; then |
33 echo x64 | 33 echo x64 |
34 exit 0 | 34 exit 0 |
35 fi | 35 fi |
36 | 36 |
37 echo $file_out | grep -qs "Intel 80386" | 37 echo $file_out | grep -qs "Intel 80386" |
38 if [ $? -eq 0 ]; then | 38 if [ $? -eq 0 ]; then |
39 echo ia32 | 39 echo ia32 |
40 exit 0 | 40 exit 0 |
41 fi | 41 fi |
42 | 42 |
Mark Mentovai
2014/01/13 22:39:24
I’m inclined to do the -e check way down here, as
vapier
2014/01/13 22:45:19
it's unlikely, but if the error message contains t
| |
43 exit 1 | 43 exit 1 |
OLD | NEW |