go: go.chromium.org/chromiumos/infra/go/internal/chromeos_version Index | Files

package chromeos_version

import "go.chromium.org/chromiumos/infra/go/internal/chromeos_version"

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.


Package Files



var (
    VersionFileProjectPath string = "chromeos/config/chromeos_version.sh"

This is a var and not a const for testing purposes.

func VersionsEqual Uses

func VersionsEqual(a, b VersionInfo) bool

VersionsEqual returns true if the two versions are equal, and false otherwise.

type VersionComponent Uses

type VersionComponent string
const (
    Unspecified  VersionComponent = "UNSPECIFIED"
    ChromeBranch VersionComponent = "CHROME_BRANCH"
    Build        VersionComponent = "CHROMEOS_BUILD"
    Branch       VersionComponent = "CHROMEOS_BRANCH"
    Patch        VersionComponent = "CHROMEOS_PATCH"

type VersionInfo Uses

type VersionInfo struct {
    ChromeBranch      int
    BuildNumber       int
    BranchBuildNumber int
    PatchNumber       int
    VersionFile       string

func GetVersionInfoFromRepo Uses

func GetVersionInfoFromRepo(sourceRepo string) (VersionInfo, error)

GetVersionInfoFromRepo reads version info from a fixed location in the specified repository.

func ParseVersionInfo Uses

func ParseVersionInfo(fileData []byte) (VersionInfo, error)

ParseVersionInfo parses file contents for version info.

func (*VersionInfo) IncrementVersion Uses

func (v *VersionInfo) IncrementVersion(incrType VersionComponent) string

func (*VersionInfo) StrippedVersionString Uses

func (v *VersionInfo) StrippedVersionString() string

StrippedVersionString returns the stripped version string of the given VersionInfo struct, i.e. the non-zero components of the version. Example: 123.1.0 --> 123.1 Example: 123.0.0 --> 123

func (*VersionInfo) UpdateVersionFile Uses

func (v *VersionInfo) UpdateVersionFile() error

UpdateVersionFile updates the version file with our current version.

func (*VersionInfo) VersionComponents Uses

func (v *VersionInfo) VersionComponents() []int

func (*VersionInfo) VersionString Uses

func (v *VersionInfo) VersionString() string

Package chromeos_version imports 9 packages (graph) and is imported by 3 packages. Updated 2021-01-26. Refresh now. Tools for package owners.