Пример #1
0
func (t *CatalogReleaseTimeInfo) Time(sourceSpec diskformat.CatalogSpec, md5Sum diskformat.Md5Sum) (time.Time, error) {
	sourceSpec.Catrel = from_catrel_flag

	if catTime, ok := t.catalogs[sourceSpec]; ok {
		if pti, ok := catTime[md5Sum]; ok {
			return pti.ChangedAt, nil
		}
		return time.Time{}, fmt.Errorf("Could not find timing for %v in %v", md5Sum, sourceSpec)
	}
	return time.Time{}, fmt.Errorf("Could not find timing information for catalog %v", sourceSpec)
}
Пример #2
0
// This means "we notice that this package is missing from the source catalog
// now." It's used when there's a package missing from the source / unstable
// catalog, and present in the testing catalog. We want to know the approximated
// deletion time. If we don't have any information, we call this function and
// this starts the timer for deletion.
func (t *CatalogReleaseTimeInfo) AddMissing(spec diskformat.CatalogSpec, p diskformat.PackageExtra) {
	spec.Catrel = from_catrel_flag
	if _, ok := t.catalogs[spec]; !ok {
		t.catalogs[spec] = make(map[diskformat.Md5Sum]PackageTimeInfo)
	}
	t.catalogs[spec][p.Md5_sum] = PackageTimeInfo{
		spec,
		p,
		false,
		time.Now(),
	}
}