diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2011-05-16 19:57:39 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2011-05-16 19:57:39 -0700 |
commit | 76ff750a6b057dacba1361726f15cd5bd4bfe14b (patch) | |
tree | 8eea69cfa6ba3377883d2caa4aeca874c100b2a3 /debian | |
parent | 7ea935bc47f37111b95ed8a4f989a2ae3f578e5a (diff) | |
download | vyatta-cfg-76ff750a6b057dacba1361726f15cd5bd4bfe14b.tar.gz vyatta-cfg-76ff750a6b057dacba1361726f15cd5bd4bfe14b.zip |
reimplement commit hooks mechanism
* do NOT reinvent the wheel (directory traversal, sorting, script execution, etc.) when the functionality is already provided by the system.
* eliminate hard-coded hook directory in various feastures. everyone should obtain the directory path from the config backend.
Diffstat (limited to 'debian')
-rw-r--r-- | debian/vyatta-cfg.postinst.in | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/debian/vyatta-cfg.postinst.in b/debian/vyatta-cfg.postinst.in index 5585e2a..7ba4332 100644 --- a/debian/vyatta-cfg.postinst.in +++ b/debian/vyatta-cfg.postinst.in @@ -33,6 +33,14 @@ for bin in my_cli_bin my_cli_shell_api; do setcap cap_sys_admin=pe $sbindir/$bin done +# commit hooks +for hook in PreCommit PostCommit; do + d=$(cli-shell-api get${hook}HookDir) + if [ -n "$d" ] && [ ! -e "$d" ]; then + mkdir -p "$d" + fi +done + # handle renamed file (not automatically deleted since it was "conffile") rm -f /etc/bash_completion.d/20vyatta-cfg |