tools(install-build-deps): support Python 3

`sys.platform()` is `linux` in Python3 not `linux2`

Change-Id: I0ce9f1b1ca6fb19fdcf0ffa1f4eb05ba145416ba
diff --git a/tools/install-build-deps b/tools/install-build-deps
index 26a2e1a..166637c 100755
--- a/tools/install-build-deps
+++ b/tools/install-build-deps
@@ -24,6 +24,7 @@
 import zipfile
 
 from collections import namedtuple
+from platform import system
 
 from compat import urlretrieve
 
@@ -36,8 +37,8 @@
 # |target_folder|, taking care of stripping the root folder if it's a single
 # root (to avoid ending up with buildtools/protobuf/protobuf-1.2.3/... and have
 # instead just buildtools/protobuf).
-# |target_platform| is either 'darwin', 'linux2' or 'all' and applies the dep
-# only on the given platform (ask python why linux2 and not just linux).
+# |target_platform| is either 'darwin', 'linux' or 'all' and applies the dep
+# only on the given platform
 
 # Dependencies required to build code on the host or when targeting desktop OS.
 BUILD_DEPS_HOST = [
@@ -47,7 +48,7 @@
      'b5b65ca39d93a7cde9fa713be31b114755252f28', 'darwin'),
     ('buildtools/linux64/gn',
      'https://storage.googleapis.com/perfetto/gn-linux64-1370d9c5358868b7b66292821b6fe61950826870',
-     '1370d9c5358868b7b66292821b6fe61950826870', 'linux2'),
+     '1370d9c5358868b7b66292821b6fe61950826870', 'linux'),
 
     # clang-format
     ('buildtools/mac/clang-format',
@@ -55,7 +56,7 @@
      '025ca7c75f37ef4a40f3a67d81ddd11d7d0cdb9b', 'darwin'),
     ('buildtools/linux64/clang-format',
      'https://storage.googleapis.com/chromium-clang-format/942fc8b1789144b8071d3fc03ff0fcbe1cf81ac8',
-     '942fc8b1789144b8071d3fc03ff0fcbe1cf81ac8', 'linux2'),
+     '942fc8b1789144b8071d3fc03ff0fcbe1cf81ac8', 'linux'),
     # Keep the SHA1 in sync with |clang_format_rev| in chromium //buildtools/DEPS.
     ('buildtools/clang_format/script',
      'https://chromium.googlesource.com/chromium/llvm-project/cfe/tools/clang-format.git',
@@ -67,7 +68,7 @@
      'c15b0698da038b2bd2e8970c14c75fadc06b1add', 'darwin'),
     ('buildtools/linux64/ninja',
      'https://storage.googleapis.com/perfetto/ninja-linux64-c866952bda50c29a669222477309287119bbb7e8',
-     'c866952bda50c29a669222477309287119bbb7e8', 'linux2'),
+     'c866952bda50c29a669222477309287119bbb7e8', 'linux'),
 
     # Keep in sync with Android's //external/googletest/README.version.
     ('buildtools/googletest.zip',
@@ -95,12 +96,12 @@
     # tools/clang/scripts/update.py.
     ('buildtools/clang.tgz',
      'https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-365097-f7e52fbd-8.tgz',
-     'fe1b1e5bd7381ae655661cb9658487389561568d', 'linux2'),
+     'fe1b1e5bd7381ae655661cb9658487389561568d', 'linux'),
 
     # Keep in sync with chromium DEPS.
     ('buildtools/libfuzzer',
      'https://chromium.googlesource.com/chromium/llvm-project/compiler-rt/lib/fuzzer.git',
-     'b9f51dc8c98065df0c8da13c051046f5bab833db', 'linux2'),
+     'b9f51dc8c98065df0c8da13c051046f5bab833db', 'linux'),
 
     # Benchmarking tool.
     ('buildtools/benchmark.zip',
@@ -167,7 +168,7 @@
      'f990aafaffec0b583d2c5420bfa622e52ac14248', 'darwin'),
     ('buildtools/ndk.zip',
      'https://dl.google.com/android/repository/android-ndk-r17b-linux-x86_64.zip',
-     'dd5762ee7ef4995ad04fe0c45a608c344d99ca9f', 'linux2'),
+     'dd5762ee7ef4995ad04fe0c45a608c344d99ca9f', 'linux'),
 ]
 
 # Dependencies required to run Android tests.
@@ -183,7 +184,7 @@
      'e75b6137dc444f777eb02f44a6d9819b3aabff82', 'darwin'),
     ('buildtools/android_sdk/platform-tools.zip',
      'https://dl.google.com/android/repository/platform-tools_r26.0.0-linux.zip',
-     '00de8a6631405b617c10f68cd11ff2e1cd528e23', 'linux2'),
+     '00de8a6631405b617c10f68cd11ff2e1cd528e23', 'linux'),
 
     # Android emulator binaries.
     ('buildtools/emulator',
@@ -202,7 +203,7 @@
      '6d9a122785f38c256add3b25f74adf125497861a', 'darwin'),
     ('buildtools/nodejs.tgz',
      'https://storage.googleapis.com/perfetto/node-v10.3.0-linux-x64.tar.xz',
-     '118f6ea19f75089b3f12ac2ddfce357bff872b5e', 'linux2'),
+     '118f6ea19f75089b3f12ac2ddfce357bff872b5e', 'linux'),
     ('buildtools/emsdk/emscripten.tgz',
      'https://storage.googleapis.com/perfetto/emscripten-1.37.40.tar.gz',
      '588c28221321ebbdfc8e3a6f47ea6106f589669b', 'all'),
@@ -211,10 +212,10 @@
      '7a894ef0a52821c62f6abaac552dc4ce5d424607', 'darwin'),
     ('buildtools/emsdk/llvm.tgz',
      'https://storage.googleapis.com/perfetto/emscripten-llvm-e1.37.40-static-linux.tar.gz',
-     '478501b9b7a14884e546c84efe209a90052cbb07', 'linux2'),
+     '478501b9b7a14884e546c84efe209a90052cbb07', 'linux'),
     ('buildtools/d8.tgz',
-     'https://storage.googleapis.com/perfetto/d8-linux2-5.7.492.65.tar.gz',
-     '95e82ad7faf0a6f74d950c2aa65e3858b7bdb6c6', 'linux2'),
+     'https://storage.googleapis.com/perfetto/d8-linux-5.7.492.65.tar.gz',
+     '95e82ad7faf0a6f74d950c2aa65e3858b7bdb6c6', 'linux'),
     ('buildtools/d8.tgz',
      'https://storage.googleapis.com/perfetto/d8-darwin-6.6.346.32.tar.gz',
      '1abd630619bb1977ab62095570a113d782a1545d', 'darwin'),
@@ -320,7 +321,7 @@
     deps += UI_DEPS
   deps_updated = False
   for rel_path, url, expected_sha1, platform in deps:
-    if (platform != 'all' and platform != sys.platform):
+    if (platform != 'all' and platform != system().lower()):
       continue
     local_path = os.path.join(ROOT_DIR, rel_path)
     if url.endswith('.git'):