Module("stratego/xtc/posix/Repository",[Strategies([SDefNoArgs("read-repository-file",CondChoice(CallNoArgs(SVar("can-read-file")),CallNoArgs(SVar("ReadFromFile")),Seq(CondChoice(CallNoArgs(SVar("file-exists")),CallT(SVar("log"),[],[NoAnnoList(Op("Error",[])),App(CallNoArgs(SVar("conc-strings")),NoAnnoList(Tuple([NoAnnoList(Str("\"no read permission for repository \"")),RootApp(Id)])))]),IfThen(Not(BA(CallNoArgs(SVar("get-config")),NoAnnoList(Str("\"register\"")))),CallT(SVar("log"),[],[NoAnnoList(Op("Error",[])),App(CallNoArgs(SVar("concat-strings")),NoAnnoList(List([NoAnnoList(Str("\"repository \"")),RootApp(Id),NoAnnoList(Str("\" does not exist\""))])))]))),Build(NoAnnoList(List([])))))),SDefNoArgs("xtc-store",Seq(CallT(SVar("log"),[],[NoAnnoList(Op("Vomit",[])),NoAnnoList(Str("\"Saving repository\""))]),Seq(BA(CallNoArgs(SVar("get-config")),NoAnnoList(Str("\"-r\""))),CondChoice(CallNoArgs(SVar("can-write-repository")),BA(CallNoArgs(SVar("WriteToBinaryFile")),NoAnnoList(Tuple([RootApp(Id),App(CallNoArgs(SVar("table-getlist")),Var("XTC"))]))),Seq(CallT(SVar("log"),[],[NoAnnoList(Op("Error",[])),App(CallNoArgs(SVar("conc-strings")),NoAnnoList(Tuple([NoAnnoList(Str("\"no write permission for repository \"")),RootApp(Id)])))]),Fail))))),SDefNoArgs("can-write-repository",GuardedLChoice(CallNoArgs(SVar("file-exists")),CallNoArgs(SVar("can-write-file")),Id))])])
