summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/build/get_symlink_targets.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /third_party/libwebrtc/build/get_symlink_targets.py
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/build/get_symlink_targets.py')
-rwxr-xr-xthird_party/libwebrtc/build/get_symlink_targets.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/third_party/libwebrtc/build/get_symlink_targets.py b/third_party/libwebrtc/build/get_symlink_targets.py
new file mode 100755
index 0000000000..3285ff1d93
--- /dev/null
+++ b/third_party/libwebrtc/build/get_symlink_targets.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+# Copyright (c) 2019 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+"""Prints the target paths of the given symlinks.
+
+Prints out each target in the order that the links were passed in.
+"""
+
+import os
+import sys
+
+
+def main():
+ for link_name in sys.argv[1:]:
+ if not os.path.islink(link_name):
+ sys.stderr.write("%s is not a link" % link_name)
+ return 1
+ target = os.readlink(link_name)
+ if not os.path.isabs(target):
+ target = os.path.join(os.path.dirname(link_name), target)
+ print(os.path.realpath(target))
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())