summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbudorick@chromium.org <jbudorick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-18 18:05:42 +0000
committerjbudorick@chromium.org <jbudorick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-18 18:06:54 +0000
commit1a682bc6ce930a908380397acc9719cd61f6c63a (patch)
treebdeb8d59ea400e028c0f615e514d7ece1c85ba1a
parent4abccc4a20072efed7c5796acde121cc5a24b8f2 (diff)
downloadchromium_src-1a682bc6ce930a908380397acc9719cd61f6c63a.zip
chromium_src-1a682bc6ce930a908380397acc9719cd61f6c63a.tar.gz
chromium_src-1a682bc6ce930a908380397acc9719cd61f6c63a.tar.bz2
[Android] Make adb shell commands with single quotes run correctly.
BUG=401163 Review URL: https://codereview.chromium.org/477153003 Cr-Commit-Position: refs/heads/master@{#290299} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290299 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--build/android/pylib/android_commands.py2
-rw-r--r--build/android/pylib/device_settings.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index 5fc2fbd..7c73b52 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -713,7 +713,7 @@ class AndroidCommands(object):
"""
self._LogShell(command)
if "'" in command:
- logging.warning(command + " contains ' quotes")
+ command = command.replace('\'', '\'\\\'\'')
result = self._adb.SendShellCommand(
"'%s'" % command, timeout_time).splitlines()
# TODO(b.kelemen): we should really be able to drop the stderr of the
diff --git a/build/android/pylib/device_settings.py b/build/android/pylib/device_settings.py
index 3612a81..ec8a79a 100644
--- a/build/android/pylib/device_settings.py
+++ b/build/android/pylib/device_settings.py
@@ -93,7 +93,7 @@ commit transaction;""" % {
'columns': ', '.join(columns),
'values': ', '.join(["'%s'" % value for value in values])
}
- output_msg = device.RunShellCommand('\'sqlite3 %s "%s"\'' % (db, cmd))
+ output_msg = device.RunShellCommand('sqlite3 %s "%s"' % (db, cmd))
if output_msg:
print ' '.join(output_msg)