зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1218981 - [mozdevice] Ensure adb.py methods propagate root to other called methods, r=gbrown.
This commit is contained in:
Родитель
284d329d46
Коммит
6e30164c2e
|
@ -1426,18 +1426,19 @@ class ADBDevice(ADBCommand):
|
|||
if self._mkdir_p is None or self._mkdir_p:
|
||||
# Use shell_bool to catch the possible
|
||||
# non-zero exitcode if -p is not supported.
|
||||
if self.shell_bool('mkdir -p %s' % path, timeout=timeout):
|
||||
if self.shell_bool('mkdir -p %s' % path, timeout=timeout,
|
||||
root=root):
|
||||
self._mkdir_p = True
|
||||
return
|
||||
# mkdir -p is not supported. create the parent
|
||||
# directories individually.
|
||||
if not self.is_dir(posixpath.dirname(path)):
|
||||
if not self.is_dir(posixpath.dirname(path), root=root):
|
||||
parts = path.split('/')
|
||||
name = "/"
|
||||
for part in parts[:-1]:
|
||||
if part != "":
|
||||
name = posixpath.join(name, part)
|
||||
if not self.is_dir(name):
|
||||
if not self.is_dir(name, root=root):
|
||||
# Use shell_output to allow any non-zero
|
||||
# exitcode to raise an ADBError.
|
||||
self.shell_output('mkdir %s' % name,
|
||||
|
|
Загрузка…
Ссылка в новой задаче