Esempio n. 1
0
func performUpgrade(opsFile string, state *operation.State) error {
	statefile := operation.NewStateFile(opsFile)
	if state.Kind == operation.Continue && state.Hook != nil && state.Hook.Kind == hooks.Stop {
		state.Stopped = true
		state.Hook = nil
		return statefile.Write(state)
	}
	return nil
}
Esempio n. 2
0
func addInstalled(opsFile string, state *operation.State) error {
	statefile := operation.NewStateFile(opsFile)
	if state.Kind == operation.Install {
		return nil
	}
	if state.Kind == operation.RunHook && state.Hook.Kind == hooks.Install {
		return nil
	}
	if !state.Installed {
		state.Installed = true
		return statefile.Write(state)
	}
	return nil
}