OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 Google Inc. All rights reserved. | 2 # Copyright (c) 2012 Google Inc. 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 """Utility functions to perform Xcode-style build steps. | 6 """Utility functions to perform Xcode-style build steps. |
7 | 7 |
8 These functions are executed via gyp-mac-tool when using the Makefile generator. | 8 These functions are executed via gyp-mac-tool when using the Makefile generator. |
9 """ | 9 """ |
10 | 10 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
193 fp.close() | 193 fp.close() |
194 | 194 |
195 def ExecFlock(self, lockfile, *cmd_list): | 195 def ExecFlock(self, lockfile, *cmd_list): |
196 """Emulates the most basic behavior of Linux's flock(1).""" | 196 """Emulates the most basic behavior of Linux's flock(1).""" |
197 # Rely on exception handling to report errors. | 197 # Rely on exception handling to report errors. |
198 fd = os.open(lockfile, os.O_RDONLY|os.O_NOCTTY|os.O_CREAT, 0o666) | 198 fd = os.open(lockfile, os.O_RDONLY|os.O_NOCTTY|os.O_CREAT, 0o666) |
199 fcntl.flock(fd, fcntl.LOCK_EX) | 199 fcntl.flock(fd, fcntl.LOCK_EX) |
200 return subprocess.call(cmd_list) | 200 return subprocess.call(cmd_list) |
201 | 201 |
202 def ExecFilterLibtool(self, *cmd_list): | 202 def ExecFilterLibtool(self, *cmd_list): |
203 """Calls libtool and filters out 'libtool: file: foo.o has no symbols'.""" | 203 """Calls libtool and filters out 'libtool: file: foo.o has no symbols'.""" |
Nico
2013/10/10 19:56:01
change the comment to say '/path/to/libtool: file:
| |
204 libtool_re = re.compile(r'^libtool: file: .* has no symbols$') | 204 libtool_re = re.compile(r'^.*libtool: file: .* has no symbols$') |
205 libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE) | 205 libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE) |
206 _, err = libtoolout.communicate() | 206 _, err = libtoolout.communicate() |
207 for line in err.splitlines(): | 207 for line in err.splitlines(): |
208 if not libtool_re.match(line): | 208 if not libtool_re.match(line): |
209 print >>sys.stderr, line | 209 print >>sys.stderr, line |
210 return libtoolout.returncode | 210 return libtoolout.returncode |
211 | 211 |
212 def ExecPackageFramework(self, framework, version): | 212 def ExecPackageFramework(self, framework, version): |
213 """Takes a path to Something.framework and the Current version of that and | 213 """Takes a path to Something.framework and the Current version of that and |
214 sets up all the symlinks.""" | 214 sets up all the symlinks.""" |
(...skipping 26 matching lines...) Expand all Loading... | |
241 def _Relink(self, dest, link): | 241 def _Relink(self, dest, link): |
242 """Creates a symlink to |dest| named |link|. If |link| already exists, | 242 """Creates a symlink to |dest| named |link|. If |link| already exists, |
243 it is overwritten.""" | 243 it is overwritten.""" |
244 if os.path.lexists(link): | 244 if os.path.lexists(link): |
245 os.remove(link) | 245 os.remove(link) |
246 os.symlink(dest, link) | 246 os.symlink(dest, link) |
247 | 247 |
248 | 248 |
249 if __name__ == '__main__': | 249 if __name__ == '__main__': |
250 sys.exit(main(sys.argv[1:])) | 250 sys.exit(main(sys.argv[1:])) |
OLD | NEW |