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.



    This section is empty.


    View Source
    var (
    	VersionFileProjectPath string = "chromeos/config/"

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


      func VersionsEqual

      func VersionsEqual(a, b VersionInfo) bool

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


        type VersionComponent

        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

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

        func GetVersionInfoFromRepo

        func GetVersionInfoFromRepo(sourceRepo string) (VersionInfo, error)

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

          func ParseVersionInfo

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

            ParseVersionInfo parses file contents for version info.

            func (*VersionInfo) IncrementVersion

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

            func (*VersionInfo) StrippedVersionString

            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

              func (v *VersionInfo) UpdateVersionFile() error

                UpdateVersionFile updates the version file with our current version.

                func (*VersionInfo) VersionComponents

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

                func (*VersionInfo) VersionString

                func (v *VersionInfo) VersionString() string