Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F4000810
sequence
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jul 9, 4:52 AM
Size
1 KB
Mime Type
text/plain
Expires
Sat, Jul 11, 4:52 AM (1 d, 3 h)
Engine
blob
Format
Raw Data
Handle
273355
Attached To
rXR Xreate
sequence
View Options
include raw "core/dependencies.lp"
include raw "core/control-context.lp"
include raw "core/unit-tests.lp"
start = function:: int; entry {
context:: goal(artefact(gcc)).
provideGoals()
}
provideGoals = function():: int {
loop context (goal) {
visit_artefact()
}
}
visitArtefact = function(){
switch (EXISTS()){
case INSTALLED {
ad hoc NOACTION
}
case NON_INSTALLED {
run [
PROVIDE_DEPENDENCIES(),
PROVIDE())
]
}
}
}
provideDependencies() = function() {
rule context {
childs(Child) <- artefact(Item); artefact_depends(Item, Child).
}
loop context (childs) {
VISIT_ARTEFACT().
}
}
case context:: artefact(subversion) {
EXISTS = function() {
exec("svn --version"):: ExpectNoErrors; log("Check svn").
}
PROVIDE = function(){
exec("sudo apt-get install subversion"):: log("[Subversion] Installation").
}
}
// DRAFT
/*
flagIsProvided = if(dictProvided(<item>)) {true} else
dictProvided = dictProvided + <item>
expectErrorCode = pre function(x::int){
if (x==0)::bool {ad hoc "Success"}
else {ad hoc "Error"}
}
*/
Event Timeline
Log In to Comment