diff options
Diffstat (limited to 'trunk/lib/common.sh')
-rw-r--r-- | trunk/lib/common.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh index 5785223..952f25d 100644 --- a/trunk/lib/common.sh +++ b/trunk/lib/common.sh @@ -447,3 +447,36 @@ function set_jail_perms { } +function use_svn { + + # check if svn usage is enabled + + if [ "$TEMPLATES_UNDER_SVN" == "1" ] && \ + [ "$TEMPLATE_STORAGE_STYLE" == "own-folder" ]; then + return 0 + else + return 1 + fi + +} + +function svn_check { + + # check if a file is under svn + # usage: svn_check <file> + + local cwd + + cwd="`pwd`" + cd `dirname $1` + + if [ "`svn status $1 | awk '{ print $1 }'`" == "?" ]; then + return 1 + else + return 0 + fi + + cd $cwd + +} + |