func dumpdb(args []string) error { if len(args) != 1 { return UsageError{"dumpdb filename", "wrong number of arguments"} } bdb, err := db.OpenKyotoDB(args[0], false) if err != nil { return err } bdb.Dump(os.Stdout, "") return nil }
func openBuildDB() (build.BuildDB, error) { var bdb build.BuildDB var err error err = os.MkdirAll(".fubsy", 0755) if err != nil { return nil, err } bdb, err = db.OpenKyotoDB(".fubsy/buildstate.kch", true) if _, ok := err.(db.NotAvailableError); ok { bdb = db.NewFakeDB() err = nil log.Warning( "no database libraries available; build state will not be saved") } else if err != nil { return nil, err } return bdb, nil }