Beispiel #1
0
func (x *cmdRollback) doRollback() error {
	pkg := x.Positional.PackageName
	version := x.Positional.Version
	if pkg == "" {
		return errNeedPackageName
	}

	nowVersion, err := snappy.Rollback(pkg, version, progress.MakeProgressBar())
	if err != nil {
		return err
	}
	// TRANSLATORS: the first %s is a pkgname, the second %s is the new version
	fmt.Printf(i18n.G("Setting %s to version %s\n"), pkg, nowVersion)

	m := snappy.NewMetaRepository()
	installed, err := m.Installed()
	if err != nil {
		return err
	}

	parts := snappy.FindSnapsByNameAndVersion(pkg, nowVersion, installed)
	showVerboseList(parts, os.Stdout)

	return nil
}
Beispiel #2
0
func (inst *snapInstruction) rollback() interface{} {
	_, err := snappy.Rollback(inst.pkg, "", inst)
	return err
}
Beispiel #3
0
func (inst *packageInstruction) rollback() interface{} {
	_, err := snappy.Rollback(inst.pkg, "", inst.prog)
	return err
}