| 1 |
-- main.mcl -- |
| 2 |
file "/tmp/frags/" { |
| 3 |
state => $const.res.file.state.exists, |
| 4 |
} |
| 5 |
|
| 6 |
# fragments |
| 7 |
file "/tmp/frags/f1" { |
| 8 |
state => $const.res.file.state.exists, |
| 9 |
content => "i am f1\n", |
| 10 |
} |
| 11 |
file "/tmp/frags/f2" { |
| 12 |
state => $const.res.file.state.exists, |
| 13 |
content => "i am f2\n", |
| 14 |
} |
| 15 |
file "/tmp/frags/f3" { |
| 16 |
state => $const.res.file.state.exists, |
| 17 |
content => "i am f3\n", |
| 18 |
} |
| 19 |
|
| 20 |
# You can also drop in an unmanaged file into the frags dir for it to get used! |
| 21 |
# And of course you can hard-code the list of files to use like this one is... |
| 22 |
file "/tmp/bonus_file" { |
| 23 |
state => $const.res.file.state.exists, |
| 24 |
content => "i am a bonus file\n", |
| 25 |
} |
| 26 |
|
| 27 |
# automatic edges will get added! |
| 28 |
file "/tmp/whole1" { |
| 29 |
state => $const.res.file.state.exists, |
| 30 |
fragments => [ |
| 31 |
"/tmp/frags/", # pull from this dir |
| 32 |
"/tmp/bonus_file", # also pull this one file |
| 33 |
], |
| 34 |
} |
| 35 |
-- OUTPUT -- |
| 36 |
Edge: file[/tmp/frags/] -> file[/tmp/frags/f1] # file[/tmp/frags/] -> file[/tmp/frags/f1] (autoedge) |
| 37 |
Edge: file[/tmp/frags/] -> file[/tmp/frags/f2] # file[/tmp/frags/] -> file[/tmp/frags/f2] (autoedge) |
| 38 |
Edge: file[/tmp/frags/] -> file[/tmp/frags/f3] # file[/tmp/frags/] -> file[/tmp/frags/f3] (autoedge) |
| 39 |
Edge: file[/tmp/bonus_file] -> file[/tmp/whole1] # file[/tmp/bonus_file] -> file[/tmp/whole1] (autoedge) |
| 40 |
Edge: file[/tmp/frags/] -> file[/tmp/whole1] # file[/tmp/frags/] -> file[/tmp/whole1] (autoedge) |
| 41 |
Vertex: file[/tmp/bonus_file] |
| 42 |
Vertex: file[/tmp/frags/] |
| 43 |
Vertex: file[/tmp/frags/f1] |
| 44 |
Vertex: file[/tmp/frags/f2] |
| 45 |
Vertex: file[/tmp/frags/f3] |
| 46 |
Vertex: file[/tmp/whole1] |