misc

package
v0.0.0-...-d996d1d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Copyright 2023 The Chromium Authors Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskConfirmation

func AskConfirmation(s string) (bool, error)

AskConfirmation asks users a question for Y/N answer.

func BoolVal

func BoolVal(val string) bool

BoolVal fetches a bool val from a string. Returns false if unable to parse.

func GetEnv

func GetEnv(key, fallback string) string

GetEnv is helper to get env variables and falling back if not set.

func IsCustomBuild

func IsCustomBuild(build string) bool

func MakeTempFile

func MakeTempFile(content string) (string, error)

MakeTempFile makes a temporary file.

func MapTestArgsToStr

func MapTestArgsToStr(m map[string]string) string

MapTestArgsToStr converts a TestArgs map into string.

func RemovePrefixFromTestArgs

func RemovePrefixFromTestArgs(m map[string]string, prefix string) map[string]string

RemovePrefixFromTestArgs removes requested prefix from testArgs key. It also removes args without requested prefix.

func StableVersionFromFile

func StableVersionFromFile(board string, model string) (*models.RecoveryVersion, error)

StableVersionFromFile reads stable version from file.

func StageAndWriteLocalStableVersion

func StageAndWriteLocalStableVersion(
	ctx context.Context,
	service build_service.IBuildService,
	rv *models.RecoveryVersion,
	path string,
) error

StageAndWriteLocalStableVersion stages a recovery image to partner bucket and writes the associated rv metadata locally.

func StrTestArgsToMap

func StrTestArgsToMap(str string) map[string]string

StrTestArgsToMap converts a TestArgs string into map[string]string.

func TrimOutput

func TrimOutput(output []byte) string

TrimOutput trims trailing whitespace from command output.

func WriteLocalStableVersion

func WriteLocalStableVersion(recoveryVersion *models.RecoveryVersion, path string) error

WriteLocalStableVersion saves a recovery version to the specified directory and creates the directory if necessary.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL