diff options
Diffstat (limited to 'chromium/build/fuchsia/common.py')
-rw-r--r-- | chromium/build/fuchsia/common.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/chromium/build/fuchsia/common.py b/chromium/build/fuchsia/common.py index 3ec1e67aa64..7dd3d52cac8 100644 --- a/chromium/build/fuchsia/common.py +++ b/chromium/build/fuchsia/common.py @@ -15,6 +15,8 @@ SDK_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'fuchsia-sdk', 'sdk') IMAGES_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'fuchsia-sdk', 'images') +_PM = os.path.join(SDK_ROOT, 'tools', 'pm') + def EnsurePathExists(path): """Checks that the file |path| exists on the filesystem and returns the path if it does, raising an exception otherwise.""" @@ -40,9 +42,9 @@ def GetHostArchFromPlatform(): return 'arm64' raise Exception('Unsupported host architecture: %s' % host_arch) -def GetQemuRootForPlatform(): +def GetEmuRootForPlatform(emulator): return os.path.join(DIR_SOURCE_ROOT, 'third_party', - 'qemu-' + GetHostOsFromPlatform() + '-' + + emulator + '-' + GetHostOsFromPlatform() + '-' + GetHostArchFromPlatform()) def ConnectPortForwardingTask(target, local_port, remote_port = 0): @@ -86,3 +88,11 @@ def GetAvailableTcpPort(): port = sock.getsockname()[1] sock.close() return port + + +def PublishPackage(package_path, tuf_root): + """Publishes a combined FAR package to a TUF repository root.""" + + subprocess.check_call( + [_PM, 'publish', '-a', '-f', package_path, '-r', tuf_root, '-vt', '-v'], + stderr=subprocess.STDOUT) |