Bug 785108 - Fix devicemanagerADB's isDir to handle symbolic links properly;r=jmaher DONTBUILD
authorWilliam Lachance <wlachance@mozilla.com>
Thu, 23 Aug 2012 15:56:18 -0400
changeset 103204 e53c5799835032cc436209da3194d3b43474d524
parent 103203 0a7b2834337b53afb19e895aaa4de56d7a0edeb7
child 103205 bb414dc59262f90ea68031b6e0034ff952e56c03
push id13879
push userwlachance@mozilla.com
push dateThu, 23 Aug 2012 19:56:36 +0000
treeherdermozilla-inbound@e53c57998350 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs785108
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 785108 - Fix devicemanagerADB's isDir to handle symbolic links properly;r=jmaher DONTBUILD
build/mobile/devicemanagerADB.py
--- a/build/mobile/devicemanagerADB.py
+++ b/build/mobile/devicemanagerADB.py
@@ -285,27 +285,24 @@ class DeviceManagerADB(DeviceManager):
               else:
                   out += self.removeFile(remoteDir.strip() + "/" + f.strip())
           out += self.removeSingleDir(remoteDir.strip())
       else:
           out += self.removeFile(remoteDir.strip())
       return out
 
   def isDir(self, remotePath):
-      p = self.runCmd(["shell", "ls", "-a", remotePath])
+      p = self.runCmd(["shell", "ls", "-a", remotePath + '/'])
+
       data = p.stdout.readlines()
-      if (len(data) == 0):
-          return True
-      if (len(data) == 1):
-          if (data[0].rstrip() == remotePath):
+      if len(data) == 1:
+          res = data[0]
+          if "Not a directory" in res or "No such file or directory" in res:
               return False
-          if (data[0].find("No such file or directory") != -1):
-              return False
-          if (data[0].find("Not a directory") != -1):
-              return False
+
       return True
 
   def listFiles(self, rootdir):
       p = self.runCmd(["shell", "ls", "-a", rootdir])
       data = p.stdout.readlines()
       data[:] = [item.rstrip('\r\n') for item in data]
       if (len(data) == 1):
           if (data[0] == rootdir):