debian-forge-composer/vendor/github.com/osbuild/images/internal/common/distro.go
Gianluca Zuccarelli f6b76cce31 Update osbuild/images to v0.41.0
Multiple blueprint fixes:

- Extend the blueprint service customizations to accept services to be
  masked.

- The `storage-path` and `container-transport` fields were removed in
  imagees 41.0 in order to simplify the way local storage containers are
  handled.
2024-02-29 20:57:39 +01:00

32 lines
766 B
Go

package common
import (
"github.com/hashicorp/go-version"
)
// Returns true if the version represented by the first argument is
// semantically older than the second.
//
// Meant to be used for comparing distro versions for differences between minor
// releases.
//
// Provided version strings are of any characters which are not
// digits or periods, and then split on periods.
// Assumes any missing components are 0, so 8 < 8.1.
// Evaluates to false if a and b are equal.
func VersionLessThan(a, b string) bool {
aV, err := version.NewVersion(a)
if err != nil {
panic(err)
}
bV, err := version.NewVersion(b)
if err != nil {
panic(err)
}
return aV.LessThan(bV)
}
func VersionGreaterThanOrEqual(a, b string) bool {
return !VersionLessThan(a, b)
}