blob: ab6645a27be3b45e45a960e7c3fc5ae7bbc88ca6 [file] [log] [blame]
# -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Toolchain-related operations."""
from __future__ import print_function
import os
from chromite.api import validate
from chromite.lib import cros_logging as logging
from chromite.lib import gs
from chromite.lib import toolchain_util
def UpdateChromeEbuildWithOrderfile(input_proto, _output_proto, _config):
"""Update Chrome ebuild with most recent unvetted orderfile.
input_proto (UpdateChromeEbuildRequest): The input proto
_output_proto (UpdateChromeEbuildResponse): Empty output proto
_config (api_config.ApiConfig): The API call config.
board =
def UploadVettedOrderfile(_input_proto, output_proto, _config):
"""Upload a vetted orderfile to GS bucket.
_input_proto (UploadVettedOrderfileRequest): Empty input proto
output_proto (UploadVettedOrderfileResponse): The output proto
_config (api_config.ApiConfig): The API call config.
gs_context = gs.GSContext()
orderfile = toolchain_util.FindLatestChromeOrderfile(
if gs_context.Exists(
os.path.join(toolchain_util.ORDERFILE_GS_URL_VETTED, orderfile)):
output_proto.status = False
source_url = os.path.join(toolchain_util.ORDERFILE_GS_URL_UNVETTED, orderfile)
dest_url = os.path.join(toolchain_util.ORDERFILE_GS_URL_VETTED, orderfile)'Copying tarball from %s to %s', source_url, dest_url)
gs_context.Copy(source_url, dest_url, acl='public-read')
output_proto.status = True