| @@ -0,0 +1,37 @@ | ||
| bundle common cfengine_stdlib | ||
| { | ||
| vars: | ||
| cfengine_3_4:: | ||
| "inputs" slist => { "libraries/cfengine_stdlib.cf" }; | ||
| cfengine_3_5:: | ||
| "inputs" slist => { | ||
| "lib/3.5/paths.cf", | ||
| "lib/3.5/common.cf", | ||
| "lib/3.5/commands.cf", | ||
| "lib/3.5/packages.cf", | ||
| "lib/3.5/files.cf", | ||
| "lib/3.5/services.cf", | ||
| "lib/3.5/processes.cf", | ||
| "lib/3.5/storage.cf", | ||
| "lib/3.5/databases.cf", | ||
| "lib/3.5/monitor.cf", | ||
| "lib/3.5/guest_environments.cf", | ||
| "lib/3.5/bundles.cf", | ||
| }; | ||
|
|
||
| !(cfengine_3_4||cfengine_3_5):: | ||
| "inputs" slist => { | ||
| "lib/$(sys.cf_version_major).$(sys.cf_version_minor)/paths.cf", | ||
| "lib/$(sys.cf_version_major).$(sys.cf_version_minor)/common.cf", | ||
| "lib/$(sys.cf_version_major).$(sys.cf_version_minor)/commands.cf", | ||
| "lib/$(sys.cf_version_major).$(sys.cf_version_minor)/packages.cf", | ||
| "lib/$(sys.cf_version_major).$(sys.cf_version_minor)/files.cf", | ||
| "lib/$(sys.cf_version_major).$(sys.cf_version_minor)/services.cf", | ||
| "lib/$(sys.cf_version_major).$(sys.cf_version_minor)/processes.cf", | ||
| "lib/$(sys.cf_version_major).$(sys.cf_version_minor)/storage.cf", | ||
| "lib/$(sys.cf_version_major).$(sys.cf_version_minor)/databases.cf", | ||
| "lib/$(sys.cf_version_major).$(sys.cf_version_minor)/monitor.cf", | ||
| "lib/$(sys.cf_version_major).$(sys.cf_version_minor)/guest_environments.cf", | ||
| "lib/$(sys.cf_version_major).$(sys.cf_version_minor)/bundles.cf", | ||
| }; | ||
| } |
| @@ -0,0 +1,18 @@ | ||
| body common control | ||
| { | ||
| bundlesequence => { | ||
| "main", | ||
| }; | ||
| } | ||
|
|
||
| bundle agent main | ||
| { | ||
| methods: | ||
|
|
||
| "any" usebundle => test; | ||
| } | ||
|
|
||
| bundle agent test | ||
| { | ||
|
|
||
| } |
| @@ -0,0 +1,20 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Loic Pefferkorn <loic-cfengine@loicp.eu> | ||
|
|
||
| # Extract functions from CFEngine documentation. Should be run | ||
| # inside CFEngine/documentation repository, in reference/functions directory: | ||
| # | ||
| # git clone https://github.com/cfengine/documentation.git | ||
| # cd documentation/reference/functions | ||
| # ~/path/to/tools/extract_cf3BuiltIns.sh | ||
|
|
||
| #find $1 -type f -name '*.markdown' -printf "%f "|\ | ||
| #sed -e 's/.markdown//g'|\ | ||
| #awk '{count=split($0, tab); asort(tab);for (i=0;i<=count;i++) { if (i % 6 == 0) printf "MARK";printf "%s ", tab[i]}} END{print "contained"}'|\ | ||
| #sed 's/MARK/contained\nsyn keyword cf3BuiltIns\t/g'|tail -n +2 | ||
|
|
||
| find . -type f -name '*.markdown' -exec basename {} .markdown \; |\ | ||
| gsed -re 's/^(.*)intrealstring(.*)/\1int\2\n\1real\2\n\1string\2/' | sort | xargs |\ | ||
| awk '{count=split($0,tab); for(i=0;i<count;i++) { if(i%6==0) printf "MARK"; printf "%s ",tab[i]}} END{print "contained"}' |\ | ||
| gsed 's/MARK\s*/contained\nsyn keyword cf3BuiltIns\t/g' | tail -n +2 |
| @@ -0,0 +1,15 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Loic Pefferkorn <loic-cfengine@loicp.eu> | ||
|
|
||
| # Extract functions from CFEngine stdlib documentation. Should be run | ||
| # inside CFEngine masterfiles repository: | ||
| # | ||
| # git clone https://github.com/cfengine/masterfiles.git | ||
| # cd masterfiles | ||
| # ~/path/to/tools/extract_cf3Stdlib.sh | ||
|
|
||
| find . -path "./lib*" -type f -name '*.cf' | xargs cat | grep -E '^(bundle|body)'| sort | uniq\ | ||
| |awk '{gsub(/\(.+/, "", $3);printf " %s", $3}'\ | ||
| |awk '{count=split($0, tab); asort(tab);for (i=0;i<=count;i++) { if (i % 6 ==0) printf "MARK";printf "%s ", tab[i]}} END{ print "contained"}'\ | ||
| |sed 's/MARK/contained\nsyn keyword cf3Stdlib\t/g'|tail -n +2 |
| @@ -0,0 +1,13 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Extract functions from Evolve Thinking's free promise libary. Should be run | ||
| # inside masterfiles: | ||
| # | ||
| # git clone https://github.com/evolvethinking/evolve_cfengine_freelib.git | ||
| # cd evolve_cfengine_freelib | ||
| # ~/path/to/tools/extract_cf3evolve_freelib.sh | ||
|
|
||
| find . -type f -name 'evolve_freelib.cf' | xargs cat\ | ||
| | awk '/^(bundle|body)/ {gsub(/\(.*/, "", $3);printf " %s", $3}'\ | ||
| | awk '{count=split($0, tab); asort(tab);for (i=0;i<=count;i++) { if (i % 6 ==0) printf "MARK";printf "%s ", tab[i]}} END{ print "contained"}'|\ | ||
| sed 's/MARK/contained\nsyn keyword cf3Evolve_freelib\t/g'|tail -n +2 |
| @@ -0,0 +1,22 @@ | ||
| " Minimal vimrc | ||
| set smartindent | ||
| set autoindent | ||
| syntax on | ||
| filetype plugin indent on | ||
|
|
||
| :helptags ~/.vim/doc/ | ||
| " enable vim_cf3 plugin abbreviations | ||
| let g:EnableCFE3KeywordAbbreviations=1 | ||
|
|
||
| fun! Getchar() | ||
| let c = getchar() | ||
| if c != 0 | ||
| let c = nr2char(c) | ||
| endif | ||
| return c | ||
| endfun | ||
|
|
||
| fun! Eatchar(pat) | ||
| let c = Getchar() | ||
| return (c =~ a:pat) ? '' : c | ||
| endfun |