Temporary make generate_license.py to work with non-existing paths.

The recent change in chromium, libevent, was moved from
base/third_party to third_party. While GN build works by transient GN
build targets, building an android archive does not work because it
requires libevent's license file in the specific path.

To unblock autoroller, temporarily make generate_license.py work with
non-existing paths.

Bug: chromium:1335194
Change-Id: Icb79a27c4c41f603e5ffc9170f4ecb7440ec9e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266520
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#37307}
diff --git a/tools_webrtc/libs/generate_licenses.py b/tools_webrtc/libs/generate_licenses.py
index d805477..bcc6890 100755
--- a/tools_webrtc/libs/generate_licenses.py
+++ b/tools_webrtc/libs/generate_licenses.py
@@ -53,7 +53,8 @@
     'libaom': ['third_party/libaom/source/libaom/LICENSE'],
     'libc++': ['buildtools/third_party/libc++/trunk/LICENSE.TXT'],
     'libc++abi': ['buildtools/third_party/libc++abi/trunk/LICENSE.TXT'],
-    'libevent': ['base/third_party/libevent/LICENSE'],
+    'libevent':
+    ['base/third_party/libevent/LICENSE', 'third_party/libevent/LICENSE'],
     'libjpeg_turbo': ['third_party/libjpeg_turbo/LICENSE.md'],
     'libsrtp': ['third_party/libsrtp/LICENSE'],
     'libunwind': ['buildtools/third_party/libunwind/trunk/LICENSE.TXT'],
@@ -220,6 +221,9 @@
       output_license_file.write('```\n')
       for path in self.common_licenses_dict[license_lib]:
         license_path = os.path.join(WEBRTC_ROOT, path)
+        # TODO(crbug.com/1335194) Workaround for unblocking autoroller.
+        if license_lib == "libevent" and not os.path.exists(license_path):
+          continue
         with open(license_path, 'r') as license_file:
           license_text = escape(license_file.read(), quote=True)
           output_license_file.write(license_text)