Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(920)

Side by Side Diff: appengine/swarming/server/bot_archive.py

Issue 1306633002: Overhaul Android support and make Swarming bot use python-adb (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Fixes for error conditions Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Swarming Authors. All rights reserved. 2 # Copyright 2014 The Swarming Authors. All rights reserved.
3 # Use of this source code is governed by the Apache v2.0 license that can be 3 # Use of this source code is governed by the Apache v2.0 license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Generates the swarming_bot.zip archive for the bot. 6 """Generates the swarming_bot.zip archive for the bot.
7 7
8 Unlike the other scripts, this file can be run stand-alone to generate a 8 Unlike the other scripts, this file can be run stand-alone to generate a
9 swarming_bot.zip so it doesn't import anything from the AppEngine SDK. 9 swarming_bot.zip so it doesn't import anything from the AppEngine SDK.
10 10
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 'third_party/rsa/rsa/key.py', 137 'third_party/rsa/rsa/key.py',
138 'third_party/rsa/rsa/parallel.py', 138 'third_party/rsa/rsa/parallel.py',
139 'third_party/rsa/rsa/pem.py', 139 'third_party/rsa/rsa/pem.py',
140 'third_party/rsa/rsa/pkcs1.py', 140 'third_party/rsa/rsa/pkcs1.py',
141 'third_party/rsa/rsa/prime.py', 141 'third_party/rsa/rsa/prime.py',
142 'third_party/rsa/rsa/randnum.py', 142 'third_party/rsa/rsa/randnum.py',
143 'third_party/rsa/rsa/transform.py', 143 'third_party/rsa/rsa/transform.py',
144 'third_party/rsa/rsa/util.py', 144 'third_party/rsa/rsa/util.py',
145 'third_party/rsa/rsa/varblock.py', 145 'third_party/rsa/rsa/varblock.py',
146 'platforms/__init__.py', 146 'platforms/__init__.py',
147 'platforms/android.py',
147 'platforms/gce.py', 148 'platforms/gce.py',
148 'platforms/linux.py', 149 'platforms/linux.py',
149 'platforms/osx.py', 150 'platforms/osx.py',
150 'platforms/posix.py', 151 'platforms/posix.py',
151 'platforms/win.py', 152 'platforms/win.py',
152 'utils/__init__.py', 153 'utils/__init__.py',
153 'utils/cacert.pem', 154 'utils/cacert.pem',
154 'utils/file_path.py', 155 'utils/file_path.py',
155 'utils/logging_utils.py', 156 'utils/logging_utils.py',
156 'utils/lru.py', 157 'utils/lru.py',
157 'utils/net.py', 158 'utils/net.py',
158 'utils/oauth.py', 159 'utils/oauth.py',
159 'utils/on_error.py', 160 'utils/on_error.py',
160 'utils/subprocess42.py', 161 'utils/subprocess42.py',
161 'utils/threading_utils.py', 162 'utils/threading_utils.py',
162 'utils/tools.py', 163 'utils/tools.py',
163 'utils/zip_package.py', 164 'utils/zip_package.py',
164 'xsrf_client.py', 165 'xsrf_client.py',
166
167 # TODO(maruel): Find a way to only include these on linux platforms but it's
168 # not that large so it is not a big deal.
169 'adb/__init__.py',
170 'adb/adb_commands.py',
171 'adb/adb_protocol.py',
172 'adb/common.py',
173 'adb/fastboot.py',
174 'adb/filesync_protocol.py',
175 'adb/usb_exceptions.py',
176 'libusb1.py',
177 'usb1.py',
165 ) 178 )
166 179
167 def resolve_symlink(path): 180 def resolve_symlink(path):
168 """Processes path containing symlink on Windows. 181 """Processes path containing symlink on Windows.
169 182
170 This is needed to make ../swarming_bot/main_test.py pass on Windows because 183 This is needed to make ../swarming_bot/main_test.py pass on Windows because
171 git on Windows renders symlinks as normal files. 184 git on Windows renders symlinks as normal files.
172 """ 185 """
173 if sys.platform != 'win32' or os.path.isfile(path): 186 if sys.platform != 'win32' or os.path.isfile(path):
187 # This means that symlinks to file will not be resolved properly. In our
188 # case this is fine because the only 2 instances of this issue are
189 # libusb1.py and usb1.py, which are only used on Ubuntu.
174 return path 190 return path
175 parts = os.path.normpath(path).split(os.path.sep) 191 parts = os.path.normpath(path).split(os.path.sep)
176 for i in xrange(2, len(parts)): 192 for i in xrange(2, len(parts)):
177 partial = os.path.sep.join(parts[:i]) 193 partial = os.path.sep.join(parts[:i])
178 if os.path.isfile(partial): 194 if os.path.isfile(partial):
179 with open(partial) as f: 195 with open(partial) as f:
180 link = f.read() 196 link = f.read()
181 assert '\n' not in link and link, link 197 assert '\n' not in link and link, link
182 parts[i-1] = link 198 parts[i-1] = link
183 return os.path.normpath(os.path.sep.join(parts)) 199 return os.path.normpath(os.path.sep.join(parts))
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 with open(os.path.join(swarming_bot_dir, 'bot_config.py'), 'rb') as f: 286 with open(os.path.join(swarming_bot_dir, 'bot_config.py'), 'rb') as f:
271 additionals = {'bot_config.py': f.read()} 287 additionals = {'bot_config.py': f.read()}
272 with open(zip_file, 'wb') as f: 288 with open(zip_file, 'wb') as f:
273 f.write( 289 f.write(
274 get_swarming_bot_zip(swarming_bot_dir, config['server'], additionals)) 290 get_swarming_bot_zip(swarming_bot_dir, config['server'], additionals))
275 return 0 291 return 0
276 292
277 293
278 if __name__ == '__main__': 294 if __name__ == '__main__':
279 sys.exit(main()) 295 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | appengine/swarming/swarming_bot/adb » ('j') | appengine/swarming/swarming_bot/os_utilities.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698