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

Side by Side Diff: build/android/pylib/android_commands.py

Issue 926023002: [Android] Do not overwrite command when using the run_pie wrapper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Provides an interface to communicate with the device via the adb command. 5 """Provides an interface to communicate with the device via the adb command.
6 6
7 Assumes adb binary is currently on system path. 7 Assumes adb binary is currently on system path.
8 """ 8 """
9 # pylint: skip-file 9 # pylint: skip-file
10 10
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 # whether a wrapper for running PIE executable is needed (only Android ICS) 687 # whether a wrapper for running PIE executable is needed (only Android ICS)
688 # or not. The results is cached, so the wrapper is pushed only once. 688 # or not. The results is cached, so the wrapper is pushed only once.
689 if self._pie_wrapper is None: 689 if self._pie_wrapper is None:
690 # None: did not check; '': did check and not needed; '/path': use /path. 690 # None: did not check; '': did check and not needed; '/path': use /path.
691 self._pie_wrapper = '' 691 self._pie_wrapper = ''
692 if self.GetBuildId().startswith('I'): # Ixxxx = Android ICS. 692 if self.GetBuildId().startswith('I'): # Ixxxx = Android ICS.
693 run_pie_dist_path = os.path.join(constants.GetOutDirectory(), 'run_pie') 693 run_pie_dist_path = os.path.join(constants.GetOutDirectory(), 'run_pie')
694 assert os.path.exists(run_pie_dist_path), 'Please build run_pie' 694 assert os.path.exists(run_pie_dist_path), 'Please build run_pie'
695 # The PIE loader must be pushed manually (i.e. no PushIfNeeded) because 695 # The PIE loader must be pushed manually (i.e. no PushIfNeeded) because
696 # PushIfNeeded requires md5sum and md5sum requires the wrapper as well. 696 # PushIfNeeded requires md5sum and md5sum requires the wrapper as well.
697 command = 'push %s %s' % (run_pie_dist_path, PIE_WRAPPER_PATH) 697 adb_command = 'push %s %s' % (run_pie_dist_path, PIE_WRAPPER_PATH)
698 assert _HasAdbPushSucceeded(self._adb.SendCommand(command)) 698 assert _HasAdbPushSucceeded(self._adb.SendCommand(adb_command))
699 self._pie_wrapper = PIE_WRAPPER_PATH 699 self._pie_wrapper = PIE_WRAPPER_PATH
700 700
701 if self._pie_wrapper: 701 if self._pie_wrapper:
702 command = '%s %s' % (self._pie_wrapper, command) 702 command = '%s %s' % (self._pie_wrapper, command)
703 if lib_path: 703 if lib_path:
704 command = 'LD_LIBRARY_PATH=%s %s' % (lib_path, command) 704 command = 'LD_LIBRARY_PATH=%s %s' % (lib_path, command)
705 return self.GetShellCommandStatusAndOutput(command, *args, **kw) 705 return self.GetShellCommandStatusAndOutput(command, *args, **kw)
706 706
707 # It is tempting to turn this function into a generator, however this is not 707 # It is tempting to turn this function into a generator, however this is not
708 # possible without using a private (local) adb_shell instance (to ensure no 708 # possible without using a private (local) adb_shell instance (to ensure no
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1963 """ 1963 """
1964 def __init__(self, output): 1964 def __init__(self, output):
1965 self._output = output 1965 self._output = output
1966 1966
1967 def write(self, data): 1967 def write(self, data):
1968 data = data.replace('\r\r\n', '\n') 1968 data = data.replace('\r\r\n', '\n')
1969 self._output.write(data) 1969 self._output.write(data)
1970 1970
1971 def flush(self): 1971 def flush(self):
1972 self._output.flush() 1972 self._output.flush()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698