func updateLocalSeriesVersions() error {
	distroInfo := NewDistroInfo(UbuntuDistroInfo)
	if err := distroInfo.Refresh(); err != nil {
		return errors.Trace(err)
	}

	now := timeNow().UTC()

	for seriesName, version := range distroInfo.info {
		var esm bool
		if existing, ok := ubuntuSeries[seriesName]; ok {
			esm = existing.ESMSupported
		}

		// The numeric version may contain a LTS moniker so strip that out.
		trimmedVersion := strings.TrimSuffix(version.Version, " LTS")
		seriesVersions[seriesName] = trimmedVersion

		// If the series already exists inside of ubuntuSeries then don't
		// overwrite that existing one, except to update the supported status.
		supported := version.Supported(now)

		if us, ok := ubuntuSeries[seriesName]; ok {
			us.Supported = supported
			ubuntuSeries[seriesName] = us
			continue
		}

		ubuntuSeries[seriesName] = SeriesVersionInfo{
			Version:                  version.Version,
			Supported:                supported,
			ESMSupported:             esm,
			LTS:                      version.LTS(),
			CreatedByLocalDistroInfo: true,
		}
	}

	return nil
}
// updateLocalSeriesVersions updates seriesVersions from
// /usr/share/distro-info/ubuntu.csv if possible..
updateLocalSeriesVersions updates seriesVersions from
/usr/share/distro-info/ubuntu.csv if possible
// updateLocalSeriesVersions updates seriesVersions from // / usr / share / distro - info / ubuntu . csv if possible ..
func updateLocalSeriesVersions() error {
	distroInfo := NewDistroInfo(UbuntuDistroInfo)
	if err := distroInfo.Refresh(); err != nil {
		return errors.Trace(err)
	}
	now := timeNow().UTC()
	for seriesName, version := range distroInfo.info {
		var esm bool
		if existing, ok := ubuntuSeries[seriesName]; ok {
			esm = existing.ESMSupported
		}
		trimmedVersion := strings.TrimSuffix(version.Version, " LTS")
		seriesVersions[seriesName] = trimmedVersion
		supported := version.Supported(now)
		if us, ok := ubuntuSeries[seriesName]; ok {
			us.Supported = supported
			ubuntuSeries[seriesName] = us
			continue
		}
		ubuntuSeries[seriesName] = SeriesVersionInfo{
			Version:                  version.Version,
			Supported:                supported,
			ESMSupported:             esm,
			LTS:                      version.LTS(),
			CreatedByLocalDistroInfo: true,
		}
	}
	return nil
}
func updateLocalSeriesVersions ( ) error { distroInfo := NewDistroInfo ( UbuntuDistroInfo ) if err := distroInfo . Refresh ( ) ; err != nil { return errors . Trace ( err ) } now := timeNow ( ) . UTC ( ) for seriesName , version := range distroInfo . info { var esm bool if existing , ok := ubuntuSeries [ seriesName ] ; ok { esm = existing . ESMSupported } trimmedVersion := strings . TrimSuffix ( version . Version , " " ) seriesVersions [ seriesName ] = trimmedVersion supported := version . Supported ( now ) if us , ok := ubuntuSeries [ seriesName ] ; ok { us . Supported = supported ubuntuSeries [ seriesName ] = us continue } ubuntuSeries [ seriesName ] = SeriesVersionInfo { Version : version . Version , Supported : supported , ESMSupported : esm , LTS : version . LTS ( ) , CreatedByLocalDistroInfo : true , } } return nil }
updateLocalSeriesVersions updates seriesVersions from
usr/share/distro-info/ubuntu.csv if possible
updateLocalSeriesVersions updates seriesVersions from usr / share / distro - info / ubuntu . csv if possible
// The numeric version may contain a LTS moniker so strip that out. // If the series already exists inside of ubuntuSeries then don't // overwrite that existing one, except to update the supported status.